http://bugs.winehq.org/show_bug.cgi?id=14192
Summary: ElsterFormular 2007/2008: Data submission fails with "Errorcode 49152" Product: Wine Version: 1.0.0 Platform: PC URL: http://www.elster.de/ OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: Sebastian.Leske@sleske.name
Elster is the official German program required to submit various tax statements.
It installs and starts with Elster, and data input mostly works (help does not work, see bug 11303).
However, when running a "Plausibilitätsprüfung" (plausibility check) or actually submitting the data (real submission or submission test, "Datenübermittlung"/"Tets der Datenübermittlung"), Elster fails with a weird error message:
Programmversion: 9.3.0.0 Fehlermeldung einer ELSTER-Telemodul-Funktion: Errorcode: 49152 5VT Sorry, kein Fehlertext für diesen Fehlercode vorhanden.
The "5VT" is different each time the error occurs; the rest of the text is always the same.
This has already been discussed on the Elster mailing lists, without result: https://www.elster.de/cgi-bin/ubba/ultimatebb.cgi?ubb=get_topic;f=1;t=002617
http://bugs.winehq.org/show_bug.cgi?id=14192
--- Comment #1 from Juan Lang juan_lang@yahoo.com 2008-06-29 16:31:23 --- Could you attach the full console output from running the program?
http://bugs.winehq.org/show_bug.cgi?id=14192
--- Comment #2 from Sebastian.Leske@sleske.name 2008-06-29 19:33:27 --- Created an attachment (id=14463) --> (http://bugs.winehq.org/attachment.cgi?id=14463) Console log of ElsterFormular run
Console log is attached.
Note however that calling the plausibility checks (which triggers the error) did not produce any output on the console. The output occured only during startup and shutdown.
http://bugs.winehq.org/show_bug.cgi?id=14192
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #3 from Anastasius Focht focht@gmx.net 2008-06-30 05:22:04 --- Hello,
the program uses C++ iostreams to write binary chunks into files. The stream i/o implementation use underlying C runtime file API (msvcrt) for carrying out the file operations.
--- snip --- 0009:Call msvcrt.fopen(0400c959 "C:\windows\profiles\focht\ElsterFormular\2007-2008\2AdxAAYeCi8t\2007CS0000.cert",76077374 "wb") ret=76042aa6 0009:Call KERNEL32.CreateFileA(0400c959 "C:\windows\profiles\rmi\ElsterFormular\2007-2008\2AdxAAYeCi8t\2007CS0000.cert",40000000,00000003,0188ef20,00000002,00000080,00000000) ret=60f4e2da 0009:Ret KERNEL32.CreateFileA() retval=000000f8 ret=60f4e2da 0009:Ret msvcrt.fopen() retval=001a71f0 ret=76042aa6 .. 0009:Call KERNEL32.WriteFile(000000f8,0019dce0,0000004e,0188eee8,00000000) ret=60f500a5 0009:Ret KERNEL32.WriteFile() retval=00000001 ret=60f500a5 0009:Ret msvcrt.fputc() retval=0000000a ret=76024e3e 0009:Call msvcrt.fputc(00000032,001a71f0) ret=76024e3e 0009:Ret msvcrt.fputc() retval=00000032 ret=76024e3e 0009:Call msvcrt.fputc(00000030,001a71f0) ret=76024e3e .. 0009:Call msvcrt.fputc(ffffffff,001a71f0) ret=76024e3e 0009:Ret msvcrt.fputc() retval=ffffffff ret=76024e3e 0009:Call ntdll.strlen(760775e0 "ios::badbit set") ret=76021f99 0009:Ret ntdll.strlen() retval=0000000f ret=76021f99 0009:Call msvcrt.??2@YAPAXI@Z(00000021) ret=760226a2 .. 0009:Call msvcrt._CxxThrowException(0188efbc,7607d79c) ret=76023134 0009:Call KERNEL32.RaiseException(e06d7363,00000001,00000003,0188ef1c) ret=60f44a6c 0009:trace:seh:raise_exception code=e06d7363 flags=1 addr=0x7b8432c0 0009:trace:seh:raise_exception info[0]=19930520 0009:trace:seh:raise_exception info[1]=0188efbc 0009:trace:seh:raise_exception info[2]=7607d79c 0009:trace:seh:raise_exception eax=7b82c449 ebx=7b8b2880 ecx=00000000 edx=0188ef1c esi=0188ef1c edi=0188ee90 0009:trace:seh:raise_exception ebp=0188ee78 esp=0188ee14 cs=0073 ds=007b es=007b fs=0033 gs=003b flags=00000246 --- snip ---
The "character" argument (int) is sign extended before getting passed into fputc(), hence the 0xffffffff value. Wine's fputc() returns the character written as passed in on some code paths, which results in (int) -1 returned. This value is interpreted by upper layer streams impl as EOF -> failure. Solution: cast to unsigned char range/zero extend upon return.
The patch submitter should add small conformance test for this issue.
--- snip --- diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index f85afd3..c26a400 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2539,7 +2539,7 @@ int CDECL MSVCRT_fputc(int c, MSVCRT_FILE* file) return res ? res : c; } else - return c; + return (unsigned char)c; } else { return MSVCRT__flsbuf(c, file); } @@ -2568,7 +2568,7 @@ int CDECL MSVCRT__flsbuf(int c, MSVCRT_FILE* file) unsigned char cc=c; int len; len = MSVCRT__write(file->_file, &cc, 1); - if (len == 1) return c; + if (len == 1) return (unsigned char)c; file->_flag |= MSVCRT__IOERR; return MSVCRT_EOF; } --- snip ---
With that patch applied, the "plausibility check" succeeds.
Regards
http://bugs.winehq.org/show_bug.cgi?id=14192
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=14192
--- Comment #4 from Sebastian.Leske@sleske.name 2008-07-12 06:19:51 --- I can confirm that the patch above solves the problem described.
Tested on debian/lenny, by building from the debian source package wine-1.0.0-1, with the patch applied.
Now I guess this patch just needs to be accepted into wine.
Anastasius, can you submit your patch to something like wine-patches@winehq.org (or did you already)?
I'd do it, but I don't really understand the patch, and I'm not sure it would be accepted without any explanation...
http://bugs.winehq.org/show_bug.cgi?id=14192
--- Comment #5 from Sebastian.Leske@sleske.name 2008-07-12 06:36:41 --- BTW:
Thanks for the incredibly quick fix! It's nice to see free software at its best :-):
http://bugs.winehq.org/show_bug.cgi?id=14192
Michael Karcher wine@mkarcher.dialup.fu-berlin.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rkarcher@frey.de, | |wine@mkarcher.dialup.fu- | |berlin.de
--- Comment #6 from Michael Karcher wine@mkarcher.dialup.fu-berlin.de 2008-08-16 10:10:06 --- Patch (including API tests) submitted, see http://www.winehq.org/pipermail/wine-patches/2008-August/059498.html
http://bugs.winehq.org/show_bug.cgi?id=14192
--- Comment #7 from Michael Karcher wine@mkarcher.dialup.fu-berlin.de 2008-08-20 06:19:52 --- Patch committed: http://source.winehq.org/git/wine.git?a=commit;h=5f2159e806a751aa42fcb549555...
http://bugs.winehq.org/show_bug.cgi?id=14192
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #8 from Austin English austinenglish@gmail.com 2008-08-20 10:20:01 --- Patch was committed.
http://bugs.winehq.org/show_bug.cgi?id=14192
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2008-08-22 10:47:32 --- Closing bugs fixed in 1.1.3.
http://bugs.winehq.org/show_bug.cgi?id=14192
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Fixed by SHA1| |5f2159e806a751aa42fcb549555 | |6484b4aa66242 Component|-unknown |msvcrt