GnuCash
Contact   Instructions
Bug 796981 - Gnucash crashes with critical error when selecting another file ( a mysql resource locator )
Summary: Gnucash crashes with critical error when selecting another file ( a mysql res...
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: MacOS (show other bugs)
Version: 3.3
Hardware: PC Mac OS
: Normal major
Target Milestone: ---
Assignee: macos
QA Contact: macos
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-17 17:11 EST by michiel.c.rop
Modified: 2018-12-22 14:52 EST (History)
2 users (show)

See Also:


Attachments
Stderr (936 bytes, text/plain)
2018-12-17 17:11 EST, michiel.c.rop
no flags Details
Problem Report for Gnucash (88.75 KB, text/plain)
2018-12-18 14:22 EST, michiel.c.rop
no flags Details
Error log from Console app (85.27 KB, text/plain)
2018-12-18 14:24 EST, michiel.c.rop
no flags Details

Description michiel.c.rop 2018-12-17 17:11:53 EST
Created attachment 373076 [details]
Stderr

Reproduction:
* Open gnuchash from command line:
  /Applications/Gnucash.app/Contents/MacOS/Gnucash --logto=stderr
* Gnucash loads file that was open from mysql
* Switch to another mysql database


Current situation:
Gnucash terminates.

Desired situation:
Other database is openen without crashing.


System Version: macOS 10.14.1 (18B75)
Kernel Version: Darwin 18.2.0 

See attached file for error log.

From my system.log:
Dec 17 22:44:31 [hostname] com.apple.xpc.launchd[1] (org.gnucash.Gnucash.11988[74004]): Service exited due to SIGSEGV | sent by exc handler[74004]
Dec 17 22:44:35 [hostname] Problem Reporter[74007]: DEPRECATED USE in libdispatch client: dispatch source activated with no event handler set; set a breakpoint on _dispatch_bug_deprecated to debug
Comment 1 John Ralls 2018-12-17 20:08:56 EST
Please attach the crash report from /Applications/Utilities/Console.app.
Comment 2 michiel.c.rop 2018-12-18 14:22:17 EST
Created attachment 373077 [details]
Problem Report for Gnucash
Comment 3 michiel.c.rop 2018-12-18 14:24:56 EST
Created attachment 373078 [details]
Error log from Console app
Comment 4 John Ralls 2018-12-18 14:49:59 EST
Does the second database load OK if you open it from a fresh launch of GnuCash?If so, does it have any open report tabs on launch?
Comment 5 michiel.c.rop 2018-12-19 14:18:42 EST
(In reply to John Ralls from comment #4)
> Does the second database load OK if you open it from a fresh launch of
> GnuCash?If so, does it have any open report tabs on launch?

Hi,

When I started gnucash it displayed database "A", the problem occured when I switched to database "B".

I Started gnucash with:
$ /Applications/Gnucash.app/Contents/MacOS/Gnucash --nofile
and opened the "B" database
and indeed it has multiple reports open

Using --nofile at start up is a workaround for this bug.
Comment 6 John Ralls 2018-12-19 20:58:40 EST
OK. Can you try closing the reports in B and then repeat the A -> B switch and see if GnuCash still crashes? You could accomplish this without losing the reports by moving aside ~/Library/Application Support/Gnucash/books/B.gcm before trying to open B.

If B opens with no reports open it would be useful if you can experiment with the open reports to see if there's some pattern, i.e. a particular report that causes the crash, some number of open reports, etc. I think the easiest way to do this would be to make a copy of B.gcm and edit it. At the end of the file you'll find an entry for each tab, marked [Page N] where N is an integer. You can remove some of those entries, renumbering the remainder so that there aren't any gaps. If you use TextEdit be sure to save as plain text and to turn off smart quoting.
Comment 7 John Ralls 2018-12-22 10:14:51 EST
As it happens I encountered the same crash yesterday. I had an XML file with two report tabs open and clicked File>New.... GnuCash crashed immediately.

Closing the report tabs before clicking File>New prevents the crash.

Since I can reproduce the problem I don't need you to do any more diagnosis.
Comment 8 John Ralls 2018-12-22 14:52:38 EST
The problem is that if the currently open file has a report tab with
another tab to its right and selected then when the selected tab is
closed by the shutdown code Gtk sends a "realize" signal to the report
page. That sets an idle event to gnc_plugin_page_report_load_uri, but the
shutdown code proceeds to destroy the page and GnuCash has loaded the new
session before the idle event fires. By that time there's no page so
GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE naturally returns NULL and the first
dereference crashes.

Fixed in git, will be in 3.4.

Note You need to log in before you can comment on or make changes to this bug.