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 507865 - date->string conversion crash in reports
date->string conversion crash in reports
Status: VERIFIED INCOMPLETE
Product: GnuCash
Classification: Other
Component: Windows
2.2.x
Other Windows
: Normal critical
: ---
Assigned To: Andreas Köhler
Christian Stimming
Depends on:
Blocks:
 
 
Reported: 2008-01-07 17:18 UTC by Sergei Z.
Modified: 2018-06-29 21:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sergei Z. 2008-01-07 17:18:51 UTC
Steps to reproduce:
1. Defaults put "Today Date Format" in "Vendor Report" General tab as "%B %e, %Y"
2. Apparently, %e there is what's causing crash.
3. Changing %e to %d displays date normally without a crash.
4. Could be a problem in some other report options dialogs - don't have data there yet to make sure


Stack trace:
Faulting application gnucash-bin.exe, version 0.0.0.0, time stamp 0x47673898, faulting module libgncmod-engine.dll, version 6.0.6000.16386, time stamp 0x4549bdc9, exception code 0xc0000135, fault offset 0x00008fc7, process id 0x1218, application start time 0x01c851511d17c120.

Other information:
No stack trace - information above from Windows Vista application event log. Bug is obvious and is probably easy to find and fix.
Comment 1 Andrew Sackville-West 2008-01-07 18:18:16 UTC
It is unclear from your report exactly what is happening here.

It *sounds* like you are saying that using the default %e date format causes the whole application to crash. But the %d date format does not cause this crash. Is that correct? And is this reliably reproducible?

Can you try this in the other reports that use that date format: Easy Invoice and Printable Invoice, and report your results? 

retitling.
Comment 2 Sergei Z. 2008-01-07 18:37:48 UTC
That is exactly what I meant - you understood it correctly. It is reproducible reliably - happens every time. If I remove %e (or replace it with %d) and leave other placeholders intact (or add some others, like %H %M %S) it doesn't crash.

By the way, I failed to locate anywhere in the help a list for legitimate placeholders to use in that field.

I just checked other reports:
- Printable invoice - exactly same behavior as above
- Easy invoice - doesn't happen. I guess it's due to the fact that it (today's date) is not used in that report at all! In other words, I can remove the pattern, change it, leave it as is; no today's date is put anywhere on that "Easy invoice". Therefore, no crash.
Comment 3 Andrew Sackville-West 2008-01-14 03:45:40 UTC
The format strings appear to be the same as those in the date program found on linux systems. Can you test using the format string "%_d" and see if you get the same behavior?

I'm guessing this may turn out to be 1) a windows only issue and 2) may be a locale related issue. What locale?
Comment 4 Sergei Z. 2008-01-14 04:37:50 UTC
The "%_d" causes crash as well. My system is Windows Vista Business, locale: en-US. I did not do any compilations - just downloaded Windows binaries. Currently using the newest one, which behaves same in this regard as the previous. Here's the copy of the About dialog:

gnucash 2.2.3
The GnuCash personal finance manager. The GNU way to manage your money!  This copy was built from r16843 on 2008-01-08.
Comment 5 Andrew Sackville-West 2008-01-14 15:57:06 UTC
Okay, thanks Sergei. I'm retagging this to windows as that is almost surely where it belongs. 

Just to sum up, the formatting parameters for the date are broken for space-padded representations of the day, either %e or %_d. I'm also willing to bet this problem may be external to GnuCash, but I don't know windows. 

Meanwhile, since it's an app crasher, I'll patch svn and ask for backport to change the default date formats to %d to prevent data loss.

Anyone disagree?
Comment 6 Andreas Köhler 2008-01-14 22:48:46 UTC
Yes, I want to take a look at it first.
Feel free to attach a patch for it if you feel the pressing need :-)

Milestoning 2.2.4.
Comment 7 Andreas Köhler 2008-01-14 23:12:15 UTC
(In reply to comment #2)
> By the way, I failed to locate anywhere in the help a list for legitimate
> placeholders to use in that field.

You may want to check out
http://msdn2.microsoft.com/en-us/library/fe06s4ak(VS.71).aspx

Does not crash on Windows XP, BTW.
Comment 8 Sergei Z. 2008-01-14 23:51:03 UTC
Thanks for the link - apparently, %e option is not in the list there. 

I have Windows XP Pro SP2 laptop, so I installed v2.2.3 just now to check. Indeed, it doesn't crash. However, it doesn't show the actual day part either. So it just ignores it, apparently. Does show it if I use "%d" though.
Comment 9 Andreas Köhler 2008-03-11 22:23:33 UTC
Oops :-)
m -> 2.2.5 (for now ;-))
Comment 10 Andreas Köhler 2008-05-05 22:16:04 UTC
Oops, missed that one.
Adding to the list for 2.2.6 (now 2, you are not alone).
Comment 11 Derek Atkins 2008-05-05 22:19:58 UTC
%d is usable everywhere, but it is incorrect because it 0-pads days 1-9 (so you
get "May 01, 2008" instead of "May 1, 2008").  %e only works on Linux/Unix. 
%_d works on linux, but %#d works on Windows.   Yay standards.  :(
Comment 12 Charles Day 2008-06-24 23:41:48 UTC
Closing this bug as "fixed" since the application no longer crashes when %e is used. On a related note, the default format on win32 platforms will now be %#d (rather than %e) as of r17250 (see bug 520361, bug 530924, bug 532405).
Comment 13 Andreas Köhler 2008-07-06 11:32:58 UTC
(In reply to comment #12)
> Closing this bug as "fixed" since the application no longer crashes when %e is
> used.

How come?
I am sorry for reopening, but I simply do not understand :-)  If there is still something to be backported for this bug, either make this dependent on another bug, or block backport and tell me the revision.
Comment 14 Charles Day 2008-07-07 15:26:49 UTC
I closed this one because %e is not supported on Windows platforms. I am saying that this bug has been fixed because the application no longer crashes if a user tries to use %e. Instead, the report displays an error message.

I guess I am separating two things:
1. Support for %e on Windows, which we cannot do, but can at least not crash.
2. Not using %e in the default date format on reports. (Covered in bug 532405)
Comment 15 Charles Day 2008-07-22 23:49:02 UTC
Now that bug 532405 has been fixed, it seems like this bug only remains open because Vista crashes if the user tries to use %e. Is this something we can do anything about, and if so, what needs to be done?
Comment 16 Charles Day 2008-08-01 17:36:56 UTC
Does entering %e on Vista still cause a crash when using GnuCash 2.2.6? (Make sure to enter %e manually, as %#d is now the default.)
Comment 17 Sergei Z. 2008-09-19 03:57:11 UTC
I just got an email regarding this bug, I assume, because I was the one reporting it originally and its status now is NEEDINFO. Unfortunately, I quit using gnucash quite a while ago so I can't help with it anymore. Sorry.
Comment 18 Andreas Köhler 2008-09-19 04:01:13 UTC
OK, thanks Sergei.
I will close this one as INCOMPLETE.
Comment 19 John Ralls 2018-06-29 21:58: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=507865. Please update any external references or bookmarks.