Ticket #163 (closed defect: fixed)

Opened 7 years ago

Last modified 3 years ago

0.4.0 rc1 dumping core as is 0.3.0 on FreeBSD 6.1...

Reported by: racinej@… Owned by: armin
Priority: normal Milestone:
Component: Gobby Version:
Severity: critical Keywords:
Cc: Launchpad Bug:

Description (last modified by phil) (diff)

When run on FreeBSD Gobby dumps core on startup due to wrong usage of Gtk::AccelKey?.

Attachments

header-accel-key-path.patch (1.4 kB) - added by armin 7 years ago.

Change History

Changed 7 years ago by phil

Could you please provide a backtrace by running "gdb <path-to-gobby>", typing "run" on the prompt and then typing "bt" when the program crashed?

Changed 7 years ago by racinej@…

Hi. Many thanks for the prompt reply. I also post below (sent to Phil via email)

[jracine@pc-racine1 jracine]$ gdb /usr/local/bin/gobby GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... (gdb) run Starting program: /usr/local/bin/gobby warning: Unable to get location for thread creation breakpoint: generic error [New LWP 100235] [New Thread 0x8219000 (LWP 100235)] I/O warning : failed to load external entity "/home/jracine/.gobby/config.xml"

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x8219000 (LWP 100235)] 0x28569b26 in Glib::ustring::operator+= ()

from /usr/local/lib/libglibmm-2.4.so.1

(gdb) bt #0 0x28569b26 in Glib::ustring::operator+= ()

from /usr/local/lib/libglibmm-2.4.so.1

#1 0x2834de1d in Gtk::ActionGroup::add ()

from /usr/X11R6/lib/libgtkmm-2.4.so.1

#2 0x080f1ecd in Header (this=0xbfbfddd4, state=@0xbfbfd510, lang_mgr=@0x0)

at refptr.h:165

#3 0x0818dbd6 in Window (this=0xbfbfdc60, icon_mgr=@0x0, config=@0xbfbfe7d0)

at src/window.cpp:73

#4 0x08197b15 in main (argc=1, argv=0xbfbfe950) at src/main.cpp:141

Changed 7 years ago by phil

This is 0.4.0rc1, correct?

Changed 7 years ago by phil

Please compile Gobby with -O0 (by running configure like this: "CXXFLAGS='-g -O0' ./configure") and provide another backtrace.

Changed 7 years ago by racinej@…

Hi Phil.

Compiled with -g -O0 and bt is below. Thanks.

[jracine@pc-racine1 pl_mixed]$ gdb /usr/local/bin/gobby GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... (gdb) run Starting program: /usr/local/bin/gobby warning: Unable to get location for thread creation breakpoint: generic error [New LWP 100149] [New Thread 0x82b6000 (LWP 100149)] I/O warning : failed to load external entity "/home/jracine/.gobby/config.xml"

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x82b6000 (LWP 100294)] 0x285f2b26 in Glib::ustring::operator+= ()

from /usr/local/lib/libglibmm-2.4.so.1

(gdb) bt #0 0x285f2b26 in Glib::ustring::operator+= ()

from /usr/local/lib/libglibmm-2.4.so.1

#1 0x283d6e1d in Gtk::ActionGroup::add ()

from /usr/X11R6/lib/libgtkmm-2.4.so.1

#2 0x0817a9aa in Header (this=0xbfbfde34, state=@0xbfbfddb0,

lang_mgr=@0xbfbfdcd4) at src/header.cpp:592

#3 0x0820a7d2 in Window (this=0xbfbfdcc0, icon_mgr=@0xbfbfe850,

config=@0xbfbfe870) at src/window.cpp:73

#4 0x0821d71f in main (argc=1, argv=0xbfbfe938) at src/main.cpp:141

Changed 7 years ago by phil

Random guess: Line 592 in src/header.cpp corresponds to the following in my source tree:

group_edit->add(action_edit_goto_line, Gtk::AccelKey("<control>I") );

Could you please try and remove the Gtk::AccelKey? bit? It should then read as follows:

group_edit->add(action_edit_goto_line);

Changed 7 years ago by racinej@…

Great random guess ;-)

That did it, and now I just get the message

I/O warning : failed to load external entity "/home/jracine/.gobby/config.xml"

on the first invocation, and going to preferences and exiting leads to no message on the next invocation.

Many thanks for the help. Hopefully this helps close the other ticket.

Changed 7 years ago by phil

Could you please help us further?

Please insert the following right before the line you just edited:

group_edit->get_name();

Does Gobby crash with it?

Changed 7 years ago by racinej@…

Inserted, and no it does not. Appears to run, can edit docs etc.

Hope this helps!

Changed 7 years ago by armin

Changed 7 years ago by phil

Well, it doesn't, but we did expect this result. There is another change coming up, stay tuned. ;)

The crazy thing is that it works just fine on Linux. Please revert the source by changing the line back and removing the additional one, or unpack the pristine source into another directory. Then follow this procedure (assuming that you have wget available, otherwise just save the patch under that name):

wget -O header-accel-key-path.patch http://darcs.0x539.de/trac/obby/cgi-bin/trac.cgi/attachment/ticket/163/header-accel-key-path.patch?format=raw
patch -p0 < header-accel-key-path.patch

Then configure and make it as usual. Now we are very curious if it still crashes.

Changed 7 years ago by racinej@…

Appears to work without a hitch.

Hope this helps.

wget -O header-accel-key-path.patch http://darcs.0x539.de/trac/obby/cgi-bin/trac.cgi/attachment/ticket/163/header-accel-key-path.patch?format=raw --09:46:21-- http://darcs.0x539.de/trac/obby/cgi-bin/trac.cgi/attachment/ticket/163/header-accel-key-path.patch?format=raw

=> `header-accel-key-path.patch'

Resolving darcs.0x539.de... 87.234.203.180 Connecting to darcs.0x539.de|87.234.203.180|:80... connected. HTTP request sent, awaiting response... 200 Length: 1,435 (1.4K) [text/x-diff]

100%[====================================>] 1,435 --.--K/s

09:46:22 (1.14 MB/s) - `header-accel-key-path.patch' saved [1435/1435]

[root@pc-racine1 /tmp/gobby-0.4.0rc1]# patch -p0 < header-accel-key-path.patch Hmm... Looks like a unified diff to me... The text leading up to this was:


|--- _darcs/current/src/header.cpp 2006-03-25 22:49:59.000000000 +0100 |+++ src/header.cpp 2006-06-06 23:47:38.000000000 +0200


Patching file src/header.cpp using Plan A... Hunk #1 succeeded at 206. Hunk #2 succeeded at 589. done

Changed 7 years ago by phil

And you did actually compile the binary and try it? (Sorry to ask, but it is not clear from your answer.)

Changed 7 years ago by racinej@…

Yes, I did. To confirm, binary compiled at

-rwxr-xr-x 1 root wheel 9866328 Jun 7 09:52 /usr/local/bin/gobby

and runs just fine from what I can see. Sorry that I was not more clear.

Changed 7 years ago by racinej@…

Spoke too soon!

Tried logging in as another user. It still dumps core.

I didn't think to delete config.xml prior to running gobby. If config.xml exists, no problem. If not, dumps.

Changed 7 years ago by phil

So this is with the updated source? Could you please backtrace it again, deleting the config.xml file beforehand?

Changed 7 years ago by racinej@…

- Fresh tarball, then applied patch

- rm -rf ~/.gobby

- Edited configure and changed -g -O2 to to -g -O0

- ./configure && make install

- gdb /usr/local/bin/gobby

- Error message

I/O warning : failed to load external entity "/home/jracine/.gobby/config.xml"

BUT now it runs, and next invocation does not yield the message...

Perhaps agressive optimization is bringing up a bug?

-- Jeff

Changed 7 years ago by phil

Then please invoke

make distclean

in the tarball directory. This will clear out all build files. Then recompile it with -O2, following the instructions you just wrote up. (So re-edit configure [even though this is wrong, normally passing an environment variable is enough, like I said with CXXFLAGS], do not unpack and apply again, and then re-make it.)

Changed 7 years ago by racinej@…

This now works. In particular,

- make distclean

- compiled with -O2

- rm -rf ~/.gobby

It runs.

Just to be certain, did it all over again in a fresh directory, and applied the patch. Before ./configure did a make distclean to be certain (though redundant, right?). It runs. Now I am confident the patch appears to work. Sorry for the earlier mistake neglecting to delete and the ensuing problems.

-- Jeff

Changed 7 years ago by phil

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

We will release Gobby 0.4.0rc2 shortly, with the patch applied. If further issues arise, please open a new bug report. Thanks for your help tracking this issue down!

Note: See TracTickets for help on using tickets.