GNOME Bugzilla – Bug 791004
Crash when searching in file chooser after using location bar
Last modified: 2018-03-12 23:09:48 UTC
See this downstream bug for more information (full backtrace, …): https://bugzilla.redhat.com/show_bug.cgi?id=1454378 Description of problem: This crash happens inside the file chooser. Steps to reproduce: 1. open gedit or any other Gtk+ 3.x application, including gtk3-widget-factory 2. open a file chooser 3. open the location bar (Ctrl+L) and type a path. Do not open the path (i.e. do not press the Enter key) 4. press the search button or Ctrl+F What happens: Immediate crash. Truncated backtrace: #7 g_value_unset at gvalue.c:275 #8 on_source_notify at gbinding.c:332 What should happen: No crash. Version-Release number of selected component: gtk3-devel-3.22.15-1.fc26
This is what I get, which unlike the RH backtrace, implicates the notify() on "subtitle": (ins)(gdb) run Starting program: /opt/jhbuilt/gnome/bin/gtk3-widget-factory [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffedffe700 (LWP 31506)] [New Thread 0x7fffed7fd700 (LWP 31507)] [New Thread 0x7fffe7fff700 (LWP 31516)] [New Thread 0x7fffe71c8700 (LWP 31517)] [New Thread 0x7fffe69c7700 (LWP 31518)] [New Thread 0x7fffe5fbf700 (LWP 31519)] [Thread 0x7fffe69c7700 (LWP 31518) exited] [Thread 0x7fffe71c8700 (LWP 31517) exited] munmap_chunk(): invalid pointer Thread 1 "gtk3-widget-fac" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (ins)(gdb) bt
+ Trace 238471
Created attachment 369591 [details] [review] FileChooserWidget: Avoid crash freeing static str Being in location-entry mode then pressing <primary>f to move to search mode would crash with an invalid free(). This was because the string returned by .get_subtitle() in that case was not duplicated, and so we ended up freeing a static string from gettext. Fix by duplicating it, like we do with all the other return values here.
Attachment 369591 [details] pushed as 9d8fade - FileChooserWidget: Avoid crash freeing static str