https://bugs.winehq.org/show_bug.cgi?id=49499
Bug ID: 49499 Summary: Ubuntu focal 5.11 packages translate unix working directory incorrectly when running dealer.exe (bridge utility) Product: Packaging Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: trivial Priority: P2 Component: wine-packages Assignee: wine-bugs@winehq.org Reporter: suokkos@gmail.com CC: dimesio@earthlink.net Distribution: ---
wine-devel and wine-staging 5.11~focal packages caused a regression where running dealer.exe from terminal forwards incorrect working directory to dealer.exe. dealer.exe is a small command line utility to generate constrained hands for card game bridge.
The bug isn't present on wine binary if I compile wine-5.11 tagged version. Neither it is present if I apply wine-staging patches to my wine tree and compile it.
Downgrading 5.10~focal also works.
What is known about bug happening? I'm running the application from a directory under my home directory. Wine maps Z: drive to root ("/"). There is no other drives mapping to my home directory. Package versions change working directory to root ("/").
dealer.exe enters application using wmain entry which translate wchar arguments to multibyte handled by argument parser. After argument parsing it tries to use freopen to redirect stdin to be read from the filename passed as argument.
I have no idea why wine 5.11 compiled from sources behaves differently to the package version. I tried to look into https://dl.winehq.org/wine-builds/ubuntu/dists/focal/main/source/wine-stagin... but failed to spot a difference.
I tried to find wine built in command which would replicated same incorrect working tree behavior. I failed to find any other application which would reproduce the wrong working directory when run from same terminal.
Step to reproduce: Dependencies: cmake and mingw cross compiler 1. git clone https://github.com/suokko/dealer.git 2. cd dealer 3. echo "set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSROOT $ENV{HOME}/buildd/win64) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(arch x86_64-w64-mingw32) find_program(WINE_COMMAND wine) set(CMAKE_CROSSCOMPILING ${WINE_COMMAND}) set(CMAKE_RC_COMPILER ${arch}-windres) set(CMAKE_C_COMPILER ${arch}-gcc-posix) set(CMAKE_CXX_COMPILER ${arch}-g++-posix)" > win32.cmake 4. mkdir build && cd build 5. cmake -CMAKE_TOOLCHAIN_FILE=../win32.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. 6. export WINEPATH="/usr/x86_64-w64-mingw32/lib;/usr/lib/gcc/x86_64-w64-mingw32/9.3-posix;$(pwd)/dds-install/bin" 7. make 8. cd ../Examples 9. wine ../build/dealer.exe Descr.test_operators
Failed output: Descr.test_operators: No such file or directory
Expected output: 1 != 0: 1 5 - 2: 3 5 % 3: 2 5 == 3: 0 Frequency rnd(10): 0 10034 1 10122 2 9974 3 10003 4 9884 5 9977 6 9853 7 10036 8 10142 9 9975 Frequency : Low 100000 Frequency : High 100000 Generated 100000 hands Produced 100000 hands Initial random seed 1593633569 Time needed 0.000 sec
https://bugs.winehq.org/show_bug.cgi?id=49499
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE
--- Comment #1 from Alexandre Julliard julliard@winehq.org --- Most likely duplicate.
*** This bug has been marked as a duplicate of bug 49425 ***
https://bugs.winehq.org/show_bug.cgi?id=49499
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Gijs Vermeulen gijsvrm@gmail.com --- Closing duplicate.