Bug 818529 - ltrace segmentation fault when parsing faulty -n option
Summary: ltrace segmentation fault when parsing faulty -n option
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ltrace
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Machata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-03 09:25 UTC by Richard W.M. Jones
Modified: 2015-05-05 01:36 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-05-26 07:15:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2012-05-03 09:25:44 UTC
Description of problem:

$ ltrace -n -l /usr/lib64/libselinux.so /bin/ls
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

Notice there is no `-n' option argument.

Version-Release number of selected component (if applicable):

ltrace-0.6.0-4.fc17.x86_64

How reproducible:

100%

Steps to Reproduce:
<see above>

Comment 1 Petr Machata 2012-05-03 13:21:38 UTC
There actually is an -n option, it's used for indentation depending on function call depth.  So this is how ltrace understands your command line:

$ ltrace -n"-l" -- /usr/lib64/libselinux.so /bin/ls

So it tries to run /usr/lib64/libselinux.so with the argument /bin/ls, and that predictably SIGSEVS.

I think ltrace should warn about invalid argument to -n (that it's not an integer), but other than that I don't think there's much to do.

Comment 2 Richard W.M. Jones 2012-05-03 13:34:10 UTC
Oh I see ...  I thought it was segfaulting parsing "-l"
as an integer, but I see that your explanation makes more
sense.

Well, maybe it's not a bug in that case ...

Comment 3 Petr Machata 2012-05-03 18:26:35 UTC
I added the -n checking patch to F17 and rawhide.

Comment 4 Fedora Update System 2012-05-03 19:16:17 UTC
ltrace-0.6.0-11.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/ltrace-0.6.0-11.fc17

Comment 5 Richard W.M. Jones 2012-05-03 21:05:43 UTC
$ ltrace -n -l /lib64/libselinux.so.1 /bin/ls -lZ
Invalid argument to -n: '-l'.  Use integer 0..20.

Works for me.

Comment 6 Fedora Update System 2012-05-04 03:09:37 UTC
Package ltrace-0.6.0-11.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ltrace-0.6.0-11.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-7253/ltrace-0.6.0-11.fc17
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2012-05-26 07:15:56 UTC
ltrace-0.6.0-11.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.