GNOME Bugzilla – Bug 721600
Segmentation fault on startup if report Income/Expense Chart was opened since last running
Last modified: 2018-06-29 23:23:52 UTC
$ gnucash-env gdb gnucash GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/bin/gnucash...(no debugging symbols found)...done. (gdb) run Starting program: /usr/bin/gnucash [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffde98a700 (LWP 22705)] [New Thread 0x7fffde0e6700 (LWP 22706)] [New Thread 0x7fffd1f1f700 (LWP 22711)] [New Thread 0x7fffd1719700 (LWP 22712)] [Thread 0x7fffd1719700 (LWP 22712) exited] [New Thread 0x7fffd1719700 (LWP 22715)] [New Thread 0x7fff90f16700 (LWP 22716)] Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6019df0 in g_markup_escape_text () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 (gdb) home.gcm [Top] BookGuid=7e70298e2b01546aae30f6da85d691f9 WindowCount=1 [Window 1] PageCount=4 FirstPage=1 PageOrder=1;4;2;3; WindowPosition=0;27; WindowGeometry=1920;1027; WindowMaximized=true ToolbarVisible=true SummarybarVisible=true StatusbarVisible=true [Page 1] PageType=GncPluginPageAccountTree PageName=Счета AccountTypes=-1 ShowHidden=false ShowZeroTotal=true SelectedAccount=Активы:Текущие активы:Банки:Альфа-Банк:Текущий - Стас OpenAccount1=Активы OpenAccount2=Активы:Текущие активы OpenAccount3=Активы:Текущие активы:Банки OpenAccount4=Активы:Текущие активы:Банки:Альфа-Банк NumberOfOpenAccounts=4 [Page 2] PageType=GncPluginPageRegister PageName=Текущий - Стас RegisterType=Account AccountName=Активы:Текущие активы:Банки:Альфа-Банк:Текущий - Стас RegisterStyle=Ledger DoubleLineMode=false [Page 3] PageType=GncPluginPageRegister PageName=Наличные RegisterType=Account AccountName=Активы:Текущие активы:Наличные RegisterStyle=Ledger DoubleLineMode=false [Page 4] PageType=GncPluginPageReport PageName=График Дохода/Расхода SchemeOptions=(let ((options (gnc:report-template-new-options/report-guid "80769921e87943adade887b9835a7685" "Income/Expense Chart"))) (gnc:restore-report-by-guid 0 "80769921e87943adade887b9835a7685" "Income/Expense Chart" options)) Not all reports give this error, but many. If remove [Page 4] with report run the program will be successful.
A similar fault cam up last year in the gnucash-devel mailing list, 2013-08-04. The problem then was that if you created a report in 2.5, left it open and closed GnuCash, than opened the file using 2.4 the application would crash. Is this what you are doing, using both versions? As you say though removing the offending section from your gcm file fixes the problem. Until you do it again.
Sequence of actions: - Run GnuCash 2.6.0 (with no reports) - Create Income/Expense Chart report - Left it open and close GnuCash - Run GnuCash 2.6.0 - Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6019df0 in g_markup_escape_text () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
I'm not able to replicate this in Debian Testing. Can you build it yourself with debugging symbols and generate a stack trace?
$ gnucash-env gdb gnucash GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/bin/gnucash...Reading symbols from /usr/lib/debug/.build-id/90/482fe0a1e1d34ed02840e1967b422181cca232.debug...done. done. (gdb) run Starting program: /usr/bin/gnucash [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffde98a700 (LWP 6331)] [New Thread 0x7fffde0e6700 (LWP 6332)] [New Thread 0x7fffd1ebc700 (LWP 6337)] [New Thread 0x7fffd16b6700 (LWP 6338)] [Thread 0x7fffd16b6700 (LWP 6338) exited] [New Thread 0x7fffd16b6700 (LWP 6339)] [New Thread 0x7fff90eb3700 (LWP 6340)] Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6019df0 in g_markup_escape_text () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 (gdb)
Stanislav, thanks for the gdb report. Unfortunately you stopped short of actually generating a backtrace. Can you run this once more and when you return to the gdb prompt in the end, please type bt and add the output to this report. Thank you.
$ gnucash-env gdb gnucash GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/bin/gnucash...Reading symbols from /usr/lib/debug/.build-id/90/482fe0a1e1d34ed02840e1967b422181cca232.debug...done. done. (gdb) run Starting program: /usr/bin/gnucash [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffde98a700 (LWP 6852)] [New Thread 0x7fffde0e6700 (LWP 6853)] [New Thread 0x7fffd1ebc700 (LWP 6855)] [New Thread 0x7fffd16b6700 (LWP 6856)] [Thread 0x7fffd16b6700 (LWP 6856) exited] [New Thread 0x7fffd16b6700 (LWP 6860)] [New Thread 0x7fff90eb3700 (LWP 6861)] Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6019df0 in g_markup_escape_text () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 (gdb) bt
+ Trace 233047
0x00007ffff6019df0 in g_markup_escape_text () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 0x00007ffff601a124 in g_markup_vprintf_escaped () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 0x00007ffff601a28c in g_markup_printf_escaped () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 0x00007ffff78af2e1 in gnc_update_splash_screen (string=string@entry=0x2ddcc80 "Создается отчет \"Граф", <incomplete sequence \320>, percentage=0, percentage@entry=<error reading variable: Could not find type for DW_OP_GNU_const_type>) at gnc-splash.c:169 0x00007ffff78ebcb7 in gnc_window_show_progress (message=0x2ddcc80 "Создается отчет \"Граф", <incomplete sequence \320>, percentage=0) at gnc-window.c:182 0x00007ffff78edb39 in _wrap_gnc_window_show_progress (s_0=<optimized out>, s_1=0x2) at swig-gnome-utils.c:1557 0x00007ffff69f1885 in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff69f191f in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff696ae3e in scm_call_3 () from /usr/lib/libguile-2.0.so.22 0x00007ffff69638d8 in scm_lazy_catch () from /usr/lib/libguile-2.0.so.22 0x00007ffff69f1871 in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff696ad67 in scm_call_1 () from /usr/lib/libguile-2.0.so.22 0x00007ffff69f1885 in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff696ae3e in scm_call_3 () from /usr/lib/libguile-2.0.so.22 0x00007ffff69f191f in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff696ae3e in scm_call_3 () from /usr/lib/libguile-2.0.so.22 0x00007ffff69f191f in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff696ae3e in scm_call_3 () from /usr/lib/libguile-2.0.so.22 0x00007ffff69dd154 in scm_internal_catch () from /usr/lib/libguile-2.0.so.22 0x00007ffff6965690 in scm_internal_stack_catch () from /usr/lib/libguile-2.0.so.22 0x00007ffff7606801 in gfec_eval_string (str=str@entry=0x2e47980 "(gnc:report-run 0)", error_handler=error_handler@entry=0x7ffff4fa6220 <error_handler>) at gfec.c:173 0x00007ffff4fa6504 in gnc_run_report (report_id=<optimized out>, data=data@entry=0x7fffffffd6c0) at gnc-report.c:154 0x00007ffff4fa65e0 in gnc_run_report_id_string (id_string=<optimized out>, data=data@entry=0x7fffffffd6c0) at gnc-report.c:180 0x00007ffff51babb3 in gnc_html_report_stream_cb (location=<optimized out>, data=0x7fffffffd6c0, len=0x7fffffffd6bc) at window-report.c:214 0x00007ffff49430a2 in load_to_stream (self=0x2e085f0, type=type@entry=0x2e458c0 "report", location=location@entry=0x2e4df60 "id=0", label=label@entry=0x0) at gnc-html-webkit.c:450 0x00007ffff4943878 in impl_webkit_show_url (self=0x2e085f0, type=<optimized out>, location=<optimized out>, label=<optimized out>, new_window_hint=<optimized out>) at gnc-html-webkit.c:868 0x00007ffff49401e2 in gnc_html_show_url (self=0x2e085f0, type=<optimized out>, location=0x2e4df60 "id=0", label=0x0, new_window_hint=0) at gnc-html.c:365 0x00007ffff51b8617 in gnc_plugin_page_report_create_widget (page=0x6f9690) at gnc-plugin-page-report.c:381 0x00007ffff78a9ba1 in gnc_plugin_page_create_widget (plugin_page=plugin_page@entry=0x6f9690) at gnc-plugin-page.c:157 0x00007ffff78a3842 in gnc_main_window_open_page (window=window@entry=0x78f020, page=page@entry=0x6f9690) at gnc-main-window.c:2921 0x00007ffff78a5368 in gnc_main_window_restore_page (data=0x7fffffffd9a0, window=0x78f020) at gnc-main-window.c:604 gnc_main_window_restore_window (data=0x7fffffffd9a0, window=0x78f020) at gnc-main-window.c:847 gnc_main_window_restore_all_windows (keyfile=keyfile@entry=0x2714a30) at gnc-main-window.c:929 0x00007ffff7bae858 in gnc_restore_all_state (session=<optimized out>, unused=<optimized out>) at top-level.c:282 0x00007ffff73453d0 in call_c_hook (hook=0x26a90c0, data=0x26bb440) at gnc-hooks.c:217 0x00007ffff6006eb4 in g_hook_list_marshal () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 0x00007ffff7346319 in gnc_hook_run (name=<optimized out>, data=0x26bb440) at gnc-hooks.c:233 0x00007ffff7897104 in gnc_book_opened () at gnc-file.c:509 ---Type <return> to continue, or q <return> to quit--- gnc_post_file_open (filename=<optimized out>, filename@entry=0x26c3580 "/home/otov4its/gnucash/home", is_readonly=is_readonly@entry=0) at gnc-file.c:990 0x00007ffff7897248 in gnc_file_open_file (newfile=newfile@entry=0x26c3580 "/home/otov4its/gnucash/home", open_readonly=open_readonly@entry=0) at gnc-file.c:1057 0x0000000000402da1 in inner_main (closure=<optimized out>, argc=<optimized out>, argv=<optimized out>) at gnucash-bin.c:575 0x00007ffff6987bbd in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff6961a1a in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff69f191f in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff696ae83 in scm_call_4 () from /usr/lib/libguile-2.0.so.22 0x00007ffff6962203 in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff69622b5 in scm_c_with_continuation_barrier () from /usr/lib/libguile-2.0.so.22 0x00007ffff69da875 in ?? () from /usr/lib/libguile-2.0.so.22 0x00007ffff46fbcc8 in GC_call_with_stack_base () from /usr/lib/libgc.so.1 0x00007ffff69daa08 in scm_with_guile () from /usr/lib/libguile-2.0.so.22 0x00007ffff6987cc5 in scm_boot_guile () from /usr/lib/libguile-2.0.so.22 0x00000000004028a9 in main (argc=1, argv=0x7fffffffe0a8) at gnucash-bin.c:722
Thanks. This backtrace suggests that the string "Создается отчет \"Граф" is invalid. At first sight this looks like a variant of bug 719481 where swig breaks strings that are not in utf8 format. A couple of additional questions: where did you get gnucash from ? Did it come from a debian package or did you build yourself ? And what version of guile is gnucash linked to ?
I downloaded GnuCash 2.6.0 sources from debian sid packages and backported it with 'dpkg-buildpackage'. $ dpkg -l | grep guile ii guile-1.8 1.8.8+1-8 amd64 GNU extension language and Scheme interpreter ii guile-1.8-dev 1.8.8+1-8 amd64 Development files for Guile 1.8 ii guile-1.8-libs 1.8.8+1-8 amd64 Core Guile libraries ii guile-2.0 2.0.5+1-3 amd64 GNU extension language and Scheme interpreter ii guile-2.0-libs 2.0.5+1-3 amd64 Core Guile libraries Because in build dependency was specified guile-2.0 I hope gnucash 2.6.0 linked to guile-2.0 rather than guile-1.8.
Unfortunately no. You will have to install the Development files for guile 2.0 as well at least. And even then guile 1.8 will take precedence if it's available. So if you want GnuCash to build against guile 2.0 you will also have to remove guile-1.8-dev. I'd be interested to learn if this problem still persists with guile 2.
Hope this helps. I checked out https://bugzilla.gnome.org/show_bug.cgi?id=719481 If I run GnuCash with: LANGUAGE=en_US.UTF-8 gnucash there is no crash. But if I run: LANGUAGE=ru_RU.utf8 gnucash Program received signal SIGSEGV
Hmm. Even setting LANG=ru_RU.UTF8 on Debian Jesse doesn't crash. Stanislav's stack trace says he's got Guile2: x00007ffff696ae3e in scm_call_3 () from /usr/lib/libguile-2.0.so.22 While I have guile-1.8: 0x00007ffff64eeb40 0x00007ffff656b138 Yes (*) /usr/lib/libguile.so.17 IIRC, Guile2 introduced Unicode support. Perhaps the UTF8->Guile's internal representation->UTF8 isn't working correctly. I'll note that the string tripping up Stanislav is exactly the same one that got Aurimas in bug 719481. There wasn't a stack trace attached to that bug, but I'll hazard a guess that it's the same location as well.
(In reply to comment #10) > Unfortunately no. You will have to install the Development files for guile 2.0 > as well at least. And even then guile 1.8 will take precedence if it's > available. So if you want GnuCash to build against guile 2.0 you will also have > to remove guile-1.8-dev. I'd be interested to learn if this problem still > persists with guile 2. I completely removed guile-1.8. Installed guile-2.0-dev. Gnucash rebuilt. But the result remained the same.
Right. Now do it the other way: Get rid of Guile 2 and install Guile 1.8, including the dev package. I bet it will work.
(In reply to comment #14) > Right. Now do it the other way: Get rid of Guile 2 and install Guile 1.8, > including the dev package. I bet it will work. How can I build GnuCash if build dependencies have guile-2.0-dev and Build-Conflicts: guile-1.8?
./configure [options] && make && make install. ;-) The "Build dependencies" are for the .deb package, not for GnuCash itself. GnuCash supports both Guile 1.8 and Guile 2.0.
(In reply to comment #14) > Right. Now do it the other way: Get rid of Guile 2 and install Guile 1.8, > including the dev package. I bet it will work. It worked. Thanks.
Ok. So we have a workaround (revert back to guile 1.8), but not a fix. Assuming the bug is the same as the one Aurimas reported the real fix needs to go in swig. It's on my todo list, but I haven't gotten around it yet. I did generate a patch and included it in gnucash to work around the issue at compile time. This patch is only applied when configuring for guile 2. Thinking about this further I now believe the patch simply isn't applied in your case. I'm not really familiar with the debian build and packaging system. I suppose debian packages take the gnucash release tarball and wrap it with some debian specific packaging foo. This would be a problem because the code that determines whether or not to apply the patch is only triggered when building from a version control system (svn/git). So the tarball either has the patch applied or not. Building from the tarball won't change that anymore. So in the end this is now a build system bug. I never realised that with my changes we'd need to generate two separate tarballs: one for guile 1.8 and one for guile 2. That shouldn't be the case. The solution is to make in improved patch that works for both guile 1.8 and guile 2 and apply it unconditionally. That way the 2.6.1 tarball will always have the patched files and will work for both versions. I will have to do this work for swig anyway so gnucash can be a useful testbed.
It turns out the patch was already fit for both versions of guile. I have modified the build system to apply it unconditionally. This should result in a tarball that should work both with guile 1.8 and 2.0. My local tests at least seem to confirm this. I have temporarily uploaded a corrected tarball to http://www.kobaltwit.be/gnucash-2.6.0.tar.bz2 Can you try to use this one in the debian build system to generate a gnucash package using guile-2 ? I'm interested to hear if this fixes your problem or not. Note that I currently can't commit my fix to svn/git because the svn server is down. I'll apply it as soon as it shows up again.
Unfortunately I am not familiar with generating a gnucash deb package from scratch.I can backport package only if there is a version in the debian package repository.
Hmm, neither can I :( I can confirm it work on fedora (my environment) though. It would have been nice to have an additional check on another platform but that's not mandatory. I'll keep the bug open until I can push my changes upstream.
Committed in r23702. This will appear in gnucash 2.6.1. Thank you for your report !
*** Bug 664389 has been marked as a duplicate of this bug. ***
*** Bug 722958 has been marked as a duplicate of this bug. ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=721600. Please update any external references or bookmarks.