Created attachment 6581 gdb session with backtrace Reproduce with: $ mousepad --foo (mousepad:17672): Mousepad-ERROR **: Unknown option --foo Trace/breakpoint trap (core dumped) Fedora 23: $ rpm -q mousepad gtk2 glib2 mousepad-0.4.0-4.fc23.x86_64 gtk2-2.24.29-1.fc23.x86_64 glib2-2.46.2-1.fc23.x86_64
This bug appears to have been reported before against Fedora: Bug 965933 - [abrt] mousepad-0.3.0-1.fc18: main: Process /usr/bin/mousepad was killed by signal 5 (SIGTRAP) https://bugzilla.redhat.com/show_bug.cgi?id=965933 This may be related: Bug 989563 - [abrt] mousepad-0.3.0-2.fc19: main: Process /usr/bin/mousepad was killed by signal 5 (SIGTRAP) https://bugzilla.redhat.com/show_bug.cgi?id=989563
Created attachment 6583 Fix patch Here's the patch to fix this problem.
(In reply to André Miranda from comment #2) > Created attachment 6583 > Fix patch > > Here's the patch to fix this problem. Thanks, André. I rebuilt mousepad[1] with your patch applied and can confirm that it fixes the problem for both cases in Comment 1. Case 1 (in an Xfce terminal): Unpatched: $ mousepad --foo (mousepad:28286): Mousepad-ERROR **: Unknown option --foo Trace/breakpoint trap (core dumped) Patched: $ ./mousepad --foo Unknown option --foo Case 2 (in a console): Unpatched: $ mousepad (mousepad:6911): Mousepad-ERROR **: Cannot open display: [ 5656.983159] traps: mousepad[6911] trap int3 ip:7f75ca73b81b sp:7ffdc495eeb0 error:0 [ 5656.983852] NOHZ: local_softirq_pending 02 Trace/breakpoint trap (core dumped) Patched: $ ./mousepad Cannot open display: [1] Fedora source: mousepad-0.4.0-4.fc23.src.rpm
There are two other calls to g_error() in main.c after applying the patch: $ grep -n 'g_error[^_]' main.c 121: g_error ("Failed to terminate a running instance: %s\n", error->message); 149: g_error ("Mousepad: %s\n", error->message);
Created attachment 6585 Fix patch 2 Patch updated. I'm not really sure those two errors are meant to just print a message on stderr and exit. There are others logging functions(macros) besides g_errors that don't result in a core dump[1]. 1 - https://developer.gnome.org/glib/stable/glib-Message-Logging.html
(In reply to André Miranda from comment #5) ... > Patch updated. > I'm not really sure those two errors are meant to just print a message on > stderr and exit. ... Good point. It might be better to simply fix the known bugs in Comment 1 and leave a review of the other g_error() calls in mousepad to a separate bug report. $ grep -Rl 'g_error[^_]' mousepad-0.4.0/ mousepad-0.4.0/mousepad/mousepad-prefs-dialog.c mousepad-0.4.0/mousepad/main.c mousepad-0.4.0/mousepad/mousepad-dbus.c
*** Bug 11927 has been marked as a duplicate of this bug. ***
Patch tested. Works.
Andre Miranda referenced this bugreport in commit f220dfcc39e122348de89706c0ee2f57bc18c035 Do not core dump on silly errors, just exit (Bug #12413) https://git.xfce.org/apps/mousepad/commit?id=f220dfcc39e122348de89706c0ee2f57bc18c035
There is still one occurrence of g_error in mousepad_prefs_dialog_init, but I think in that case it makes sense to die dramatically.