[Bug 43914] 64-bit RPCS3 emulator doesn't start, loader reports ' Invalid address' ( non-relocatable PE wants to use lowest possible image base on NT: 0x10000 / 64 KB)

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Oct 23 04:09:57 CDT 2017


https://bugs.winehq.org/show_bug.cgi?id=43914

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net
           Keywords|                            |win64
          Component|-unknown                    |ntdll
            Summary|RPCS3 emulator doesn't      |64-bit RPCS3 emulator
                   |start : Invalid address     |doesn't start, loader
                   |                            |reports 'Invalid address'
                   |                            |(non-relocatable PE wants
                   |                            |to use lowest possible
                   |                            |image base on NT: 0x10000 /
                   |                            |64 KB)

--- Comment #2 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

confirming.

--- snip ---
$ WINEDEBUG=+tid,+process,+loaddll,+module,+virtual wine64 ./rpcs3.exe
...
002e:trace:process:exec_process starting
L"Z:\\home\\focht\\Downloads\\rpcs3.exe" as Win64 binary ((nil)-(nil), arch
8664)
...
0030:trace:virtual:NtAllocateVirtualMemory 0xffffffffffffffff (nil) 00110000
2000 00000004
0030:trace:virtual:map_view got mem in reserved area 0x10000-0x120000
0030:trace:virtual:VIRTUAL_DumpView View: 0x10000 - 0x11ffff (valloc)
0030:trace:virtual:VIRTUAL_DumpView       0x10000 - 0x11ffff --rw-
0030:trace:virtual:NtAllocateVirtualMemory 0xffffffffffffffff 0x10000 00010000
1000 00000004
0030:trace:virtual:VIRTUAL_DumpView View: 0x10000 - 0x11ffff (valloc)
0030:trace:virtual:VIRTUAL_DumpView       0x10000 - 0x1ffff c-rw-
0030:trace:virtual:VIRTUAL_DumpView       0x20000 - 0x11ffff --rw-
0030:trace:virtual:virtual_create_builtin_view created 0x7bc80000-0x7bdb4000
0030:trace:virtual:VIRTUAL_DumpView View: 0x7bc80000 - 0x7bdb3fff (builtin
image)
0030:trace:virtual:VIRTUAL_DumpView       0x7bc80000 - 0x7bc80fff c-r--
0030:trace:virtual:VIRTUAL_DumpView       0x7bc81000 - 0x7bd94fff c-r-x
0030:trace:virtual:VIRTUAL_DumpView       0x7bd95000 - 0x7bdb3fff c-rw-
0030:trace:module:load_builtin_callback loaded ntdll.dll 0x10360 0x7bc80000
0030:trace:module:load_builtin_dll Trying built-in L"kernel32.dll"
0030:trace:virtual:virtual_create_builtin_view created 0x7b460000-0x7b87a000
0030:trace:virtual:VIRTUAL_DumpView View: 0x7b460000 - 0x7b879fff (builtin
image)
0030:trace:virtual:VIRTUAL_DumpView       0x7b460000 - 0x7b460fff c-r--
0030:trace:virtual:VIRTUAL_DumpView       0x7b461000 - 0x7b6c8fff c-r-x
0030:trace:virtual:VIRTUAL_DumpView       0x7b6c9000 - 0x7b879fff c-rw-
0030:trace:module:load_dll looking for L"ntdll.dll" in L""
0030:trace:module:load_dll Found L"ntdll.dll" for L"ntdll.dll" at 0x7bc80000,
count=2
0030:trace:virtual:NtProtectVirtualMemory 0xffffffffffffffff 0x7b6d3e58
00000820 00000004
0030:trace:virtual:VIRTUAL_DumpView View: 0x7b460000 - 0x7b879fff (builtin
image)
0030:trace:virtual:VIRTUAL_DumpView       0x7b460000 - 0x7b460fff c-r--
0030:trace:virtual:VIRTUAL_DumpView       0x7b461000 - 0x7b6c8fff c-r-x
0030:trace:virtual:VIRTUAL_DumpView       0x7b6c9000 - 0x7b6d2fff c-rw-
0030:trace:virtual:VIRTUAL_DumpView       0x7b6d3000 - 0x7b6d4fff c-rW-
0030:trace:virtual:VIRTUAL_DumpView       0x7b6d5000 - 0x7b879fff c-rw-
0030:trace:virtual:NtProtectVirtualMemory 0xffffffffffffffff 0x7b6d3000
00002000 00000004
0030:trace:virtual:VIRTUAL_DumpView View: 0x7b460000 - 0x7b879fff (builtin
image)
0030:trace:virtual:VIRTUAL_DumpView       0x7b460000 - 0x7b460fff c-r--
0030:trace:virtual:VIRTUAL_DumpView       0x7b461000 - 0x7b6c8fff c-r-x
0030:trace:virtual:VIRTUAL_DumpView       0x7b6c9000 - 0x7b6d2fff c-rw-
0030:trace:virtual:VIRTUAL_DumpView       0x7b6d3000 - 0x7b6d4fff c-rW-
0030:trace:virtual:VIRTUAL_DumpView       0x7b6d5000 - 0x7b879fff c-rw-
0030:trace:module:load_builtin_callback loaded KERNEL32.dll 0x10440 0x7b460000
0030:trace:loaddll:load_builtin_dll Loaded L"KERNEL32.dll" at 0x7b460000:
builtin
0030:trace:module:LdrGetDllHandle L"kernel32" -> 0x7b460000 (load path (null))
0030:trace:virtual:NtAllocateVirtualMemory 0xffffffffffffffff (nil) 00001f44
3000 00000004
0030:trace:virtual:map_view got mem in reserved area 0x120000-0x122000
0030:trace:virtual:VIRTUAL_DumpView View: 0x120000 - 0x121fff (valloc)
0030:trace:virtual:VIRTUAL_DumpView       0x120000 - 0x121fff c-rw-
0030:trace:virtual:NtAllocateVirtualMemory 0xffffffffffffffff (nil) 0000200c
3000 00000004
0030:trace:virtual:map_view got mem in reserved area 0x130000-0x133000
0030:trace:virtual:VIRTUAL_DumpView View: 0x130000 - 0x132fff (valloc)
0030:trace:virtual:VIRTUAL_DumpView       0x130000 - 0x132fff c-rw-
0030:trace:virtual:NtFreeVirtualMemory 0xffffffffffffffff 0x120000 00000000
8000
0030:trace:process:init_current_directory starting in
L"Z:\\home\\focht\\Downloads\\" 0x8
0030:trace:process:__wine_kernel_init starting process
name=L"Z:\\home\\focht\\Downloads\\rpcs3.exe"
argv[0]=L"Z:\\home\\focht\\Downloads\\rpcs3.exe"
0030:trace:module:load_dll looking for L"Z:\\home\\focht\\Downloads\\rpcs3.exe"
in
L"C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem"
0030:trace:module:get_load_order looking for
L"Z:\\home\\focht\\Downloads\\rpcs3.exe"
0030:trace:module:get_load_order got main exe default n,b for
L"Z:\\home\\focht\\Downloads\\rpcs3.exe"
0030:trace:module:load_native_dll Trying native dll
L"Z:\\home\\focht\\Downloads\\rpcs3.exe"
0030:trace:virtual:NtMapViewOfSection handle=0x14 process=0xffffffffffffffff
addr=(nil) off=000000000 size=0 access=20
0030:trace:virtual:map_view got mem in reserved area 0x140000-0x38ff000
0030:trace:module:map_image mapped PE file at 0x140000-0x38ff000
0030:trace:module:map_image mapping section .text at 0x141000 off 400 size
128d800 virt 128d7f3 flags 60000020
0030:trace:module:map_image clearing 0x13ce800 - 0x13cf000
0030:trace:module:map_image mapping section .rdata at 0x13cf000 off 128dc00
size 7b4000 virt 7b3f24 flags 40000040
0030:trace:module:map_image mapping section .data at 0x1b83000 off 1a41c00 size
4d200 virt 1be6a1c flags c0000040
0030:trace:module:map_image clearing 0x1bd0200 - 0x1bd1000
0030:trace:module:map_image mapping section .pdata at 0x376a000 off 1a8ee00
size d0a00 virt d0854 flags 40000040
0030:trace:module:map_image clearing 0x383aa00 - 0x383b000
0030:trace:module:map_image mapping section .tls at 0x383b000 off 1b5f800 size
400 virt 311 flags c0000040
0030:trace:module:map_image clearing 0x383b400 - 0x383c000
0030:trace:module:map_image mapping section .rodata at 0x383c000 off 1b5fc00
size e00 virt c30 flags 40000040
0030:trace:module:map_image clearing 0x383ce00 - 0x383d000
0030:trace:module:map_image mapping section .gfids at 0x383d000 off 1b60a00
size 200 virt 50 flags 40000040
0030:trace:module:map_image clearing 0x383d200 - 0x383e000
0030:trace:module:map_image mapping section _RDATA at 0x383e000 off 1b60c00
size aa00 virt a830 flags 40000040
0030:trace:module:map_image clearing 0x3848a00 - 0x3849000
0030:trace:module:map_image mapping section .rsrc at 0x3849000 off 1b6b600 size
b5200 virt b50e0 flags 40000040
0030:trace:module:map_image clearing 0x38fe200 - 0x38ff000
0030:trace:virtual:VIRTUAL_DumpView View: 0x140000 - 0x38fefff (image)
0030:trace:virtual:VIRTUAL_DumpView       0x140000 - 0x140fff c-r--
0030:trace:virtual:VIRTUAL_DumpView       0x141000 - 0x13cefff c-r-x
0030:trace:virtual:VIRTUAL_DumpView       0x13cf000 - 0x1b82fff c-r--
0030:trace:virtual:VIRTUAL_DumpView       0x1b83000 - 0x3769fff c-rW-
0030:trace:virtual:VIRTUAL_DumpView       0x376a000 - 0x383afff c-r--
0030:trace:virtual:VIRTUAL_DumpView       0x383b000 - 0x383bfff c-rW-
0030:trace:virtual:VIRTUAL_DumpView       0x383c000 - 0x38fefff c-r--
0030:warn:module:perform_relocations Need to relocate module from 0x10000 to
0x140000, but there are no relocation records
0030:warn:module:load_dll Failed to load module
L"Z:\\home\\focht\\Downloads\\rpcs3.exe"; status=c0000018
wine: Invalid address.
0030:trace:module:LdrShutdownProcess ()
--- snip ---

Unfortunately they chose the lowest possible image load base on NT - 64 KB
instead of the default one for x64 which is usually 0x140000000. 

This conflicts with Wine's reserved memory area (vm views) which starts at
0x10000 on x64.

https://github.com/RPCS3/rpcs3/blob/master/rpcs3/rpcs3.vcxproj#L145

--- snip ---
<Link>
 
<AdditionalDependencies>..\hidapi.lib;winmm.lib;OpenAL.lib;XAudio.lib;D3D12GSRender.lib;GLGSRender.lib;shlwapi.lib;VKGSRender.lib;VKstatic.1.lib;glslang.lib;OSDependent.lib;OGLCompiler.lib;SPIRV.lib;HLSL.lib;Advapi32.lib;user32.lib;zlib.lib;..\libpng.lib;asmjit.lib;yaml-cpp.lib;emucore.lib;dxgi.lib;$(QTDIR)\lib\qtmain.lib;shell32.lib;opengl32.lib;$(QTDIR)\lib\Qt5OpenGL.lib;$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5Quick.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5Qml.lib;$(QTDIR)\lib\Qt5Network.lib;$(QTDIR)\lib\Qt5Core.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5WinExtras.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
<AdditionalLibraryDirectories>..\3rdparty\OpenAL\libs\Win64;..\Vulkan\glslang-build\hlsl\Release;..\Vulkan\glslang-build\SPIRV\Release;..\Vulkan\glslang-build\OGLCompilersDLL\Release;..\Vulkan\glslang-build\glslang\OSDependent\Windows\Release;..\Vulkan\Vulkan-build\loader\Release;..\Vulkan\glslang-build\glslang\Release;..\lib\$(CONFIGURATION)-$(PLATFORM);..\3rdparty\minidx12\Lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  <AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32'
name='Microsoft.Windows.Common-Controls' version='6.0.0.0'
publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
%(AdditionalOptions)</AdditionalOptions>
  <DataExecutionPrevention>true</DataExecutionPrevention>
  <GenerateDebugInformation>Debug</GenerateDebugInformation>
  <IgnoreImportLibrary>true</IgnoreImportLibrary>
  <LinkIncremental>false</LinkIncremental>
  <OutputFile>$(OutDir)\rpcs3.exe</OutputFile>
  <RandomizedBaseAddress>false</RandomizedBaseAddress>
  <SubSystem>Windows</SubSystem>
  <SuppressStartupBanner>true</SuppressStartupBanner>
  <BaseAddress>0x10000</BaseAddress>
</Link>
--- snip ---

Linker setting: BaseAddress -> 0x10000

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list