GNOME Bugzilla – Bug 628087
Banshee crash when quickly search music or video which belongs to unknown artist or album
Last modified: 2011-03-22 15:11:55 UTC
In MeeGo OS 1. Launch media player; 2. Select Music; 3. Select a musc item whose Album/Artist is Unknown, 4. Select this music item in item list and right-click; 5. In context menu, select Search->By Matching Album or By Matching Artist; Bashee will crash due to System.NullReferenceException
Thanks for taking the time to report this bug. Without a stack trace from the crash it's very hard to determine what caused it. Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Created attachment 168855 [details] [review] Add String.IsNullOrEmpty() judgement before the search string parsing call Hello, I have a patch for this problem Root Cause: When "track.AlbumTitle" or "track.ArtistName" is null or empty, there is System.NullReferenceException while constructing and parsing query sql at the call of value.Indexof() and value.Trim() Solution: Add String.IsNullOrEmpty() judgement before the string parsing call.
Created attachment 168858 [details] [review] backtrace when search same artist for a music with unknown artist
Thanks for the patch. Can you attach the stack trace, too? One problem with the patch is you should never assign null to the Entry.Text property -- I believe that triggers warnings from Gtk+.
Created attachment 169030 [details] [review] Add String.IsNullOrEmpty() judgement before the search string parsing call Thanks for the pointing out gtk warning. I change 'null' to 'String.Empty' in the patch This is the stack trace when calling "OnSearchForSameArtist": Marshaling activate signal Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object at Hyena.Query.QueryField.ToTermString (System.String alias, System.String op, System.String value) [0x00000] in <filename unknown>:0 at Hyena.Query.QueryField.ToTermString (System.String op, System.String value) [0x00000] in <filename unknown>:0 at Banshee.Gui.TrackActions.OnSearchForSameArtist (System.Object o, System.EventArgs args) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0 at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0 at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal) at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) at Gtk.Application.gtk_main() at Gtk.Application.Run() at Banshee.Gui.GtkBaseClient.Run() at Banshee.Gui.GtkBaseClient.Startup() at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup) at Banshee.Gui.GtkBaseClient.Startup() at Banshee.Gui.GtkBaseClient.Startup(System.String[] args) at Banshee.MeeGo.Client.MeeGoClient.Main(System.String[] args) at System.AppDomain.ExecuteAssembly(System.Reflection.Assembly , System.String[] ) at System.AppDomain.ExecuteAssemblyInternal(System.Reflection.Assembly a, System.String[] args) at System.AppDomain.ExecuteAssembly(System.String assemblyFile, System.Security.Policy.Evidence assemblySecurity, System.String[] args) at System.AppDomain.ExecuteAssembly(System.String assemblyFile) at Booter.Booter.BootClient(System.String clientName) at Booter.Booter.Main(
I believe this was already filed and fixed as part this commit: commit 6fcc86b3599c764baf419a57477753968c86d37b Author: Gabriel Burt <gabriel.burt@gmail.com> Date: Thu Aug 12 20:03:54 2010 [TrackActions] Prevent crash in search-for-same Specifically, when artist/album are blank/null. Fixes bug #626786 Are you working against the git master branch?
Thanks for the information. The code base I use is banshee 1.6.1. I noticed banshee 1.7.5 is released. Does 1.7.5 contain the fix for this problem? or I should wait for 1.8.0? Thanks.
Yes, it's in 1.7.5. I just pushed it to the stable-1.6 branch too, which a 1.6.2 release would be based on (if we do one). *** This bug has been marked as a duplicate of bug 626786 ***
Hello, it seems the patch can not resolve the problem in MeeGo. http://git.gnome.org/browse/banshee/commit/?id=6fcc86b3599c764baf419a57477753968c86d37b Below is the backtrace when I apply the patch above based on banshee 1.7.3 source code. at Banshee.Widgets.SearchEntry.set_Query (System.String value) [0x00000] in <filename unknown>:0 at Nereid.PlayerInterface.OnProgrammaticSearch (System.Object o, System.EventArgs args) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (ob ject,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Created attachment 172321 [details] [review] patch based on 1.7.3 code base Attachment is the patch based on 1.7.3 source code. The patch can resolve the crash issue in MeeGo.
Comment on attachment 172321 [details] [review] patch based on 1.7.3 code base Committed, thanks!