https://bugs.winehq.org/show_bug.cgi?id=43217
Bug ID: 43217 Summary: Wine cannot execute position-independent (PIE) host executables via CreateProcess() Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: osmanx@problemloesungsmaschine.de Distribution: ---
Created attachment 58504 --> https://bugs.winehq.org/attachment.cgi?id=58504 script.sh: Test script to reproduce the problem; test.c: Windows program; hello.c: Host/Linux program
The problem arises from the fact that `create_process_impl()` in `dlls/kernel32/process.c` ultimately calls `MODULE_get_binary_info()` in `dlls/kernel32/module.c` which detects PIE exectuables as ELF shared objects and thus sets `info->type = BINARY_UNIX_LIB;` instead of `info->type = BINARY_UNIX_EXE;`. I do not have enough knowledge about the precise way that Winelib apps are implemented or supposed to work, but the fact that PIE executables are in fact ELF shared objects and not ELF executables according to the ELF header, causes Wine to detect these as Winelib apps and ultimately invoke the wrong process creation path.
The problem especially manifests on the just released Debian 9 Stretch because Debian 9 now uses PIE executables throughout the distribution and these cannot be started any more from within programs running on Wine. Tested with winehq-devel packages 2.10 as well as Debian 9 packaged Wine 1.8.7 and 2.0. Looking at Wine git master, the relevant code paths have not changed at all for quite some time, thus this very likely also applies to all other Wine versions as well. Non-PIE executables work fine.
Test script (script.sh) to reproduce the problem as well as output of the test script attached.
https://bugs.winehq.org/show_bug.cgi?id=43217
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Debian Keywords| |download, source, testcase CC| |austinenglish@gmail.com Version|unspecified |1.8.7
https://bugs.winehq.org/show_bug.cgi?id=43217
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=43217
Jens Reyer jre.winesim@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jre.winesim@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=43217
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |STAGED Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/kernel32-MODUL | |E_get_binary_info CC| |dmitry@baikal.ru, | |erich.e.hoover@wine-staging | |.com, michael@fds-team.de Ever confirmed|0 |1
https://bugs.winehq.org/show_bug.cgi?id=43217
--- Comment #1 from Jörn Heusipp osmanx@problemloesungsmaschine.de --- Created attachment 58572 --> https://bugs.winehq.org/attachment.cgi?id=58572 script.sh: updated test script that also tests that Winelib executables are detected correctly
I can confirm that winehq-staging packages 2.11.0~stretch (2017-06-27) fix the problem. I also verified that Winelib executables are still detected correctly. Updated test script attached in testscript2.tar.
https://bugs.winehq.org/show_bug.cgi?id=43217
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com
--- Comment #2 from Alexandre Julliard julliard@winehq.org --- *** Bug 43628 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=43217
Julian Rüger jr98@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jr98@gmx.net
https://bugs.winehq.org/show_bug.cgi?id=43217
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |luca.cunegondi@ocme.com
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- *** Bug 43821 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=43217
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |21149e63313797a1603ca496a4c | |876418605d495 Resolution|--- |FIXED Status|STAGED |RESOLVED
--- Comment #4 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fixed by http://source.winehq.org/git/wine.git/?a=commit;h=21149e63313797a1603ca496a4...
https://bugs.winehq.org/show_bug.cgi?id=43217
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.0-rc3.
https://bugs.winehq.org/show_bug.cgi?id=43217
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x
https://bugs.winehq.org/show_bug.cgi?id=43217
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |---
--- Comment #6 from Michael Stefaniuc mstefani@winehq.org --- Removing the 2.0.x milestone from bugs included in 2.0.5.