http://bugs.winehq.org/show_bug.cgi?id=30297
Bug #: 30297 Summary: Sikuil IDE doesn't start up Product: Wine Version: 1.5.0 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: fracting@gmail.com Classification: Unclassified
wine-1.5.0-147-g4c6a198
1. Download jre-6u31-windows-i586-s.exe :
http://java.com/en/download/manual.jsp
2. Download portable version of Sikuli:
https://launchpadlibrarian.net/79944128/Sikuli-X-1.0rc3%20%28r905%29-win32.z...
3. Install jre
4. Start Sikuli:
$ wine Sikuli-IDE.exe fixme:win:EnumDisplayDevicesW ((null),0,0x37ddd04,0x00000000), stub! fixme:win:EnumDisplayDevicesW ((null),1,0x37ddd04,0x00000000), stub! fixme:win:EnumDisplayDevicesW ((null),0,0x37ddaa0,0x00000000), stub! fixme:font:freetype_SelectFont Untranslated charset 255 [info] locale: en_US
The IDE doesn't start, only print above message.
wine start Sikuli-IDE.bat fixme:exec:SHELL_execute flags ignored: 0x00000100
Also doesn't work.
However, wine Sikuli-IDE.exe -h works:
$ wine Sikuli-IDE.exe -h fracting@fracting-redhat:~/Wine/sikuli/Sikuli-X-1.0rc3 (r905)-win32/Sikuli-IDE$ fixme:win:EnumDisplayDevicesW ((null),0,0x37ddd04,0x00000000), stub! fixme:win:EnumDisplayDevicesW ((null),1,0x37ddd04,0x00000000), stub! fixme:win:EnumDisplayDevicesW ((null),0,0x37ddaa0,0x00000000), stub! usage: Sikuli-IDE [--args <arguments>] [-h] [-r <sikuli-file>] [-s] [-t <sikuli-test-case>] --args <arguments> specify the arguments passed to Jython's sys.argv -h,--help print this help message -r,--run <sikuli-file> run .sikuli or .skl file -s,--stderr print runtime errors to stderr instead of popping up a message box -t,--test <sikuli-test-case> run .sikuli as a unit test case with junit's text UI runner
Also, the -r arguments work as well
http://bugs.winehq.org/show_bug.cgi?id=30297
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source URL| |https://launchpadlibrarian. | |net/79944128/Sikuli-X-1.0rc | |3%20%28r905%29-win32.zip
http://bugs.winehq.org/show_bug.cgi?id=30297
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Sikuil IDE doesn't start up |Sikuli IDE doesn't start up
http://bugs.winehq.org/show_bug.cgi?id=30297
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |focht@gmx.net Resolution| |FIXED
--- Comment #1 from Anastasius Focht focht@gmx.net 2013-10-03 11:13:28 CDT --- Hello folks,
the IDE starts for me. Marking fixed.
$ du -sh "Sikuli-X-1.0rc3 (r905)-win32.zip" 19M Sikuli-X-1.0rc3 (r905)-win32.zip
$ sha1sum "Sikuli-X-1.0rc3 (r905)-win32.zip" c269b1978db8f4fb93807dee76d30db6501c90df Sikuli-X-1.0rc3 (r905)-win32.zip
$ wine --version wine-1.7.3-187-gec28040
Regards
http://bugs.winehq.org/show_bug.cgi?id=30297
--- Comment #2 from Qian Hong fracting@gmail.com 2013-10-03 12:05:16 CDT --- (In reply to comment #1)
Hello folks,
Dear Focht, could you share how do you start the IDE? By running the bat or exe? What jre did you install? Are you on a 64 bit Wine or 32 bit?
I just tested again on 32bit Wine, same Sikuli with you, and with the below jre:
sha1sum a2c26b5dfaa9f444443d36494a85ac5902de0456 jre-6u31-windows-i586-s.exe
I tested Sikuli-IDE.bat, Sikuli-IDE-w.bat and Sikuli-IDE.exe, non of them work for me.
relay log show this line before detach dlls:
003e:Call PE DLL (proc=0x4761000,module=0x4760000 L"JIntellitype.dll",reason=PROCESS_ATTACH,res=(nil)) 003e:exception in PE entry point (proc=0x4761000,module=0x4760000,reason=PROCESS_ATTACH,res=(nil)) 003e:Ret PE DLL (proc=0x4761000,module=0x4760000 L"JIntellitype.dll",reason=PROCESS_ATTACH,res=(nil)) retval=0
Thanks for testing!
http://bugs.winehq.org/show_bug.cgi?id=30297
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Component|-unknown |ntdll Resolution|FIXED | Summary|Sikuli IDE doesn't start up |Sikuli IDE doesn't start up | |(incorrect calculation of | |negative PE relocation | |delta) Ever Confirmed|0 |1
--- Comment #3 from Anastasius Focht focht@gmx.net 2013-10-03 14:58:04 CDT --- Hello Qian,
looks like I had it working by chance while investigating various JRE related bugs. I tested multiple JavaSE JRE versions/installers, maybe there was a "golden" one.
Now I get the same thing on clean 32-bit WINEPREFIX with the JRE version you use, the app exits without showing the GUI.
The problem is indeed 'JIntellitype.dll'. There is an exception in dll entry point and it looks like the relocation fixups are wrong.
'JIntellitype.dll' is extracted from 'sikuli-script.jar' at runtime and written to temp folder. The runtime modifies the dll PE header at offset 0xD0 (image size) from 0x00010848 to 0x00011000. The real problem seems to be the default load base address of 0x64E80000 present in PE header. Wine always relocates the dll to a lower address range. Unfortunately the negative relocation delta is not correctly calculated leading to wrong fixups.
Source here: http://source.winehq.org/git/wine.git/blob/5c0b5f4dcb60d2c7341cfb1ba3d586e30...
--- snip --- ... TRACE_(module)( "relocating from %p-%p to %p-%p\n", base, base + total_size, ptr, ptr + total_size );
relocs = &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC]; rel = (IMAGE_BASE_RELOCATION *)(ptr + relocs->VirtualAddress); end = (IMAGE_BASE_RELOCATION *)(ptr + relocs->VirtualAddress + relocs->Size); delta = ptr - base;
while (rel < end - 1 && rel->SizeOfBlock) { if (rel->VirtualAddress >= total_size) { WARN_(module)( "invalid address %p in relocation %p\n", ptr + rel->VirtualAddress, rel ); status = STATUS_ACCESS_VIOLATION; goto error; } rel = LdrProcessRelocationBlock( ptr + rel->VirtualAddress, (rel->SizeOfBlock - sizeof(*rel)) / sizeof(USHORT), (USHORT *)(rel + 1), delta ); if (!rel) goto error; } ... --- snip ---
Regards
http://bugs.winehq.org/show_bug.cgi?id=30297
--- Comment #4 from Anastasius Focht focht@gmx.net 2013-10-03 15:06:05 CDT --- Hello folks,
the following trace shows the incorrect delta:
--- snip --- ... 0042:trace:module:load_native_dll Trying native dll L"C:\users\focht\Temp\JIntellitype.dll" 0042:trace:virtual:NtMapViewOfSection handle=0x330 process=0xffffffff addr=(nil) off=000000000 size=0 access=20 0042:trace:virtual:map_view got mem in reserved area 0x4560000-0x4571000 0042:trace:virtual:VIRTUAL_DumpView View: 0x4560000 - 0x4570fff (anonymous) 0042:trace:virtual:VIRTUAL_DumpView 0x4560000 - 0x4570fff c-rWx 0042:trace:module:map_image mapped PE file at 0x4560000-0x4571000 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x4560000-0x45603ff 0042:trace:module:map_image mapping section .text at 0x4561000 off 400 size 4e00 virt 4d74 flags 60000060 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x4561000-0x4565dff 0042:trace:module:map_image clearing 0x4565e00 - 0x4566000 0042:trace:module:map_image mapping section .data at 0x4566000 off 5200 size 200 virt 40 flags c0000040 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x4566000-0x45661ff 0042:trace:module:map_image clearing 0x4566200 - 0x4567000 0042:trace:module:map_image mapping section .rdata at 0x4567000 off 5400 size 600 virt 58c flags 40000040 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x4567000-0x45675ff 0042:trace:module:map_image clearing 0x4567600 - 0x4568000 0042:trace:module:map_image mapping section .bss at 0x4568000 off 0 size 0 virt 4140 flags c0000080 0042:trace:module:map_image mapping section .edata at 0x456d000 off 5a00 size 600 virt 47d flags 40000040 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x456d000-0x456d5ff 0042:trace:module:map_image clearing 0x456d600 - 0x456e000 0042:trace:module:map_image mapping section .idata at 0x456e000 off 6000 size 800 virt 624 flags c0000040 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x456e000-0x456e7ff 0042:trace:module:map_image clearing 0x456e800 - 0x456f000 0042:trace:module:map_image mapping section .rsrc at 0x456f000 off 6800 size 400 virt 3bc flags c0000040 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x456f000-0x456f3ff 0042:trace:module:map_image clearing 0x456f400 - 0x4570000 0042:trace:module:map_image mapping section .reloc at 0x4570000 off 6c00 size a00 virt 848 flags 42000040 0042:trace:virtual:map_file_into_view forcing exec permission on mapping 0x4570000-0x45709ff 0042:trace:module:map_image clearing 0x4570a00 - 0x4571000 0042:trace:module:map_image relocating from 0x64e80000-0x64e91000 to 0x4560000-0x4571000 0042:trace:module:LdrProcessRelocationBlock type=3, va=0x4561043, delta=0x9f6e0000 0042:trace:module:LdrProcessRelocationBlock type=3, va=0x456104d, delta=0x9f6e0000 0042:trace:module:LdrProcessRelocationBlock type=3, va=0x4561071, delta=0x9f6e0000 ... --- snip ---
I added a trace to LdrProcessRelocationBlock().
Type 3 -> IMAGE_REL_BASED_HIGHLOW
Regards
http://bugs.winehq.org/show_bug.cgi?id=30297
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2013-10-03 17:41:43 CDT --- The delta is correct, the problem is the duplicate relocation blocks.
http://bugs.winehq.org/show_bug.cgi?id=30297
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Sikuli IDE doesn't start up |Sikuli IDE doesn't start up |(incorrect calculation of |(JIntellitype.dll has |negative PE relocation |duplicate PE relocation |delta) |blocks)
--- Comment #6 from Anastasius Focht focht@gmx.net 2013-10-03 18:14:19 CDT --- Hello Alexandre,
you're right, I didn't look far enough - only at the first relocation block...
Regards
http://bugs.winehq.org/show_bug.cgi?id=30297
--- Comment #7 from Anastasius Focht focht@gmx.net 2013-10-03 18:17:25 CDT --- Created attachment 46183 --> http://bugs.winehq.org/attachment.cgi?id=46183 Dump of JIntellitype.dll relocation blocks using LordPE tool (showing duplicates)
At block 8 it starts repeating ...
http://bugs.winehq.org/show_bug.cgi?id=30297
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #46183|0 |1 is obsolete| |
--- Comment #8 from Anastasius Focht focht@gmx.net 2013-10-03 18:19:37 CDT --- Created attachment 46184 --> http://bugs.winehq.org/attachment.cgi?id=46184 Dump of JIntellitype.dll relocation blocks using LordPE tool (showing duplicates)
Now the correct one ...
http://bugs.winehq.org/show_bug.cgi?id=30297
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |INVALID
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2013-11-22 04:25:14 CST --- The dll is broken, it fails to load the same way on Windows when it's relocated.
You can probably play with WINEPRELOADRESERVE to keep address 0x64E80000 available.
http://bugs.winehq.org/show_bug.cgi?id=30297
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Austin English austinenglish@gmail.com 2013-11-26 14:56:41 CST --- Closing.