V3: Add gdb python plugin which analyzes vulnerability

Denys Vlasenko dvlasenk at redhat.com
Tue Jun 18 11:40:52 UTC 2013


On 06/17/2013 06:03 PM, Martin Milata wrote:
> On Fri, Jun 14, 2013 at 13:56:51 +0200, Denys Vlasenko wrote:
>> Martin, can you try it?
>> It should be working with stock gdb and kernel.
> 
> One small problem: this happens when the tool is run on coredumps with
> multiple threads:
> 
> abrtd: Missing separate debuginfo for the main executable file
> abrtd: Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/8d/e70b65a7828735a2b9eeaffdfbc1da44a36245
> abrtd: [New LWP 847]
> abrtd: [New LWP 871]
> abrtd: [New LWP 873]
> abrtd: [New LWP 869]
> abrtd: [New LWP 874]
> abrtd: [New LWP 870]
> abrtd: [New LWP 875]
> abrtd: [New LWP 877]
> abrtd: [New LWP 878]
> abrtd: [New LWP 876]
> abrtd: [New LWP 872]
> abrtd: Core was generated by `/usr/sbin/libvirtd'.
> abrtd: Program terminated with signal 11, Segmentation fault.
> abrtd: #0  0x0000003739ae8bdf in ?? ()
> abrtd: Python Exception <type 'exceptions.ValueError'> invalid literal for int() with base 10: '11\n11\n11\n11\n11\n11\n11\n11\n11\n11\n11':
> abrtd: Error occurred in Python command: invalid literal for int() with base 10: '11\n11\n11\n11\n11\n11\n11\n11\n11\n11\n11'
> abrtd: Error while running gdb:


Thanks! Committed this fix:

 # Find "cursig: N" and extract N.
 # This gets used by abrt-exploitable as a fallback
 # if gdb and/or kernel is uncooperative.
-SIGNO_OF_THE_COREDUMP=$(eu-readelf -n coredump | grep -o 'cursig: *[0-9]*' | sed 's/[^0-9]//g')
+# "grep -m1": take the first match (on Linux, every thread has its own
+# prstatus struct in the coredump, but the signal number which killed us
+# must be the same in all these structs).
+SIGNO_OF_THE_COREDUMP=$(eu-readelf -n coredump | grep -m1 -o 'cursig: *[0-9]*' | sed 's/[^0-9]//g')
 export SIGNO_OF_THE_COREDUMP




More information about the Crash-catcher mailing list