Segfault in gtk_dialog_run with gtkfilechooser
gtk+ 3.24, linux.
In my code I have something like:
GtkWidget *fch = gtk_file_chooser_dialog_new("title", GTK_WINDOW(MAIN_WINDOW_WIDGET),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
"Cancel", GTK_RESPONSE_CANCEL,
"Open", GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fch), application_dir);
gtk_widget_show_all(fch);
this is called in a background thread. It then signals to the main thread to run gtk_dialog_run(GTK_DIALOG(fch)) and return the response to the thread.
This works perfectly for every other dialog in the application. However in this case the program crashes within gtk_dialog_run. The action which triggers the crash is clicking on the 'create directory' icon and starting to type the name of a new directory.
As soon as I hit a key to enter the name, the program crashes with the following:
0x000055555559c97a in lives_log_handler (data=, message=0x555556654540 "g_file_get_child_for_display_name: assertion 'G_IS_FILE (file)' failed", level=G_LOG_LEVEL_CRITICAL, domain=) at main.c:197
I believe this is a threading issue, since if I run this in a single thread there is no crash, and I am able to enter the new directory name.