Summary: | gdb Segfaults due stack overflow (excessive usage of alloca) | ||
---|---|---|---|
Product: | gdb | Reporter: | Holger Freyther <zecke> |
Component: | symtab | Assignee: | Paul Pluzhnikov <ppluzhnikov> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gdb-prs, ppluzhnikov |
Priority: | P2 | ||
Version: | unknown | ||
Target Milestone: | 6.8 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | Hack to change alloca to malloc |
Description
Holger Freyther
2009-07-29 05:38:27 UTC
Created attachment 4095 [details]
Hack to change alloca to malloc
The following workaround is working for me. The idea is to exchange alloca with
malloc.
A related patch for the same problem (but in different area of GDB): http://sourceware.org/ml/gdb-patches/2009-07/msg00598.html Holger, could you send me (or otherwise make available) the bin/QtLauncher binary which makes GDB crash? (In reply to comment #2) > A related patch for the same problem (but in different area of GDB): > http://sourceware.org/ml/gdb-patches/2009-07/msg00598.html > > Holger, could you send me (or otherwise make available) the bin/QtLauncher > binary which makes GDB crash? The binary + WebKit library is +100mb of size. Where should I send it or upload it? Sorry for delaying it, I will try to compile and provide the necessary libraries by next week. Following Holger's directions and additional directions here: http://trac.webkit.org/wiki/BuildingQtOnLinux#DependenciesforspecificLinuxdistributions I built debug version of Webkit with: WebKitTools/Scripts/build-webkit --qt --debug on Fedora 11/i686 and tested it with GDB from CVS Head, which did not crash with (default) 'ulimit -s' of 10240 The resulting libQtWebKit.so.4.5.2 is 472223763 bytes. It does crash with 6M stack though. The problem is alloca in elf_symtab_read in a loop. Patch sent: http://sourceware.org/ml/gdb-patches/2009-10/msg00163.html With the patch, GDB runs in 16K stack (ulimit -s 16) on this test case without any problems. Subject: Bug 10457 CVSROOT: /cvs/src Module name: src Changes by: ppluzhnikov@sourceware.org 2009-10-08 16:38:42 Modified files: gdb : ChangeLog elfread.c Log message: 2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com> PR gdb/10457 * elfread.c (elf_symtab_read): Don't use alloca in a loop. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.10941&r2=1.10942 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/elfread.c.diff?cvsroot=src&r1=1.77&r2=1.78 Fixed on trunk. Subject: Bug 10457 CVSROOT: /cvs/src Module name: src Branch: gdb_7_0-branch Changes by: ppluzhnikov@sourceware.org 2009-10-08 17:42:10 Modified files: gdb : ChangeLog elfread.c Log message: 2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com> PR gdb/10457 * elfread.c (elf_symtab_read): Don't use alloca in a loop. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.10874.2.48&r2=1.10874.2.49 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/elfread.c.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.77&r2=1.77.4.1 |