GNOME Bugzilla – Bug 581080
crash in Gnote: Importing favicon (conve...
Last modified: 2009-05-14 18:40:29 UTC
Version: 0.1.0 What were you doing when the application crashed? Importing favicon (converted to PNG format) for https://bugzilla.redhat.com (originally from https://bugzilla.redhat.com/images/favicon.ico). Distribution: Fedora release 10.93 (Leonidas) Gnome Release: 2.26.1 2009-04-29 (Red Hat, Inc) BugBuddy Version: 2.26.0 System: Linux 2.6.29.1-102.fc11.x86_64 #1 SMP Mon Apr 20 15:33:38 EDT 2009 x86_64 X Vendor: The X.Org Foundation X Vendor Release: 10601000 Selinux: Permissive Accessibility: Disabled GTK+ Theme: Nodoka Icon Theme: Fedora GTK+ Modules: canberra-gtk-module, gnomebreakpad Memory status: size: 724066304 vsize: 724066304 resident: 98639872 share: 21704704 rss: 98639872 rss_rlim: 18446744073709551615 CPU usage: start_time: 1241251273 rtime: 468 utime: 398 stime: 70 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 100 Backtrace was generated from '/usr/bin/gnote' [?1034h[Thread debugging using libthread_db enabled] [New Thread 0x7f9964433910 (LWP 15622)] 0x00007f996d85ad4d in __libc_waitpid (pid=15623, stat_loc=<value optimized out>, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41 41 int result = INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL); Current language: auto; currently minimal
+ Trace 215022
Thread 1 (Thread 0x7f996ef54800 (LWP 15458))
---- Critical and fatal warnings logged during execution ---- ** glibmm **: unhandled exception (type std::exception) in signal handler: what: boost::filesystem::copy_file: Adresář nebo soubor neexistuje: "/home/matej/redhat/brc.png", "/home/matej/.gnote/BugzillaIcons/https://bugzilla.redhat.com.png"
Might be caused by entering https://bugzilla.redhat.com as domain of the bugzilla. When entered merely bugzilla.redhat.com import was succesful, but still link in a note doesn't have a red hat.
This happened when entered https://bugzilla.redhat.com as the bugzilla domain. When entered merely bugzilla.redhat.com no crash happened, but still there is no red hat logo in a note.
Created attachment 133836 [details] [review] proposed fix this crash happens because the user tried to save a file named "https://" and the slash is an invalid filename, naturally. I'm a newbie C++ coder, so prepare for utter ugliness :-).
Catching the exception is actually a good idea. Changing the message is not needed. The problem is that it expect a hostname and not a URL. That issue should be addressed as well by parsing the URL.
Created attachment 133892 [details] [review] sanitize_hostname; catch a parent exception instead Hi, this is my second attempt. Hopefully I'm getting closer to the final solution: - It sanitizes the hostname, kind of, and tries to remove http(s):// if it's there. Although this probably solves most cases, it's not a real URL string parsing. Unfortunately I could not find a Glib/Boost method that actually splits an URI, so I went with a partial solution. Let me know what are your thoughts. - Instead of catching sharp::Exception *and* std::exception, as in my previous patch, I realized that just catching std::exception is enough, because shard::Exception inherits from it.
actually I'd prefer that sharp::Uri be used. This need to have sharp::Uri::get_host() to be implemented (mistakenly forgotten) and possibly add a sharp::Uri::get_scheme()
committed a fix for that inspired on ideas for this patch. Thanks for your report.