[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[pkg-wine-party] Bug#865407: marked as done (wine-development: Wine cannot execute position-independent (PIE) host executables via CreateProcess())



Your message dated Tue, 16 Jan 2018 19:34:33 +0000
with message-id <E1ebX0D-000E1D-UY@fasolo.debian.org>
and subject line Bug#865407: fixed in wine-development 3.0~rc3-1
has caused the Debian Bug report #865407,
regarding wine-development: Wine cannot execute position-independent (PIE) host executables via CreateProcess()
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
865407: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865407
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: wine-development
Version: 2.0-3
Severity: normal
Tags: upstream

Dear Maintainer,


Wine cannot execute position-independent (PIE) host executables via CreateProcess()

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.

As Debian 9 Stretch switched to PIE by default, this basically affects
all native executables. Non-PIE executables work fine.

Wine 1.8.7 is also affected, as is the current Wine development branch.

Upstream bug report is at https://bugs.winehq.org/show_bug.cgi?id=43217 .

```
manx@vmdebian9:~/test$ ./script.sh 
+ cat script.sh
#!/usr/bin/env bash
set -x
cat script.sh
cat hello.c
cat test.c
x86_64-w64-mingw32-gcc -mconsole -std=c99 -O2 -Wall -Wextra test.c -o test.exe
gcc -no-pie -fno-PIE -std=c99 -O2 -Wall -Wextra hello.c -o hello
file hello
wine64-development test.exe
WINEDEBUG=trace+process wine64-development test.exe
gcc -pie -fPIE -std=c99 -O2 -Wall -Wextra hello.c -o hello
file hello
wine64-development test.exe
WINEDEBUG=trace+process wine64-development test.exe
uname -m
cat /etc/debian_version
gcc -dumpversion
wine64-development --version

+ cat hello.c
#include <stdio.h>
int main() {
    fprintf(stderr, "%s\n", "Hello World!");
    return 0;
}
+ cat test.c
#include <stdio.h>
#include <string.h>
#include <windows.h>
int main() {
	STARTUPINFO startupInfo;
	ZeroMemory(&startupInfo, sizeof(STARTUPINFO));
	startupInfo.lpTitle = "dummy";
	startupInfo.cb = sizeof(startupInfo);
	PROCESS_INFORMATION processInformation;
	ZeroMemory(&processInformation, sizeof(PROCESS_INFORMATION));
	if(CreateProcess(NULL, "./hello", NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &startupInfo, &processInformation) == FALSE) {
		fprintf(stderr, "CreateProcess() failed\n");
		return 1;
	}
	WaitForSingleObject(processInformation.hProcess, INFINITE);
	CloseHandle(processInformation.hThread);
	CloseHandle(processInformation.hProcess);
	return 0;
}

+ x86_64-w64-mingw32-gcc -mconsole -std=c99 -O2 -Wall -Wextra test.c -o test.exe
+ gcc -no-pie -fno-PIE -std=c99 -O2 -Wall -Wextra hello.c -o hello
+ file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=db69604025be8ad94f0f8d80e9c60eff185a8b07, not stripped
+ wine64-development test.exe
Hello World!
+ WINEDEBUG=trace+process
+ wine64-development test.exe
trace:process:init_current_directory starting in L"Z:\\home\\manx\\test\\" 0x8
trace:process:__wine_kernel_init starting process name=L"Z:\\home\\manx\\test\\test.exe" argv[0]=L"Z:\\home\\manx\\test\\test.exe"
trace:process:create_process_impl app (null) cmdline L"./hello"
trace:process:find_exe_file looking for L"./hello"
trace:process:find_exe_file Trying native exe L"Z:\\home\\manx\\test\\hello"
trace:process:create_process_impl starting L"Z:\\home\\manx\\test\\hello" as Unix binary
trace:process:create_process_impl started process pid 0000 tid 0000
Hello World!
+ gcc -pie -fPIE -std=c99 -O2 -Wall -Wextra hello.c -o hello
+ file hello
hello: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=e002ea7db0a5e5223085e78d97a6f25f61160958, not stripped
+ wine64-development test.exe
wine: Bad EXE format for Z:\home\manx\test\hello..
CreateProcess() failed
+ WINEDEBUG=trace+process
+ wine64-development test.exe
trace:process:init_current_directory starting in L"Z:\\home\\manx\\test\\" 0x8
trace:process:__wine_kernel_init starting process name=L"Z:\\home\\manx\\test\\test.exe" argv[0]=L"Z:\\home\\manx\\test\\test.exe"
trace:process:create_process_impl app (null) cmdline L"./hello"
trace:process:find_exe_file looking for L"./hello"
trace:process:find_exe_file Trying native exe L"Z:\\home\\manx\\test\\hello"
trace:process:create_process_impl starting L"Z:\\home\\manx\\test\\hello" as 64-bit Winelib app
trace:process:init_current_directory starting in L"Z:\\home\\manx\\test\\" 0xc
trace:process:__wine_kernel_init starting process name=L"Z:\\home\\manx\\test\\hello." argv[0]=L"./hello"
wine: Bad EXE format for Z:\home\manx\test\hello..
CreateProcess() failed
+ uname -m
x86_64
+ cat /etc/debian_version
9.0
+ gcc -dumpversion
6.3.0
+ wine64-development --version
wine-2.0 (Debian 2.0-3+b2)
manx@vmdebian9:~/test$ 
```


-- Package-specific info:
/usr/bin/wine points to /usr/bin/wine-stable.

-- System Information:
Debian Release: 9.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages wine-development depends on:
ii  wine32-development  2.0-3+b2
ii  wine64-development  2.0-3+b2

wine-development recommends no packages.

Versions of packages wine-development suggests:
pn  dosbox       <none>
pn  playonlinux  <none>
pn  winbind      <none>
ii  wine-binfmt  1.8.7-2
ii  winetricks   0.0+20170101-1

Versions of packages wine-development is related to:
ii  fonts-wine          1.8.7-2
ii  wine-development    2.0-3
ii  wine32-development  2.0-3+b2
ii  wine64-development  2.0-3+b2

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: wine-development
Source-Version: 3.0~rc3-1

We believe that the bug you reported is fixed in the latest version of
wine-development, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 865407@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jens Reyer <jre.winesim@gmail.com> (supplier of updated wine-development package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 16 Jan 2018 14:28:55 +0100
Source: wine-development
Binary: wine-development wine32-development wine64-development wine32-development-preloader wine64-development-preloader wine32-development-tools wine64-development-tools libwine-development libwine-development-dev
Architecture: source
Version: 3.0~rc3-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Wine Party <pkg-wine-party@lists.alioth.debian.org>
Changed-By: Jens Reyer <jre.winesim@gmail.com>
Description:
 libwine-development - Windows API implementation - library
 libwine-development-dev - Windows API implementation - development files
 wine-development - Windows API implementation - standard suite
 wine32-development - Windows API implementation - 32-bit binary loader
 wine32-development-preloader - Windows API implementation - prelinked 32-bit binary loader
 wine32-development-tools - Windows API implementation - 32-bit developer tools
 wine64-development - Windows API implementation - 64-bit binary loader
 wine64-development-preloader - Windows API implementation - prelinked 64-bit binary loader
 wine64-development-tools - Windows API implementation - 64-bit developer tools
Closes: 865407
Changes:
 wine-development (3.0~rc3-1) unstable; urgency=medium
 .
   * New upstream release 3.0-rc3, released Dec 22, 2017.
     - Bug fixes only, we are in code freeze.
     - Fixes building on armel again.
     - Fixes executing position-independent (PIE) host executables
       (closes: #865407).
   * Restrict v4l support to linux and kfreebsd architectures.
   * Restrict capi support to linux architectures.
   * Refresh patches.
Checksums-Sha1:
 c394f47eaa0f6580d6181a4398c2c73b1a9603bb 4016 wine-development_3.0~rc3-1.dsc
 c1c54bcbd893f71e783e49886345f33684aa05a1 19758304 wine-development_3.0~rc3.orig.tar.xz
 e94a9abb02598364da393edf22e26c1bc761de03 180456 wine-development_3.0~rc3-1.debian.tar.xz
 e461b2fd5ff896ff7e00a0321f25b01b7d03eb19 17822 wine-development_3.0~rc3-1_all.buildinfo
Checksums-Sha256:
 1323a59644fd5a6407473ff5c40e6f7382bf55517a606add59559b7defd6e450 4016 wine-development_3.0~rc3-1.dsc
 07417fde9d842f2a43ecae932cf2d901214d6763689928f442132fc4fefcd642 19758304 wine-development_3.0~rc3.orig.tar.xz
 2325292cc130f4edf3025f3b42f8c75941d3d374541250c89d9a2b923f54126c 180456 wine-development_3.0~rc3-1.debian.tar.xz
 e7904f091d1251bc269739e4e8cea575e35ffd5e400412e991a934ba6817d5f8 17822 wine-development_3.0~rc3-1_all.buildinfo
Files:
 cdd5f26fe9ff8f06a0798dd7d1f62145 4016 otherosfs optional wine-development_3.0~rc3-1.dsc
 2752e93c3e774c14c9a7e0262b17d78f 19758304 otherosfs optional wine-development_3.0~rc3.orig.tar.xz
 915820acaa6fd732118b8953c2c467ad 180456 otherosfs optional wine-development_3.0~rc3-1.debian.tar.xz
 e18f1085aed23ec950b2884ab901f237 17822 otherosfs optional wine-development_3.0~rc3-1_all.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEo+4EaAPA6D5jhqo9YIQSAytXMHYFAlpeTXYACgkQYIQSAytX
MHamvBAAuTXAO6VQYpcvHNnFevrEIv1EexGQSnS3qfJok7D0Jn8KC6AlyIXLwUDI
34q8LKwmKNnTs/lotoraqULWAI/+6oVzI5bIT2lFNIJxuBWziS/4bv7OQhxJfGF5
dmFoCoYGOpGasajWg+1qkKonJs9fHFtyYtafloXoHQI9HCnDuhFVpBwB7yEo3HOC
gnpUv5N5wLQzpZ2oueChdYQMYmml2PtmZb1zKoFoawojzWv80k7a+IvakrPJ80oK
GTbdEuMQ7eE/+KxyghRKdEraW6QyPdS2SVqYnpjCA18qsC0Ec5SPf45pQoOlS9aK
HN7MVtyp/QVKUB8Yk/8yVmZLU2oeURxTcK13MEH8ohT7g7lT+eLl3/dIdJymHkAe
5zoNDzDPq0Sc2ivMj/JP68EOyLlcFDh1lJzFOpQYYkVBmAC9g93Cz0sIeJd4/tge
8GLLx2BCTsgBfaGY3IsKpiCfbhoqVFK7pRMuRy0fLp0pCRsYbLILEfmrlDzHElRT
lz/E9EMW27UUNHxxEI3hTV7ncLGuzbwk/gjT2a9Btw9VcbcVB4n1DKdlI94Ck1pU
+ep0fHpxp+UCp2x0PAOM5QSMLw5TWguh+RiBwwW7HYd3NncjuPUp2GqmsxP6QYha
KmaV41GN8NlcuNtEFTiTLi2uDPrwV6Ut77OZYUPKzlZvaiSZ1LM=
=MdUQ
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: