Starting from commit be739e28a6e29aeb08912af36620a4fb78b31176 geany crashes with SIGSEGV when I try to open a file. I'm using Gentoo Linux (updated). Working commit da125332f779eb367ffaea8569259940c1e8803a configuration: [configure.1.txt](https://github.com/geany/geany/files/8443239/configure.1.txt) Not working commit be739e28a6e29aeb08912af36620a4fb78b31176 configuration: [configure.2.txt](https://github.com/geany/geany/files/8443240/configure.2.txt) `gdb geany` and open from dialog: [backtrace.2-dialog.txt](https://github.com/geany/geany/files/8443251/backtrace.2-dialog.txt) `gdb geany` and open from File Browser plugin: [backtrace.2-plugin.txt](https://github.com/geany/geany/files/8443252/backtrace.2-plugin.txt) Working commit `strace geany Program.cs`: [strace.1.txt](https://github.com/geany/geany/files/8443293/strace.1.txt) Not working commit `strace geany Program.cs`: [strace.2-args.txt](https://github.com/geany/geany/files/8443294/strace.2-args.txt)
Most probably the same cause as in https://github.com/geany/geany/issues/3149.
Please note that even if the backtrace puts `vte_send_cmd()` in a prominent position, the crash there is only a symptom of the underlying problem that `vc->send_cmd_prefix` is `NULL` because its fallback value is not applied when read from the config.
@overcq as a workaround, the crashes should stop if you disable the 'Follow path of current file' option in VTE preferences.
The problem was the new location of the call for the `settings_action` function, which was before setting up stash groups in the `load_dialog_prefs` function. There is patch file: [solution.txt](https://github.com/geany/geany/files/8452454/solution.txt)
The patch seems to fix the issue, in my case it was `vc->send_cmd_prefix` not being read properly (it remained `NULL`) and with the patch it is read from the config and initialised to an empty string (which is correct).
@kugel- I'm not familiar with the "stash" system, could you have a look if the fix is appropriate? Thanks.
Alright, I think I understand. It's the specific "VTE" stash group that is initialized later (now after `settions_action()`). I missed that because all other stash groups are created `init_pref_groups()`.
The patch probably works but I would rather explore why the "VTE" stash group needs to be special, that's just unexpected and surprising. Hopefully I can manage in the coming days.
why the "VTE" stash group needs to be special, that's just unexpected and surprising
Is it because loading VTE can be disabled by pref, so at least that pref needs to be initialised and loaded from the file and tested to see if the VteConfig struct needs to be created, and the stash group can't be created before the VteConfig struct because it's members (eg `send_command_prefix`) point to members in that struct so they would be dangling pointers if the group was created when VteConfig wasn't.
Thinking some more, can `VteConfig` be always created (ie be static) if `HAVE_VTE` is defined? Its only 18 members, and even if alignment made them all pointers its inconsequential.
@overcq thanks for your investigation. I decided to follow a different path for the fix, basically what @elextr suggests as well. See #3156
Closed #3151 via #3156.
github-comments@lists.geany.org