GNOME Bugzilla – Bug 165629
Best crashes
Last modified: 2005-03-19 12:28:56 UTC
Run best. Search for virtually anything. It locks up, and this is produced ---ERROR--- Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required. in (unmanaged) (wrapper managed-to-native) Gtk.Application:gtk_main () in <0x00004> (wrapper managed-to-native) Gtk.Application:gtk_main () in <0x00007> Gtk.Application:Run () in <0x00007> Gnome.Program:Run () in [0x0007f] (at /var/tmp/portage/beagle-cvs-0.0.2/work/beagle-cvs/Best/Best.cs:92) Best.Best:Main (string[]) Also this may be related: Search for anything on beagle-query and this is produced at the end of the list. free(): invalid pointer 0x81e6000!
this looks like some gtk-sharp or mono bug... there's nothing beagle-specific about it, and unfortunately there isn't any useful debugging info that would indicate what exactly is causing the error.
Okay thanks. Just a quick question. What about the free on beagle-query
The free(): invalid pointer message is almost certainly harmless.
yeah, it's a bug in mono 1.0.x. If you upgrade to 1.1.x it will go away.
I have upgraded to mono 1.1.2 and re-compiled all mono dependant packages, yet it still does this? Any ideas?
*** Bug 166037 has been marked as a duplicate of this bug. ***
I can reproduce the bug all the time when i search on interpol ;) So if someone could explain to me how to get a backtrace I can add it ( gdb best doesn't work)
Have you got mono 1.0.x or 1.1.x?
1.0.4 on ubuntu hoary, there's no newer mono in ubuntu, so upgrading is a tad difficult
By the way, also John Shaw said it will be fixed with mono 1.1.x which I have. Perhaps also I need gtk-sharp 1.1.x. Where do I get it? Off CVS or gtk-sharp-1.9.1?
Created attachment 36932 [details] Crashing desktop file I'm experiencing this same problem, we managed to trace it back to this .desktop file. When disabling the launcher backend, all works like normal.
Is that all desktop files or just this particular one?
And also how do I temporarily disable the launcher backend?
Miles: Run beagled --fg --debug --deny-backend launcher
I am sorry but disabling the launcher backend doesn't help.
I am getting the same trouble with the .desktop file that Ruben attached. It crashes best. However it works fine in beagle-query. It appears to be indexed fine by beagled.
How did you trace the problem? If you could tell me how I will do that to help find the problem...
I found the music file that crashes my search on interpol, it seems like a normal file, i changed some id3 tags to see if it helps, but it still crashes best AND beagle-query (on todays cvs beagle)
What does "id3info" or other id3 tag readers show? Also, is it possible to share that music file?
steven@laptoppa:~/muziek/Interpol/Interpol - black session 2002 $ id3tool 06\ -\ hands\ away.mp3 Filename: 06 - hands away.mp3 Song Title: Hands away Artist: Interpol Album: Black session Note: test Track: 6 Year: 2002 Genre: Other (0xC) If someone wants to test it, I can send the file, but I don't think it's a good idea to put it out publically
This was probably a duplicate of bug 168362, so I'm closing this as FIXED. Please re-open the bug if the problem persists.
This bug doesn't seem to be the GetHTMLSource bug. (168362) I tried the patch, and it still happens. Also the error differs slightly. Thanks
I had the same problem with last weeks CVS version of beagle/best. Any time best tried to render a file it crashed with the same output as above. But searching for emails worked fine. After almost 2 days of debugging and playing around I found out that changing the icon theme of gnome to *default* solves the problem. Hope that helps...
Is this still and issue if you run Beagle from current CVS?
How do I change the icon theme of gnome? As i don't have the full gnome! What is needed in the .gtkrc-2.0 file?
Yes, the current CVS version of Beagle still shows the same problems. I instrumented the code a little bit to explain the problem in more detail: File: Util/Vfs.cs Method: string LookupMimeIcon(string mime,IconSize size) If I use the default icon theme the values are: icon_theme = 139943208 icon_name = gnome-mime-image-jpeg icon_path = /usr/share/icons/Default/48x48/mimetypes/gnome-mime-image-jpeg. png And if I use some other icon theme (haven't tested all of them): icon_theme = 143925832 icon_name = gnome-mime-image icon_path = The problem now is that later on icon_path is used to open the icon. But the case that icon_path is empty is not handled well is missing -> crash! I'm not sure if the problem really is in Beagle. Maybe there is a problem with libgnomeui-2? P.S.: These values are generated when a jpeg-image is found. But the problem exists for any file I tried until yet.
I some how have fixed it. Thanks everyone. Since it not working, and it now working I am using: Mono 1.1.4 instead of 1.0.4 Latest CVS Gnome 2.10 stuff (themes,icons,vfs,gtk) And this in my gtkrc: include "/usr/share/themes/Raleigh/gtk/gtkrc" I am not sure which of these fixed it, but I suspect it is to do with the newly installed themes. It is probably the problem described above. But doesn't the problem above play havoc if beagle has a file that its mime-type doesn't have a icon associated with it?! It probably ought to be fixed. Thanks everyone
Created attachment 38821 [details] [review] Solution Correctly handle lack of icon path
Jon, This looks like a case that "shouldn't ever happen", but it would be nice to handle the String.Empty value which LookupMimeIcon can definately return. If this situation is met, the search results are now shown with no icons, as opposed to best throwing a useless exception and exiting. Can you review/commit this please?
In CVS.
Well, I think there still is a small issue... Probably you should handle the case of an invalid icon path returned by a malicious libgnomeui-2, not just the case of an empty path. Therefore I'd suggest to handle the error where it really occurs: File: images/Images.cs Method: static public string GetHtmlSource (string name, string mime_type) The error happens here, 'cause opening a non-existing file returns null, which causes an exception in the second line (null pointer reference). stream = GetStream (name); byte[] binary_data = new Byte[stream.Length]; To make the code safe the case of a non-existing file should be handled here. Agree? And, probably worst (at least for me :-) the patch doesn't solve my problem. I tried to search for similar problems with libgnomeui-2, but couldn't find anything yet. Any hints?
Reopening and investigating
So, if at the point of code shown in attachment 38821 [details] [review], your path variable is not null, and not an empty string, what is it?
Created attachment 38924 [details] [review] More sanity checking in GetHtmlSource This should help.
Created attachment 38927 [details] [review] Update Ok, this moves all of the sanity checking into GetHtmlSource I checked all users of GetHtmlSource and found that the launcher tile could possibly also fall into a similar trap. I think this should solve the issue.
Comment on attachment 38927 [details] [review] Update Fredrik applied this into CVS. Please test and let us know how you get on.
Well, I think I confused you a little bit, sorry :-) The path variable is empty in my case, meaning that libgnomeui doesn't return an icon path for whatever reason. So I think my particular problem is with libgnomeui and not beagle. Although your first little patch stopped Best to crash, I suggested that you should handle the case of a wrong icon path in the general case, not just an empty path. So that's exactly what you did now! :-) But I'm wondering if I'm the only person having trouble with the icon theme. I'm using Debian unstable, libgnomeui is 2.8.1-3. Maybe I should try to update to a newer version...
Ok, forget about this problem. Best is not the only program that crashes with this icon theme (Lush), so I will use another one... You can close this bug, since Best doesn't crash anymore with the patch and the "real" problem is somewhere else. Anyway, thanks for the help