Summary: | Quadratic slowdown in backtrace for deep stack traces | ||
---|---|---|---|
Product: | gdb | Reporter: | Paul Pluzhnikov <ppluzhnikov> |
Component: | backtrace | Assignee: | Joel Brobecker <brobecker> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gdb-prs, tromey |
Priority: | P2 | ||
Version: | 6.8 | ||
Target Milestone: | 6.8 | ||
Host: | x86_64-unknown-linux-gnu | Target: | x86_64-unknown-linux-gnu |
Build: | x86_64-unknown-linux-gnu | Last reconfirmed: | |
Attachments: | debug trace referenced above |
Description
Paul Pluzhnikov
2009-01-05 18:08:12 UTC
Created attachment 3636 [details]
debug trace referenced above
Just for the record: I can also reproduce on my x86-linux laptop. I started at 1000, and each thousand I added almost multiplied the time by 2. I then tried with a debugger based on 6.8, just to see what type of behavior we get, and it seems linear: Each thousand I added added an extra ~120ms (I tried from 1000 to 10_000). The slowdown comes from printing the frame corresponding to "main", because argv is stored in %rsi. The following transcript shows a more isolated way of reproducing the issue: (gdb) set print frame-arguments none (gdb) run 5000 Starting program: /[...]/deep 5000 Program received signal SIGABRT, Aborted. 0x00007ffff7a9efb5 in raise () from /lib/libc.so.6 (gdb) frame 5004 #5004 0x00000000004005a2 in main (argc=..., argv=...) at deep.c:34 34 return visit (&n); (gdb) p /x $rsi $1 = 0x748b The "p /x $rsi" take a long time, while the rest is pretty much instantaneous. That's as much as I can do for today, but look at it some more tomorrow. Fixed by the following patch: http://www.sourceware.org/ml/gdb-patches/2009-09/msg00251.html. |