GNOME Bugzilla – Bug 112176
gnome_url_show hangs
Last modified: 2004-12-22 21:47:04 UTC
Any application using gnome_url_show hangs when it executes. I have tested this with evolution 1.3 and gnome-terminal. Latest CVS on RH9
What URL is it trying to show? Does this happen with all URLs?
As far as I can tell, any URL. But it definitely happens with GNOME bugzilla URLs.
btw, I can confirm that this bug did/does happen - altho the problem went away when I upgraded to redhat 8.0 (I originally had been running Red Hat 7.2 with gnome-2-0 cvs installed to /opt/gnome2) I had started digging around and it seemed the hang was somewhere in gspawn.c, but unfortunately I never did find the exact problem. gdb wasn't playing nice :-\ that said, the last time I had reproduced this was quite a few months ago now, early in the evolution gnome2 port timeline (december or january I think?). note: when digging for the problem I did come accross a few places where gspawn didn't do proper error checking on syscalls and submitted a patch (although this did not solve it for me). perhaps there are other places that overlook possible syscall error conditions which may be the cause of this hang. gspawn bug/patch: http://bugzilla.gnome.org/show_bug.cgi?id=104825
*** Bug 114508 has been marked as a duplicate of this bug. ***
I've duped my bug to this one as I'm sure this is the cause. Selecting Open Link in gnome-terminal caused a crash. That uses gnome_url_show. All the other gnome_url_show applications I've tested hang. When gnome-terminal crashes, it produces the following errors: PROPFIND:1: error: Extra content at the end of the document ^ GLib-GObject-ERROR **: file gtype.c: line 1593 (type_class_init_Wm): assertion failed: (entry->vtable == NULL) aborting... (See also bug 114508) I'm using libgnome 2.3.3, libgnome-vfs 2.3.3, gnome-about 2.3.2 on Mandrake Cooker. To reproduce: 1. Goto Applications->Desktop Preferences->Advanced-> File Types and Programs 2. Expand the 'Internet Services' 3. Select the line with 'http' as extension 4. Click the button Remove 5. Goto Applications->Desktop Preferences->Advanced-> Preferred Applications -- Make sure a Web Browser is selected 6. Start gnome-about 7. Click on 'GNOME News Site' Expected result: Browser opens with a gnome site Actual result: Gnome-about hangs The following changes will make it work: 1. Goto Applications->Desktop Preferences->Advanced-> File Types and Programs 2. Select 'Internet Services' 3. Click 'Add Service' button 4. Type in Description field: Browser 5. Type in Protocol field: http 6. Type in Program field: galeon %s 7. Click OK button -- Gnome-about will now work as expected (no hang), gnome-terminal won't crash anymore
I can't reproduce this...
It seems owen checked in the patch fejj talked about. Can anyone here still reproduce it using the latest gtk+ 2.2.x?
That patch was for glib. I have upgraded glib to 2.2.2 which includes the patch (I've checked). I can still reproduce the crash/hang. Someone on the Cooker mailinglist also has problems: http://archives.mandrakelinux.com/cooker/2003-06/msg00379.php Quoting relevant part: ""Selecting a link in gnome-terminal (laterst cooker) does one of three things: [1] pops up an error message saying illegal address. It does this with lots of addresses that used to work a day or two ago, e.g. if there is no http:// at the start [2] fetches the resource at the given address and displays it in gedit [3] makes gnome-terminal crash If I use the capplet, [bare foot]->Configuration->GNOME->Advanced->File Types and Programs and choose Documents->World Wide Web->HTML page, Edit, and change the Default Action from running links in a terminal (!!) to Mozilla, or epiphany %s, then I can get gnome-terminal to dump core all the time."" I've also tried to change that default action. Mozilla seemed to work, gvim, gnome-moz-remote, galeon and a testscript did not. Gnome-moz-remote is set to start galeon (preference in ~/.gnome/gnome-moz-remote); the testscript is a bash script that should echo "$@" to /tmp/abcdef. After setting the Default Action to the testscript and selecting Open Link, the /tmp/abcdef was not created and gnome-terminal hanged. Setting the Default Action to gedit opened gedit. The link I was trying to open is: http://members.lycos.nl/bkor/test.html
In short: I now can avoid the hangs/crashes by changing the expand_parameters function in gnome-vfs-mime-handlers.c (libgnomevfs). Please read on for detailed guesswork and a workaround. I copy&pasted together a small program that only calls gnome_url_show. Even though gnome-terminal and gnome-about would crash/hang, the small program did not. The error gnome_url_show returned was GNOME_VFS_ERROR_NOT_SUPPORTED. In 'File Types and Programs' I've set the Default Action to gnome-moz-remote. Gnome adds that application to ~/.gnome/application-info/user.applications. Only Gnome does not set 'expects_uris=true' and 'supported_uri_schemes=file,http,ftp'. These *are* already set for known applications. Testing this bug should therefore be done with the Default Action set to an application Gnome doesn't already know about. Note that adding 'expects_uris' and 'supported_uri_schemes' will only work around the bug. Also, remove in 'File Types and Programs' the 'http' service under 'Internet Services'. After doing all of the above, gnome_url_show should return the GNOME_VFS_ERROR_NOT_SUPPORTED error. In the small application this works ok, but it causes crashes/hangs in the bigger applications (gnome-terminal/gnome-about). I've tested gnome-about and determined that gnome-about hangs when returning from the function 'href_item_event_callback'. This function calls gnome_url_show. When I added a call to 'show_error_dialog' it caused gnome-about to crash. After the above, I guessed gnome_url_show somehow corrupts memory and it is related to the GNOME_VFS_ERROR_NOT_SUPPORTED. The error is returned in the expand_parameters function in gnome-vfs-mime-handlers.c (libgnomevfs). A small part of that function: 2141: g_strfreev (c_argv); 2142: g_strfreev (r_argv); 2143: return GNOME_VFS_ERROR_NOT_SUPPORTED; Commenting out line 2141, line 2142, or line 2141 & 2142 avoids the crashes/hangs in gnome-terminal and gnome-about. Hope this helps. Don't forget that lines 2079-2081 look the same (to me) and may have the same bug.
Thanks a lot for that investigation. The problem was indeed the free in the error case. I fixed this in gnome-vfs HEAD.
I've rebuilded gnome-vfs 2.3.4 with your changes. Gnome-terminal and gnome-about now work as expected (no hangs/crashes). Please mark it verified fixed (I do not have the required permissions). Thanks