http://bugs.winehq.org/show_bug.cgi?id=25014
Summary: Unit test from Google Go crypto/rsa package fails and crashes Product: Wine Version: 1.3.5 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: crypt32 AssignedTo: wine-bugs@winehq.org ReportedBy: fullung@gmail.com
he attached binary is the unit test from Google Go's crypto/rand package.
It passes on Windows Vista.
The same binary fails and crashes under Wine.
WINEARCH=win32 ./8.out.exe
--- FAIL: rsa.TestEncryptPKCS1v15 error encrypting: CryptAcquireContext: error -2146893801 (FormatMessage failed with err=317) --- FAIL: rsa.TestNonZeroRandomBytes returned error: CryptAcquireContext: error -2146893801 (FormatMessage failed with err=317) Zero octet found
Unhandled exception: page fault on read access to 0x00000004 in 32-bit code (0x004125c5). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:004125c5 ESP:0025c010 EBP:0025bffc EFLAGS:00010202( R- -- I - - - ) EAX:00000004 EBX:00254400 ECX:00259b40 EDX:00000000 ESI:00000000 EDI:00000000 Stack dump: 0x0025c010: 00000001 00000002 00406813 00000010 0x0025c020: 00000000 00000001 00000001 00254400 0x0025c030: 0040684f 0025c044 00254400 004159d9 0x0025c040: 002548e0 00000000 00254400 00250830 0x0025c050: 00000000 00000000 002cd180 00000040 0x0025c060: 00000040 00250ee8 00254270 00000040 Backtrace: =>0 0x004125c5 in 8.out (+0x125c5) (0x0025bffc) 1 0x002548e0 (0x00254ef8) 0x004125c5: movl 0x0(%eax),%eax Modules: Module Address Debug info Name (63 modules) PE 400000- 55c000 Export 8.out ELF 20000000-2006a000 Deferred shlwapi<elf> -PE 20010000-2006a000 \ shlwapi ELF 2006a000-201a1000 Deferred libx11.so.6 ELF 201a1000-201bf000 Deferred libxcb.so.1 ELF 201bf000-201e1000 Deferred iphlpapi<elf> -PE 201d0000-201e1000 \ iphlpapi ELF 2434e000-243ca000 Deferred rpcrt4<elf> -PE 24360000-243ca000 \ rpcrt4 ELF 2594e000-25951000 Deferred libxau.so.6 ELF 27294000-272c5000 Deferred ws2_32<elf> -PE 272a0000-272c5000 \ ws2_32 ELF 294ef000-294f7000 Deferred libsm.so.6 ELF 3067a000-3072a000 Deferred winex11<elf> -PE 30690000-3072a000 \ winex11 ELF 35564000-355fb000 Deferred gdi32<elf> -PE 35570000-355fb000 \ gdi32 ELF 3de20000-3de81000 Deferred advapi32<elf> -PE 3de30000-3de81000 \ advapi32 ELF 3f91f000-3f9b1000 Deferred libfreetype.so.6 ELF 3fcc2000-3fde2000 Deferred ole32<elf> -PE 3fce0000-3fde2000 \ ole32 ELF 48d31000-48d36000 Deferred libxxf86vm.so.1 ELF 4b65c000-4b758000 Deferred comctl32<elf> -PE 4b660000-4b758000 \ comctl32 ELF 4c9ac000-4c9ce000 Deferred imm32<elf> -PE 4c9b0000-4c9ce000 \ imm32 ELF 4f350000-4f369000 Deferred version<elf> -PE 4f360000-4f369000 \ version ELF 5004f000-50077000 Deferred libexpat.so.1 ELF 534db000-534e0000 Deferred libuuid.so.1 ELF 5544c000-5546b000 Deferred dnsapi<elf> -PE 55450000-5546b000 \ dnsapi ELF 56313000-5633d000 Deferred netapi32<elf> -PE 56320000-5633d000 \ netapi32 ELF 5b1ee000-5b208000 Deferred libresolv.so.2 ELF 5c0ab000-5c0bc000 Deferred libxext.so.6 ELF 601fe000-60233000 Deferred libfontconfig.so.1 ELF 63de0000-63dfa000 Deferred libice.so.6 ELF 65792000-657c7000 Deferred uxtheme<elf> -PE 657a0000-657c7000 \ uxtheme ELF 66a82000-66a9c000 Deferred wsock32<elf> -PE 66a90000-66a9c000 \ wsock32 ELF 68000000-68022000 Deferred ld-linux.so.2 ELF 68022000-68164000 Deferred libwine.so.1 ELF 68164000-68180000 Deferred libpthread.so.0 ELF 68180000-68313000 Deferred libc.so.6 ELF 68313000-68318000 Deferred libdl.so.2 ELF 68318000-683e0000 Deferred ntdll<elf> -PE 68330000-683e0000 \ ntdll ELF 683e0000-6840a000 Deferred libm.so.6 ELF 6840a000-6858e000 Deferred kernel32<elf> -PE 68420000-6858e000 \ kernel32 ELF 68ded000-68e0a000 Deferred libgcc_s.so.1 ELF 6f5e8000-6f5fc000 Deferred mswsock<elf> -PE 6f5f0000-6f5fc000 \ mswsock ELF 755c6000-755d3000 Deferred libnss_files.so.2 ELF 75647000-75847000 Deferred shell32<elf> -PE 75660000-75847000 \ shell32 ELF 7604e000-76057000 Deferred libxrender.so.1 ELF 76138000-7627e000 Deferred user32<elf> -PE 76150000-7627e000 \ user32 ELF 7bf00000-7bf03000 Deferred <wine-loader> Threads: process tid prio (all id:s are in hex) 00000008 (D) Z:\home\alberts\go\src\pkg\crypto\rsa\8.out.exe 00000009 0 <== 0000000e explorer.exe 0000000f 0 Backtrace: =>0 0x004125c5 in 8.out (+0x125c5) (0x0025bffc) 1 0x002548e0 (0x00254ef8) err:seh:raise_exception Exception frame is not in stack limits => unable to dispatch exception.
http://bugs.winehq.org/show_bug.cgi?id=25014
Albert Strasheim fullung@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fullung@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #1 from Albert Strasheim fullung@gmail.com 2010-11-03 04:27:15 CDT --- Created an attachment (id=31700) --> (http://bugs.winehq.org/attachment.cgi?id=31700) 8.out.exe
http://bugs.winehq.org/show_bug.cgi?id=25014
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #2 from Dan Kegel dank@kegel.com 2010-11-03 05:58:26 CDT --- Sweet. Can you link to the source for this, and to Go's continuous build system?
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #3 from Albert Strasheim fullung@gmail.com 2010-11-03 06:31:33 CDT --- The crypto/rsa code is here:
http://code.google.com/p/go/source/browse/src/pkg/crypto/rsa/
But I don't think that's going to help you directly.
The Windows-specific code in Go is here:
http://code.google.com/p/go/source/browse/src/pkg/syscall http://code.google.com/p/go/source/browse/src/pkg/runtime/windows
You can checkout the whole Go source tree with:
cd $HOME hg clone https://go.googlecode.com/hg/ go
To do a Windows build on Linux (I'm on Fedora 14... F13's mingw-binutils is broken), you need to do:
yum install mingw32-w32api mingw32-binutils mingw32-cpp mingw32-gcc mingw32-runtime wine
export GOROOT=$HOME/go cd $GOROOT wget http://codereview.appspot.com/download/issue2515043_9001.diff hg patch --no-commit issue2515043_9001.diff cd src rm -rf ~/.wine WINEARCH=win32 HOST_AR=i686-pc-mingw32-ar GOHOSTARCH=386 CC=i686-pc-mingw32-gcc GOOS=windows GOARCH=386 MAKEFLAGS=-j1 ./make.bash
This should build the Go Windows binaries into $GOROOT/bin and the Go packages into $GOROOT/pkg.
Now you can do
cd $GOROOT/src/pkg/crypto/rsa WINEARCH=win32 GOHOSTARCH=386 GOOS=windows GOARCH=386 MAKEFLAGS=-j1 make test
This will produce an 8.out.exe, which is the unit test.
The relevant thread on golang-dev:
http://groups.google.com/group/golang-dev/browse_thread/thread/d299bc7c074df...
Let me know if you need any other information.
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #4 from Albert Strasheim fullung@gmail.com 2010-11-03 06:35:32 CDT --- Go binaries for Windows are built here:
http://code.google.com/p/gomingw/
http://bugs.winehq.org/show_bug.cgi?id=25014
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
http://bugs.winehq.org/show_bug.cgi?id=25014
Juan Lang juan_lang@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|crypt32 |-unknown
--- Comment #5 from Juan Lang juan_lang@yahoo.com 2010-11-08 10:33:26 CST --- Please don't paste backtraces. It's unlikely to be in crypt32. Please attach a +crypt log.
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #6 from Juan Lang juan_lang@yahoo.com 2010-11-08 14:55:48 CST --- (In reply to comment #3)
The Windows-specific code in Go is here:
http://code.google.com/p/go/source/browse/src/pkg/syscall http://code.google.com/p/go/source/browse/src/pkg/runtime/windows
That's not all of it. Probably more relevant is: http://code.google.com/p/go/source/browse/src/pkg/crypto/rand/rand_windows.g...
Also, the error code -2146893801 is 0x80090017, NTE_PROV_TYPE_NOT_DEF.
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #7 from Juan Lang juan_lang@yahoo.com 2010-11-08 14:57:05 CST --- Based on the similarity of the errors, and the fact that the Go source implements most of its own crypto, I'd say this is likely to be a dup of 25013. Still, attach +crypt logs.
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #8 from Albert Strasheim fullung@gmail.com 2010-11-08 23:49:37 CST --- (In reply to comment #7)
Based on the similarity of the errors, and the fact that the Go source implements most of its own crypto, I'd say this is likely to be a dup of 25013. Still, attach +crypt logs.
Yes, in retrospect they are probably dups. The binary I attached to 25014 shows the same problem as 25013, and also a crash.
I ran with:
WINEARCH=win32 WINEDEBUG=+crypt ./8.out.exe
The following message is repeated before each test failure and the crash:
trace:crypt:CryptAcquireContextW (0x2545a0, (null), (null), 1, f0000040) trace:crypt:CryptAcquireContextW Did not find registry entry of crypto provider for L"Software\Microsoft\Cryptography\Defaults\Provider Types\Type 001".
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #9 from Juan Lang juan_lang@yahoo.com 2010-11-09 14:57:12 CST --- It passes for me here. The error message that shows up in your +crypt log should only occur if the registry settings are not the default. Are you sure you're running on a clean wineprefix?
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #10 from Juan Lang juan_lang@yahoo.com 2010-11-09 14:59:38 CST --- *** Bug 25013 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #11 from Albert Strasheim fullung@gmail.com 2010-11-15 00:00:30 CST --- (In reply to comment #9)
It passes for me here. The error message that shows up in your +crypt log should only occur if the registry settings are not the default. Are you sure you're running on a clean wineprefix?
Should this do the trick?
$ rpm -q wine wine-1.3.5-1.fc14.x86_64
$ rm -rf ~/.wine ; WINEARCH=win32 WINEDEBUG=+crypt ./8.out.exe
http://bugs.winehq.org/show_bug.cgi?id=25014
Juan Lang juan_lang@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |juan_lang@yahoo.com
--- Comment #12 from Juan Lang juan_lang@yahoo.com 2010-11-15 18:09:46 CST --- I still can't reproduce. Check your registry to make sure that the key "HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types\Type 001" exists.
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #13 from Albert Strasheim fullung@gmail.com 2010-11-15 22:50:48 CST --- (In reply to comment #12)
I still can't reproduce. Check your registry to make sure that the key "HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider Types\Type 001" exists.
Hello
If I start without a .wine directory, who/what is supposed to create that key?
Regards
Albert
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #14 from Juan Lang juan_lang@yahoo.com 2010-11-15 23:09:40 CST --- (In reply to comment #13)
If I start without a .wine directory, who/what is supposed to create that key?
It's created automatically during wine's prefix creation.
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #15 from butraxz@gmail.com 2013-06-15 05:35:02 CDT --- This has not been updated for over 900 days.
Is this still an issue in 1.6-rc2 or higher or is this abandoned ?
http://bugs.winehq.org/show_bug.cgi?id=25014
--- Comment #16 from Dan Kegel dank@kegel.com 2013-06-15 09:27:39 CDT --- It passes for me, too. INVALID?
https://bugs.winehq.org/show_bug.cgi?id=25014
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WORKSFORME
--- Comment #17 from Bruno Jesus 00cpxxx@gmail.com --- Bug was not reproducible and a long time has passed without new messages, resolving worksforme.
https://bugs.winehq.org/show_bug.cgi?id=25014
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #18 from Austin English austinenglish@gmail.com --- Closing.