[GNC-dev] Error on exiting gnucash (segfault)

John Ralls jralls at ceridwen.us
Mon Apr 27 17:46:57 EDT 2020



> On Apr 27, 2020, at 12:55 PM, c.holtermann at gmx.de wrote:
> 
> Hello,
> 
> I get error messages on closing. I have seen that for some days on
> master and maint. The most recent maint leads to a segmentation fault on
> quitting gnucash. Using the python bindings in a script I get
> 
>> double free or corruption (out)
>> ABGEBROCHEN
> 
> The "ABGEBROCHEN" is weird because its german (my usual locale) and pops
> up even if starting the script with
> 
>>>> LANG=C script.py
> 
> Starting gnucash with
> 
>>>> LANG=C gnucash
> 
> leads to gnucash with english interface but in the terminal on exit it
> shows:
> 
>> This is a development version. It may or may not work.
>> Report bugs and other problems to gnucash-devel at gnucash.org
>> You can also lookup and file bug reports at https://bugs.gnucash.org
>> To find the last stable version, please refer to https://www.gnucash.org/
>> Found Finance::Quote version 1.47.
>> Error sending IPC message: Broken pipe
>> Error sending IPC message: Broken pipe
>> Error sending IPC message: Broken pipe
>> SPEICHERZUGRIFFSFEHLER

Outside of Gtk-based apps LANG is a fallback for unset values of LC_ALL, LC_MESSAGES, etc. Since your script isn't going to be doing either GnuCash's or Gtk's localization init you probably need to set LC_ALL instead of LANG. Note that if you want translations you'll also need to supply LANGUAGES.

Get the debug symbols for Python for your distro  and run Python in the debugger, then run your script from that.

> 
> So the segmentation fault also shows in german (SPEICHERZUGRIFFSFEHLER).
> 
> The IPC errors have been there before and didn't do harm.
> 
> I tried to enable and disable the python shell. Didn't change the
> behavior.
> 
> When I try an illegal locale with gnucash it shows
> 
>>>> LANG=SOMETHING gnucash
>> The locale defined in the environment isn't supported. Falling back to the 'C' (US English) locale
> 
> That's expected behavior.
> 
> When starting a script with an illegal locale it shows
> 
>>>> LANG=SOMETHING script
>> terminate called after throwing an instance of 'std::runtime_error'
>> what():  locale::facet::_S_create_c_locale name not valid
> 
> There seems to be an issue with an illegal locale in the python
> bindings. I don't know if that's related to the memory issues. I haven't
> looked deeper into this.
> 
> That the system locale pops up in the error messages lead me to think
> that the problem may be in the locale handling.

Something is accessing the C++ locale system and it's throwing an exception, which is what it does when you try to feed it an invalid locale.

Regards,
John Ralls



More information about the gnucash-devel mailing list