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 738395 - most reports crash with C++ Runtime Library error
most reports crash with C++ Runtime Library error
Status: RESOLVED NOTGNOME
Product: GnuCash
Classification: Other
Component: Reports
2.6.4
Other Windows
: Normal major
: ---
Assigned To: gnucash-reports-maint
gnucash-reports-maint
Depends on:
Blocks:
 
 
Reported: 2014-10-12 13:22 UTC by rqkeating
Modified: 2018-06-29 23:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
report crash output (762.91 KB, text/plain)
2014-11-17 22:07 UTC, rqkeating
Details
log file (759.42 KB, text/plain)
2014-11-20 18:26 UTC, rqkeating
Details
log file (799.01 KB, text/plain)
2014-11-29 23:51 UTC, rqkeating
Details

Description rqkeating 2014-10-12 13:22:17 UTC
Run almost any report and the error is 
"This application has requested the Runtime to terminate in an unusual way. Please contact the applications' support team for more information.
After this message GnuCash crashes and the next time you open it is says the data file is locked.

This also happened on the previous GnuCash release.  I am running Windows 7 with all the latest patches.

I don't have a list of all reports that crash because it is time consuming recovering and trying the next report.  However, all Budget reports do work including my saved budget reports.

On 2.6.3 the program would crash and die.  On 2.6.4 it crashes but must be killed with the Task Manager.  

If I can provide any information, please contact me and I will or I can run different tests if that would help.

If I create a new file with no data, the reports do not crash. Obviously they are blank since there is no data, but they don't crash.

I ran a check/repair on my data file and I didn't see any indication that it did or did not do anything and the reports still crash afterwards.
Comment 1 rqkeating 2014-11-11 18:43:19 UTC
Am I supposed to do something more to get a response to this?
Comment 2 Geert Janssens 2014-11-12 13:29:18 UTC
My apologies you didn't get a reply any sooner.

Let me start with the easy part first: the different behaviour between how gnucash 2.6.3 and 2.6.4 terminate is a known bug which is currently being worked on. In your case you see this as the result of a crash, but others have reported that simply trying to close gnucash 2.6.4 with at least one report open causes it to lock up hard.

Now on to the core of your problem: the crash itself.

Can you attach a trace file [1] from the gnucash run that ended in a crash ?

[1] You can learn more about obtaining the trace file here: http://wiki.gnucash.org/wiki/Tracefile
Comment 3 rqkeating 2014-11-12 14:03:02 UTC
Here is a trace file from when I run an Account Summary report and GnuCash crashes.
----------------------
* 07:33:43  WARN <Pango> 'c:/gcdev/gnome/lib/pango\1.8.0\modules\pango-basic-win32.dll': The specified module could not be found.
* 07:33:43  WARN <qof.engine> [guid_init()] only got 919 bytes.
The identifiers might not be very random.
* 07:33:55  WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (No such file or directory)
----------------------

Here is a trace when I successfully run a saved budget report, leave that tab open and then quit GnuCash from the "File/Quit" menu selection.  GnuCash hangs and I have to kill it.
----------------------
* 07:40:49  WARN <Pango> 'c:/gcdev/gnome/lib/pango\1.8.0\modules\pango-basic-win32.dll': The specified module could not be found.
* 07:40:49  WARN <qof.engine> [guid_init()] only got 919 bytes.
The identifiers might not be very random.
* 07:40:58  WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (No such file or directory)

I looked on my C: drive and there is no directory like c:/gcdev/...
That dll (pango-basic-win32.dll) is located under C:\Program Files (x86)\gnucash\lib\pango\1.8.0\modules
It also appears under another program I have at: C:\Program Files (x86)\LilyPond\usr\lib\pango\1.6.0\modules
They are not the same files as their sizes are very different.

Let me know how else I can help.  Thanks.
Comment 4 Geert Janssens 2014-11-12 15:22:16 UTC
For now I'll ignore the pango warning. There was a bug in the first gnucash 2.6.4 for Windows releases (2.6.4 and 2.6.4-1) related to pango. However this bug resulted in all text being completely unreadable, not just in reports.

The second thing that catches my attention is that you have LilyPond installed. This application has interfered with gnucash before due to using a different guile library, yet placing it front and center on the system wide path [1].

To confirm or rule out any interference with lilypond, can you uninstall that program temporarily and try to load a report again ?

[1] http://wiki.gnucash.org/wiki/FAQ#Q:_Gnucash_crashes_immediately_on_startup
Comment 5 rqkeating 2014-11-12 18:29:13 UTC
I uninstalled LylPond and still got the same error.  I rebooted, made sure that there was only one pango-basic-win32.dll and that it was under GnuCash. Also checked that the LilPond files and directory under  C:\Program Files (x86) were completely removed.  Here is the GnuCash log file:

* 12:20:31  WARN <Pango> 'c:/gcdev/gnome/lib/pango\1.8.0\modules\pango-basic-win32.dll': The specified module could not be found.
* 12:20:32  WARN <qof.engine> [guid_init()] only got 919 bytes.
The identifiers might not be very random.
* 12:20:41  WARN <gnc.app-utils> Could not spawn perl: Failed to execute child process (No such file or directory)

Would it help to have a list of the Reports that work and those that don't?  It would take a while but if you want I could try and make that list.
Comment 6 Geert Janssens 2014-11-17 21:52:44 UTC
The trace file doesn't give much information unfortunately. Without more details it will become difficult to track this down.

Can you start a windows command prompt and run gnucash from there with the following command:
C:\Program Files (x86)\gnucash\bin\gnucash.exe --debug --log=gnc.scm

Make it crash and attach the generated trace file here. Hopefully that will give some more insight in where exactly it crashes.
Comment 7 rqkeating 2014-11-17 22:07:16 UTC
Created attachment 290882 [details]
report crash output
Comment 8 rqkeating 2014-11-17 22:08:04 UTC
Comment on attachment 290882 [details]
report crash output

Here is the output you requested.
Comment 9 Geert Janssens 2014-11-20 16:29:48 UTC
Thank you for the crash output.
Unfortunately I gave you an incomplete command and the logging I was hoping to get from the report generation is not in there.

Can you redo this with the following command (all in one line):
C:\Program Files (x86)\gnucash\bin\gnucash.exe --debug --log gnc.scm=debug

Thanks
Comment 10 rqkeating 2014-11-20 18:26:43 UTC
Created attachment 291118 [details]
log file

output from
C:\Program Files (x86)\gnucash\bin\gnucash.exe --debug --log gnc.scm=debug
and running report and having GnuCash crash.
Comment 11 Geert Janssens 2014-11-29 18:59:36 UTC
Thank you again. Except it doesn't seem to work as intended on Windows... There are still no gnc.scm debug messages in the log :(

So here's yet another way to get the info:
Locate your .gnucash directory (should be in c:\Users\<your-user-account-name>\
Inside the .gnucash directory create a file called log.conf
with this content:

[levels]
gnc.scm=debug


And then just run gnucash again with only the --debug option. Thanks.
Comment 12 rqkeating 2014-11-29 23:29:07 UTC
I can't find a .gnucash directory.  I think that is for Unix.  On Windows there is no gnucash dir under c:\Users\<your-user-account-name>\
The executable is in 
C:\Program Files (x86)\gnucash\bin
Do you want me to create the log.conf there?
Comment 13 rqkeating 2014-11-29 23:51:02 UTC
Created attachment 291810 [details]
log file

After Googling found out I had to make .gnucash dir.  Finally was able to force windows to take a folder with a "." in it, made log.conf with the text you said, ran
"C:\Program Files (x86)\gnucash\bin\gnucash.exe" --debug
ran the Account Summary Report and got a crash.
Attached is the output.  At a high level it looks like what I sent before.  If you didn't get what you wanted, then I am guessing the log.conf is in the wrong place.
Comment 14 rqkeating 2014-12-21 00:10:17 UTC
This problem still exists with version 2.6.5.  The only change I've seen is that now after the crash the program closes faster so I guess that's a step in the correct direction.  

Is there anything I can do to provide more information to help this get resolved?
Comment 15 Geert Janssens 2014-12-23 15:28:37 UTC
Thank you for your update. The information I'm looking for in the log file is indeed still not there.

The fact that there was no .gnucash file in c:\Users\<your-user-account-name>\ is an important clue.

It means either there is a write permission problem or it means Windows 7 is storing this information somewhere else. Unfortunately I only have Windows XP to experiment with so I am practically blind here.

If you're willing to look into this further I'll need your help to find my way around your system.

Let's try to rule out the write permission problem first: when you open your gnucash data file, does it automatically restore the open tabs and windows since the last time you closed gnucash or do you only get an account hierarchy ?

Secondly, did you ever manually change the environment file found in 
c:\Program Files (x86)\gnucash\etc\gnucash ?

Third: how did you install gnucash 2.6.5 ? Did you simply run the installer or did you first remove gnucash 2.6.4 ?

If you simply ran ther installer you may try if these steps help:
1. Uninstall GnuCash from the Software control panel
2. Rename c:\Program Files (x86)\gnucash to gnucash-old if it still exists
3. Use the gnucash installer to install gnucash 2.6.5

Does this change anything ?
Comment 16 rqkeating 2014-12-23 18:26:57 UTC
1. When I open GnuCash the tabs I had open last time are restored.  I tried it multiple times with different tabs and it all works.  

2. I never manually change the environment file.

3. I don't remeber how I installed 2.6.5 but I guess that I ran the install and let it do the uninstall/install

4. I followed your uninstall, rename old dir and re-installed and the reports still are broke as before.

I tried running GnuCash as administrator, but that didn't help. The reports still crash.

Let me know what else I can do.
Comment 17 Geert Janssens 2014-12-23 19:51:02 UTC
(In reply to comment #16)
> 1. When I open GnuCash the tabs I had open last time are restored.  I tried it
> multiple times with different tabs and it all works.  
> 
Good. At least this rules out the potential write permission issue I feared. It also means somewhere on your system there is already a .gnucash directory which should contain other files than the log.conf I asked you to create. Can you locate that directory on your system ?
The correct one should have (among others) a subdirectory called "books" and if you ever saved a custom report there will also be a "saved-reports-2.4" file in there.

If you find such a directory, can you tell me where you found it (so I can learn how Windows 7 organises things) ?

And then put the log.conf file in that directory, and rerun/crash gnucash.

> 2. I never manually change the environment file.
> 
Ok, that means the .gnucash directory will be created in its default location, whatever that may be under Windows 7.

> 3. I don't remeber how I installed 2.6.5 but I guess that I ran the install and
> let it do the uninstall/install
> 
> 4. I followed your uninstall, rename old dir and re-installed and the reports
> still are broke as before.
> 
That's unfortunate :(

> I tried running GnuCash as administrator, but that didn't help. The reports
> still crash.
> 
Ok.

What you still could try is to create a completely new user on your Windows 7 system and try to run gnucash in there. If it works there, at least we know something in your main user's settings has gone bad.
Comment 18 rqkeating 2014-12-23 20:40:44 UTC
The only log.conf file I find on my system is under
C:\Users\<my_login>\.gnucash
There are no other files or directories in that directory.

My file "saved-reports-2.4" is located in
G:\cygwin\home\<my_login>\.gnucash
That directory has directories called books, checks, translog and some files. 

Could it be that GnuCash is reading some variables from Windows and some from
the Cygwin install?  If so did it do that on install or when Gnucash runs?

Let me get back to you about creating a new user.
Comment 19 rqkeating 2014-12-23 20:46:36 UTC
Okay, using another user on Windows 7 and loading my GnuCash data file, I can run reports without a crash.  The other account I used for this experiment has no connection or user associated with Cygwin.  I think we found the problem.  What's next?  I'd rather not uninstall Cygwin. Hopefully there is a way to avoid that.
Comment 20 rqkeating 2014-12-23 20:54:43 UTC
To further follow up, after running GnuCash and a report under the new user I now have the following directory 
C:\Users\<my_new_user_login>\.gnucash
and under that directory are the directories books, checks, and translog just like you said should be there.
Comment 21 Geert Janssens 2014-12-23 21:10:39 UTC
Heh, at least that is progress. Thanks for the replies.

It looks like cygwin is exporting a number of environment variables that influence gnucash. One will for sure be the HOME environment variable because that's the one being used to create the .gnucash directory.
Can you check that ?

And ideally can you figure out which other variables cygwin alters. I presume it will also modify the path.

Do you have guile installed under cygwin ?
Comment 22 rqkeating 2014-12-23 21:17:24 UTC
When I run GnuCash it is reading the HOME variable.  That is not a standard Window variable.  It is used for Cygwin and GnuCash shouldn't be reading it when installed under Windows.  For Windows I think the correct variable is "HOMEPATH".

When I change Home to C:\Users\<my_login>
and run GnuCash, then the proper directories get created under
C:\Users\<my_login>\.gnucash
books, checks, and translog 

However that doesn't solve the problem and the reports still crash, but its a start.

I don't know what guile is, but when I type it in a Cygwin terminal I just get a "command not found" message so I guess it is not installed.

I can't see any other Cygwin specific variables, but I am not familiar enough with them and Windows variables to tell.
Comment 23 Geert Janssens 2014-12-23 21:52:54 UTC
(In reply to comment #22)
> When I run GnuCash it is reading the HOME variable.  That is not a standard
> Window variable.  It is used for Cygwin and GnuCash shouldn't be reading it
> when installed under Windows.  For Windows I think the correct variable is
> "HOMEPATH".
> 
Unfortunately GnuCash is not a "Windows" application either. It's built using mingw, which very simplistically said a compatibility layer to run linux/unix applications on Windows, just like cygwin is.

The use of HOME comes from deep inside that system, not something gnucash is doing purposefully.

> When I change Home to C:\Users\<my_login>
> and run GnuCash, then the proper directories get created under
> C:\Users\<my_login>\.gnucash
> books, checks, and translog 
> 
> However that doesn't solve the problem and the reports still crash, but its a
> start.
> 
Well I wanted to wait for your answer, but I would have guessed that the use of the HOME environment variable was not the issue. It's only used to save some user data and what gnucash is concerned it doesn't really matter where exactly that is done as long as the location is stable.

> I don't know what guile is, but when I type it in a Cygwin terminal I just get
> a "command not found" message so I guess it is not installed.
> 
Indeed. At this point I'm going over a number of educated guesses. It is odd that only some reports fail while others work.

> I can't see any other Cygwin specific variables, but I am not familiar enough
> with them and Windows variables to tell.

The most likely culprit would be the PATH environment variable. This is what is used to find shared libraries on Windows. If cygwin exposes some paths via this variable that has different versions of shared libraries gnucash depends on, gnucash would load the wrong shared libraries, which could be the cause of a crash.

To check if this is the case, you can
- Download the Dependency Walker tool (http://www.dependencywalker.com/)
- This is released as a simple zip file which you can extract wherever you like.
- Run this tool and open c:\Program Files (x86)\gnucash\bin\gnucash.exe
- It will list a hierarchy of shared libraries used by gnucash and below it the same list but sorted alphabetically
- Go over the alphabetical list and check if any of these shared libraries is part of the cygwin distribution (you know by inspecting the path for each library)

If it is you definitely have a PATH conflict between gnucash and cygwin.
Comment 24 rqkeating 2014-12-23 22:08:51 UTC
I don't see any "cygwin" in any paths.  I do however get these warnings 


Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

The warnings/errors are coming from these:

API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-1.DLL
DCOMP.DLL
GPSVC.DLL
IESHIMS.DLL

The error is 
"Error opening file. The system cannot fine the file specified (2).
Comment 25 rqkeating 2015-01-10 04:03:31 UTC
Bad news and good news.  I installed some new hardware, had driver problems, did a fresh install of Windows 7 and now all the GnuCash reports work.  I obviously don't have all the programs I had installed before so I have no idea who was the culprit.  If it happens again I can take out a new bug report and reference back to this one. Thanks for your help, sorry for the trouble.
Comment 26 Geert Janssens 2015-01-16 18:15:12 UTC
Ok. Glad you got it working again.

I will close this bug as there is currently nothing more to test.
Comment 27 John Ralls 2018-06-29 23:34:49 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=738395. Please update any external references or bookmarks.