After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345824 - Crash on startup with saved reports and various renamings
Crash on startup with saved reports and various renamings
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Reports
git-master
Other All
: Normal critical
: ---
Assigned To: Chris Lyttle
Chris Lyttle
: 343830 505921 (view as bug list)
Depends on:
Blocks: backport
 
 
Reported: 2006-06-24 14:50 UTC by Bill Skellenger
Modified: 2018-06-29 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bill Skellenger 2006-06-24 14:50:53 UTC
Steps to reproduce:
1. I made some changes to a report using the "options" dialog.  
2. Renamed the report (as this seems like the only way to save changes)
3. I added the new report using "add report" (name was changed to: Fidelity 1Qtr Weekly)
4. The new report did not show up under "Custom reports"
5. I changed another report name, and this time the "Add Report" button did not appear (it remained grayed out)
6. I restarted GnuCash hoping my added report would appear -- and GnuCash crashed on startup.

Stack trace:
Here is what appears in the console -- looks like a scheme issue; unfortunately I know nothing about Scheme!

wskellenger@gladstone ~ $ gnucash
gnucash: [M] "Found Finance::Quote version ""1.08"
Backtrace:
In current input:
   1: 0* (let ((options #)) (let (#) (# option)) (let (#) (# option)) ...)
   1: 1* (let ((option #)) ((lambda # #) option))
   1: 2* [gnc:lookup-option #f "Display" "Plot Height"]
In /usr/share/gnucash/scm/options.scm:
1463: 3  ((options (quote lookup)) section name)
1463: 4* (options (quote lookup))

/usr/share/gnucash/scm/options.scm:1463:4: In expression (options (quote lookup)):
/usr/share/gnucash/scm/options.scm:1463:4: Wrong type to apply: #f

----------------

I know this does not help you guys; I will try to build a version w/ debug info later today.

(no debugging symbols found)...(no debugging symbols found)...

** (gnucash:19405): WARNING **: Failed to open module gnucash/app-utils

** (gnucash:19405): WARNING **: : could not locate gnucash/app-utils interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/engine

** (gnucash:19405): WARNING **: : could not locate gnucash/engine interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/register/ledger-core

** (gnucash:19405): WARNING **: : could not locate gnucash/register/ledger-core interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/register/register-core

** (gnucash:19405): WARNING **: : could not locate gnucash/register/register-core interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/register/register-gnome

** (gnucash:19405): WARNING **: : could not locate gnucash/register/register-gnome interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/import-export/qif-import

** (gnucash:19405): WARNING **: : could not locate gnucash/import-export/qif-import interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/report/report-system

** (gnucash:19405): WARNING **: : could not locate gnucash/report/report-system interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/report/stylesheets
** (gnucash:19405): WARNING **: : could not locate gnucash/report/stylesheets interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/report/standard-reports

** (gnucash:19405): WARNING **: : could not locate gnucash/report/standard-reports interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/report/utility-reports

** (gnucash:19405): WARNING **: : could not locate gnucash/report/utility-reports interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/report/locale-specific/us

** (gnucash:19405): WARNING **: : could not locate gnucash/report/locale-specific/us interface v.0


** (gnucash:19405): WARNING **: Failed to open module gnucash/report/report-gnome

** (gnucash:19405): WARNING **: : could not locate gnucash/report/report-gnome interface v.0


** ERROR **: GnuCash engine failed to initialize.  Exiting.

aborting...

Program received signal SIGABRT, Aborted.
---Type <return> to continue, or q <return> to quit---
0xb683f421 in kill () from /lib/libc.so.6


Other information:
Comment 1 Bill Skellenger 2006-06-26 02:09:22 UTC
Deleting ~/.gnucash/saved-reports-2.0 (actually I just renamed it) now allows me to open the file (thankfully).

I found that by just creating a blank saved-reports-2.0 file in ~/.gnucash causes the same crash on startup:

wskellenger@gladstone ~/.gnucash $ gnucash
gnucash: [M] "Found Finance::Quote version ""1.08"
Backtrace:
In current input:
   1: 0* (let ((options #)) (let (#) (# option)) (let (#) (# option)) ...)
   1: 1* (let ((option #)) ((lambda # #) option))
   1: 2* [gnc:lookup-option #f "Display" "Plot Height"]
In /usr/share/gnucash/scm/options.scm:
1463: 3  ((options (quote lookup)) section name)
1463: 4* (options (quote lookup))

/usr/share/gnucash/scm/options.scm:1463:4: In expression (options (quote lookup)):
/usr/share/gnucash/scm/options.scm:1463:4: Wrong type to apply: #f

-----------------

Now I get several message in the console (on startup) such as:

wskellenger@gladstone ~/.gnucash $ gnucash
gnucash: [E] "Refusing to add custom report with the same name as an existing report."
gnucash: [E] "Please edit your saved-reports file and delete the section for: ""Income/Expense Chart"
gnucash: [E] "Refusing to add custom report with the same name as an existing report."
...

Comment 2 Christian Stimming 2006-06-26 08:53:44 UTC
I'm confused as to why it reads some reports if the file ~/.gnucash/saved-reports-2.0 is blank. I can't check right now, but is there also a file ~/.gnucash/books/path%to%gnucash%file file? Does it contain something which look like report options? If yes, please rename that existing file into a backup filename and see whether the crash still occurs (hopefully it doesn't). Then, please try to copy portions of the backup file into the original filename again, until the crash appears again. If you have been able to see which portion is causing the crash, we would be very happy if you could post this here. Thanks a lot.
Comment 3 Bill Skellenger 2006-06-28 01:59:32 UTC
(In reply to comment #2)
> I'm confused as to why it reads some reports if the file
> ~/.gnucash/saved-reports-2.0 is blank. I can't check right now, but is there
> also a file ~/.gnucash/books/path%to%gnucash%file file? Does it contain
> something which look like report options? If yes, please rename that existing
> file into a backup filename and see whether the crash still occurs (hopefully
> it doesn't). Then, please try to copy portions of the backup file into the
> original filename again, until the crash appears again. If you have been able
> to see which portion is causing the crash, we would be very happy if you could
> post this here. Thanks a lot.
> 

Hi Christian:

Sorry for the delay in getting back on this issue.  

Okay, I just started Gnucash again.  saved-reports-2.0 is not existing right now, (it has been renamed to saved-reports-2.0.backup) and GnuCash starts w/ no issue.

* I'm closing GnuCash now, and creating the blank file:

wskellenger@gladstone ~/.gnucash $ echo "" >> saved-reports-2.0
wskellenger@gladstone ~/.gnucash $ cat saved-reports-2.0

wskellenger@gladstone ~/.gnucash $

* Now I'm starting GnuCash:

wskellenger@gladstone ~/.gnucash $ gnucash
gnucash: [M] "Found Finance::Quote version ""1.08"
Backtrace:
In current input:
   1: 0* (let ((options #)) (let (#) (# option)) (let (#) (# option)) ...)
   1: 1* (let ((option #)) ((lambda # #) option))
   1: 2* [gnc:lookup-option #f "Display" "Plot Height"]
In /usr/share/gnucash/scm/options.scm:
1463: 3  ((options (quote lookup)) section name)
1463: 4* (options (quote lookup))

/usr/share/gnucash/scm/options.scm:1463:4: In expression (options (quote lookup)):
/usr/share/gnucash/scm/options.scm:1463:4: Wrong type to apply: #f

* Still able to reproduce the behavior.

* Under ~/.gnucash/books/ I find three files (?):

wskellenger@gladstone ~/.gnucash/books $ ls
%2Fhome%2Fwskellenger%2Fgnucash_data%2Fwjs_gnucash  
wjs_gnucash
%2Fhome%2Fwskellenger%2Fwjs_gnucash

* I just renamed the most recently accessed one:

wskellenger@gladstone ~/.gnucash/books $ mv wjs_gnucash wjs_gnucash.backup

* And GnuCash STARTS!

wskellenger@gladstone ~/.gnucash/books $ gnucash
gnucash: [M] "Found Finance::Quote version ""1.08"
gnucash: [W] "failure loading ""/home/wskellenger/.gnucash/books/%2Fhome%2Fwskellenger%2Fgnucash_data%2Fwjs_gnucash"

* The accounts window shows up and two tabs show up that are blank, each with message "Report error -- An error occurred while running the report."

* I played with many of the options, then finally started and created a new report, but did not save it.  Instead, I closed GnuCash and restarted it, so that I could get a new file under .gnucash/books/ to play with.

I THINK I FOUND THE PROBLEM...

The very first directive:

let ((options (gnc:report-template-new-options/name "Assets Over Time")))

If you change the name of this "Assets Over Time" to a report that doesn't exist (just delete one letter in it), you will get the same behavior that I reported.

When I look at the "bad" file:

let ((options (gnc:report-template-new-options/name "CSB/Nova")))

The report-template-new-options/name called "CSB/Nova" no longer exists...  it was a custom report that must've been deleted?

So I guess there are two problems:

1.  If a report options template no longer exists, handle that somehow
2.  Why does a blank saved-reports-2.0 cause this to happen, but deleting saved-reports-2.0 will seemingly sure the issue?  Maybe the existence of saved-reports-2.0 itself (with or without information in it) is another clue...
Comment 4 Christian Stimming 2006-08-02 08:27:00 UTC
*** Bug 343830 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Sackville-West 2008-01-01 00:28:38 UTC
this is definitely related to Bug #505921.
Comment 6 Andrew Sackville-West 2008-01-06 23:58:44 UTC
*** Bug 505921 has been marked as a duplicate of this bug. ***
Comment 7 Andrew Sackville-West 2008-01-07 00:11:20 UTC
The problem here is simple and correctly diagnosed above. If a report template on which an already open report is based has moved aside in some way (name change, deletion, whatever) then the options returned are #f. All the subsequent option lookup code as well as the call to gnc:restore-report will fail on #f options. 

I also think the blank saved-reports-2.0 is a red herring. If there is an open report that is based on a saved-report, then it will fail. But in my testing, just a blank saved-reports-2.0 in itself is not a problem. AFAICT.

fixed in r16836. 

Backport requested.
Comment 8 Andreas Köhler 2008-03-01 14:57:55 UTC
Applied to branches/2.2 as r16977 for GnuCash 2.2.4.
Thanks a lot!
Comment 9 John Ralls 2018-06-29 21:08:35 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=345824. Please update any external references or bookmarks.