Bug 497849 - pstack truncates stack trace lines
Summary: pstack truncates stack trace lines
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 10
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-27 14:54 UTC by Oliver Henshaw
Modified: 2009-04-27 15:28 UTC (History)
2 users (show)

Fixed In Version: gdb-6.8.50.20090302-22.fc12
Clone Of:
Environment:
Last Closed: 2009-04-27 15:28:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
pstack of kded4 with truncated lines (3.85 KB, text/plain)
2009-04-27 14:56 UTC, Oliver Henshaw
no flags Details
similar gdb bt of kded4 without truncated lines (4.40 KB, text/plain)
2009-04-27 14:57 UTC, Oliver Henshaw
no flags Details

Description Oliver Henshaw 2009-04-27 14:54:45 UTC
Description of problem:

Using pstack to sample the stack of running processes, I see some of the lines are truncated. The full line is printed when using gdb to sample the stack. For example,

pstack gives "QEventDispatcherGlib::processEvents (this=0x97c8948, flags="
gdb gives "QEventDispatcherGlib::processEvents (this=0x97c8948, flags={i = 36}) at kernel/qeventdispatcher_glib.cpp:32"

The "at blah/blah.cpp:XX" part is always missing for pstack, not sure whether that is by design or not. At first I thought that the incomplete arguments were due to the curly braces, but I see some lines in pstack with curly braces intact.

Version-Release number of selected component (if applicable):
$ rpm -q gdb
gdb-6.8-29.fc10.i386

Note:
I actually use a patched version of pstack, so that debug symbols are always read:
$ diff /usr/bin/pstack /home/henshaw/bin/mystack
32,36c32,37
< if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
<     readnever=--readnever
< else
<     readnever=
< fi
---
> #if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
> #    readnever=--readnever
> #else
> #    readnever=
> #fi
> readnever=


How reproducible:
Compare pstack and gdb backtrace, possibly for process with curly braces in function arguments.

Comment 1 Oliver Henshaw 2009-04-27 14:56:24 UTC
Created attachment 341436 [details]
pstack of kded4 with truncated lines

Comment 2 Oliver Henshaw 2009-04-27 14:57:52 UTC
Created attachment 341437 [details]
similar gdb bt of kded4 without truncated lines

Comment 3 Jan Kratochvil 2009-04-27 15:28:02 UTC
Thanks, fixed by:
* Mon Apr 27 2009 Jan Kratochvil <jan.kratochvil> - 6.8.50.20090302-22
- Fix pstack/gstack cutting very long lines (BZ 497849).

http://cvs.fedora.redhat.com/viewvc/rpms/gdb/devel/gdb-6.3-gstack-20050411.patch?r1=1.4&r2=1.5&view=patch

That -readnever should be removed one day, just the Archer branch archer-tromey-delayed-symfile is currently not fast enough.


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