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
Please attach the crash report from /Applications/Utilities/Console.app.
Created attachment 373077 [details] Problem Report for Gnucash
Created attachment 373078 [details] Error log from Console app
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?
(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.
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.
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.
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.