After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711088 - gbacktrace: Don't close stderr when running gdb
gbacktrace: Don't close stderr when running gdb
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-10-29 17:05 UTC by Stef Walter
Modified: 2013-11-19 13:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gbacktrace: Don't close stderr when running gdb (1.00 KB, patch)
2013-10-29 17:05 UTC, Stef Walter
reviewed Details | Review
gbacktrace: Print out gdb exec errors correctly (1.46 KB, patch)
2013-11-19 09:18 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2013-10-29 17:05:21 UTC
When using g_on_error_stack_trace, if gdb is not present, nothing
is printed out. This is because we close stderr before execing
gdb. This is not necessary for getting the backtrace.
Comment 1 Stef Walter 2013-10-29 17:05:27 UTC
Created attachment 258462 [details] [review]
gbacktrace: Don't close stderr when running gdb

We want to see error messages related to starting and running
gdb (such as if it's not installed).
Comment 2 Colin Walters 2013-11-18 18:05:57 UTC
Review of attachment 258462 [details] [review]:

We're not closing stderr - we're redirecting it to the same pipe as stdout, which does some postprocessing it looks like, then prints it to stdout.

With your change, we now leave gdb stderr attached to the process' stderr.  I can't say for sure whether this is an important behavioral change or not.

However a fix we probably *should* do here is _exit (1), and change the calling code to explicitly print an error in that case.
Comment 3 Stef Walter 2013-11-19 09:18:17 UTC
Created attachment 260202 [details] [review]
gbacktrace: Print out gdb exec errors correctly

We want to see error messages related to starting and running
gdb (such as if it's not installed).
Comment 4 Colin Walters 2013-11-19 12:46:38 UTC
Review of attachment 260202 [details] [review]:

Looks good; if our goal is just to get it printed where a developer might see it, this should work.
Comment 5 Stef Walter 2013-11-19 13:54:28 UTC
Attachment 260202 [details] pushed as 6f7d8f6 - gbacktrace: Print out gdb exec errors correctly