After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 165629 - Best crashes
Best crashes
Status: RESOLVED FIXED
Product: beagle
Classification: Other
Component: General
unspecified
Other Linux
: Normal major
: Milestone 1
Assigned To: Daniel Drake
Daniel Drake
: 166037 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-01-29 18:35 UTC by Miles Wu
Modified: 2005-03-19 12:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Crashing desktop file (2.94 KB, text/plain)
2005-02-03 17:56 UTC, Ruben Vermeersch
  Details
Solution (657 bytes, patch)
2005-03-17 01:02 UTC, Daniel Drake
none Details | Review
More sanity checking in GetHtmlSource (885 bytes, patch)
2005-03-18 23:25 UTC, Daniel Drake
none Details | Review
Update (2.49 KB, patch)
2005-03-18 23:42 UTC, Daniel Drake
committed Details | Review

Description Miles Wu 2005-01-29 18:35:00 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!
Comment 1 Joe Shaw 2005-01-31 20:33:30 UTC
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.
Comment 2 Miles Wu 2005-02-01 17:37:50 UTC
Okay thanks. Just a quick question. What about the free on beagle-query 
Comment 3 Jon Trowbridge 2005-02-01 18:18:59 UTC
The free(): invalid pointer message is almost certainly harmless.
Comment 4 Joe Shaw 2005-02-01 18:53:45 UTC
yeah, it's a bug in mono 1.0.x.  If you upgrade to 1.1.x it will go away.
Comment 5 Miles Wu 2005-02-02 21:23:08 UTC
I have upgraded to mono 1.1.2 and re-compiled all mono dependant packages, yet  
it still does this?  
  
Any ideas? 
Comment 6 Lukas Lipka 2005-02-03 13:18:50 UTC
*** Bug 166037 has been marked as a duplicate of this bug. ***
Comment 7 Steven M. Ottens 2005-02-03 14:19:42 UTC
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)
Comment 8 Miles Wu 2005-02-03 14:57:41 UTC
Have you got mono 1.0.x or 1.1.x? 
Comment 9 Steven M. Ottens 2005-02-03 15:13:06 UTC
1.0.4 on ubuntu hoary, there's no newer mono in ubuntu, so upgrading is a tad
difficult
Comment 10 Miles Wu 2005-02-03 16:14:20 UTC
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? 
Comment 11 Ruben Vermeersch 2005-02-03 17:56:26 UTC
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.
Comment 12 Miles Wu 2005-02-03 18:10:29 UTC
Is that all desktop files or just this particular one? 
Comment 13 Miles Wu 2005-02-03 18:18:06 UTC
And also how do I temporarily disable the launcher backend? 
Comment 14 Jon Trowbridge 2005-02-03 18:53:52 UTC
Miles: Run beagled --fg --debug --deny-backend launcher
Comment 15 Miles Wu 2005-02-03 19:27:06 UTC
I am sorry but disabling the launcher backend doesn't help. 
Comment 16 Joe Gasiorek 2005-02-03 21:23:57 UTC
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.
Comment 17 Miles Wu 2005-02-04 13:07:36 UTC
How did you trace the problem? If you could tell me how I will do that to help 
find the problem... 
Comment 18 Steven M. Ottens 2005-02-10 10:02:12 UTC
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)
Comment 19 Veerapuram Varadhan 2005-02-10 11:39:39 UTC
What does "id3info" or other id3 tag readers show?  Also, is it possible to
share that music file?
Comment 20 Steven M. Ottens 2005-02-10 12:05:43 UTC
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
Comment 21 Jon Trowbridge 2005-03-01 14:43:33 UTC
This was probably a duplicate of bug 168362, so I'm closing this as FIXED. 
Please re-open the bug if the problem persists.
Comment 22 Miles Wu 2005-03-07 20:58:00 UTC
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 
Comment 23 galadriel 2005-03-14 08:57:49 UTC
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...
Comment 24 Fredrik Hedberg 2005-03-16 10:37:57 UTC
Is this still and issue if you run Beagle from current CVS?
Comment 25 Miles Wu 2005-03-16 10:47:42 UTC
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?
Comment 26 galadriel 2005-03-16 17:43:52 UTC
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.
Comment 27 Miles Wu 2005-03-16 18:38:49 UTC
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
Comment 28 Daniel Drake 2005-03-17 01:02:27 UTC
Created attachment 38821 [details] [review]
Solution

Correctly handle lack of icon path
Comment 29 Daniel Drake 2005-03-17 01:05:05 UTC
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?
Comment 30 Fredrik Hedberg 2005-03-17 14:27:28 UTC
In CVS.
Comment 31 galadriel 2005-03-18 17:32:23 UTC
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?


Comment 32 Daniel Drake 2005-03-18 22:58:55 UTC
Reopening and investigating
Comment 33 Daniel Drake 2005-03-18 23:20:10 UTC
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?
Comment 34 Daniel Drake 2005-03-18 23:25:39 UTC
Created attachment 38924 [details] [review]
More sanity checking in GetHtmlSource

This should help.
Comment 35 Daniel Drake 2005-03-18 23:42:48 UTC
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 36 Daniel Drake 2005-03-18 23:54:48 UTC
Comment on attachment 38927 [details] [review]
Update

Fredrik applied this into CVS. Please test and let us know how you get on.
Comment 37 galadriel 2005-03-19 09:09:04 UTC
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...
Comment 38 galadriel 2005-03-19 11:23:53 UTC
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