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