[PATCH] bug in menu.c (SOLVED)
Stephan Goetter wrote:
Hi,
I just got this, after opening a new tab, going to http://www.foobar123.org/ (yes, it doesn't exist :) and then trying to close the Tab.
Program received signal SIGSEGV, Segmentation fault. Menu_pick_url (widget=0x8158e80, client_data=0x8113f20) at menu.c:112 112 gtk_object_remove_data(GTK_OBJECT (bw->menu_popup.over_image), "url2"); (gdb) backtrace full #0 Menu_pick_url (widget=0x8158e80, client_data=0x8113f20) at menu.c:112 bw = (struct _BrowserWindow *) 0x8113f20 #1 0x40142ef6 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0 No symbol table info available. #2 0x40187e16 in gtk_signal_remove_emission_hook () from /usr/lib/libgtk-1.2.so.0 No symbol table info available. #3 0x40186f3b in gtk_signal_handlers_destroy () from /usr/lib/libgtk-1.2.so.0 No symbol table info available. #4 0x40184b8e in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 No symbol table info available. ...
Greets, Stephan
Found the cause. This error is present in the CVS version of Dillo as well, but there it does not matter much (probably why it was not discovered before). In menu.c:Menu_add(): if (callback != NULL) { gtk_signal_connect(GTK_OBJECT(menuitem), "activate", (GtkSignalFunc) Menu_pick_url, data); ^^^^ "data" should be "bw", as Menu_pick_url() needs a BrowserWindow* as second parameter. In CVS Dillo "data" (which is used as user data for callbacks) happens to be always set to "bw", so this bug did not manifest itself. In the patched version, some callbacks expect a DilloDoc* as parameter though... So Menu_pick_url() is called with a DilloDoc* instead of a BrowserWindow*... The fix is simple: <PATCH> diff -pruN dillo/src/menu.c dillo_patched/src/menu.c --- dillo/src/menu.c 2003-09-25 15:10:24.000000000 +0200 +++ dillo_patched/src/menu.c 2003-10-16 14:56:38.733763968 +0200 @@ -109,7 +109,7 @@ static GtkWidget * } if (callback != NULL) { gtk_signal_connect(GTK_OBJECT(menuitem), "activate", - (GtkSignalFunc) Menu_pick_url, data); + (GtkSignalFunc) Menu_pick_url, bw); gtk_signal_connect(GTK_OBJECT(menuitem), "activate", (GtkSignalFunc) callback, data); } </PATCH> Jorge, can you commit this patchlet to CVS? Cheers//Frank -- WWWWW ________________________ ## o o\ / Frank de Lange \ }# \| / +46-734352015 \ \ `--| _/ <Hacker for Hire> \ `---' \ +31-640037120 / \ frank@unternet.org / `------------------------' [ "Omnis enim res, quae dando non deficit, dum habetur et non datur, nondum habetur, quomodo habenda est." ]
On Thu, 16 Oct 2003, Frank de Lange wrote:
[...] Found the cause. This error is present in the CVS version of Dillo as well, but there it does not matter much (probably why it was not discovered before). In menu.c:Menu_add():
if (callback != NULL) { gtk_signal_connect(GTK_OBJECT(menuitem), "activate", (GtkSignalFunc) Menu_pick_url, data); ^^^^
"data" should be "bw", as Menu_pick_url() needs a BrowserWindow* as second parameter. In CVS Dillo "data" (which is used as user data for callbacks) happens to be always set to "bw", so this bug did not manifest itself. In the patched version, some callbacks expect a DilloDoc* as parameter though... So Menu_pick_url() is called with a DilloDoc* instead of a BrowserWindow*...
The fix is simple:
<PATCH> diff -pruN dillo/src/menu.c dillo_patched/src/menu.c --- dillo/src/menu.c 2003-09-25 15:10:24.000000000 +0200 +++ dillo_patched/src/menu.c 2003-10-16 14:56:38.733763968 +0200 @@ -109,7 +109,7 @@ static GtkWidget * } if (callback != NULL) { gtk_signal_connect(GTK_OBJECT(menuitem), "activate", - (GtkSignalFunc) Menu_pick_url, data); + (GtkSignalFunc) Menu_pick_url, bw); gtk_signal_connect(GTK_OBJECT(menuitem), "activate", (GtkSignalFunc) callback, data); } </PATCH>
Jorge, can you commit this patchlet to CVS?
Done! Cheers Jorge.-
participants (2)
-
Frank de Lange
-
Jorge Arellano Cid