[GNC-dev] gnucash unstable: Multiple changes pushed

Geert Janssens geert.gnucash at kobaltwit.be
Mon Apr 16 12:13:10 EDT 2018

Op zaterdag 14 april 2018 19:22:34 CEST schreef John Ralls:
> Updated	 via  https://github.com/Gnucash/gnucash/commit/f680823d (commit)
> 	 via  https://github.com/Gnucash/gnucash/commit/01420adb (commit)
> 	 via  https://github.com/Gnucash/gnucash/commit/e90a662a (commit)
> 	 via  https://github.com/Gnucash/gnucash/commit/b7396611 (commit)
> 	 via  https://github.com/Gnucash/gnucash/commit/9b643574 (commit)
> 	 via  https://github.com/Gnucash/gnucash/commit/e4d0ad9d (commit)
> 	from  https://github.com/Gnucash/gnucash/commit/a39ba167 (commit)
> commit f680823dbfff5cc90c98139c755c727f2f19d4cb
> Author: John Ralls <jralls at ceridwen.us>
> Date:   Fri Apr 13 14:02:57 2018 -0700
>     Bug 795039 - Crash on startup using Technicolor Style sheet in report
>     The mingw-w64 toolchain bizarrely substitutes scm_to_locale_string()
>     for scm_to_utf8_string(). This results in latin1 (yeah, "locale" is
>     a lie) instead of utf8 which causes an assertion in
>     g_utf8_collate_key().
>     Perhaps equally bizarre, the compiler doesn't make the substitution
>     with scm_to_utf8_stringn(), so use that instead.


I can explain that part :(

It's an off-by-one bug I introduced years ago in the swig code for generating 
guile bindings. The mention of scm_to_locale_string and scm_to_utf8_string 
were the clue bat.

The latter didn't exist in guile 1.8 and after discussing this on the guile 
irc channel I was told to use the former as a fallback. For 1.8 that was ok as 
it was not really locale aware anyway.

Unfortunately I fumbled and test for GUILE_MAJOR_VERSION<=2 rather than
GUILE_MAJOR_VERSION<2 so the replacement happens for guile 2.x still.

It's not mingw64 only by the way. I suspect it never surfaced earlier because 
all platforms except Microsoft use utf8 as system encoding so no conversions 
were run. But on Windows we only switched to guile 2 for gnucash 3.0 so it's 
the first time a non-utf8 based system needs path conversions in guile and now 
it suddenly starts failing.

I'm sorry you had to spend so much time to fall on a bug I did introduce. And 
at the same time I'm really glad you found it :)

I'll send a bugfix to swig.


More information about the gnucash-devel mailing list