libwinpthread-1.dll not found during depends build (bdb) on Windows Subsystem for Linux #18348

issue billygarrison opened this issue on March 13, 2020
  1. billygarrison commented at 10:48 PM on March 13, 2020: contributor

    Expected behavior I should be able to make the depends without an error.

    Actual behavior The program extracts BDB, preprocesses BDB, and configures BDB (I think), then goes into a long list of "checking" lines (e.g. checking for fopen... yes).

    The output shows checking for clock_gettime monotonic clock... then the error message below pops up (The code execution cannot proceed because libwinpthread-1.dll was not found. Reinstalling the program may fix this problem.)

    image

    I click okay and it outputs no for checking for clock_gettime monotonic clock.... The program continues running the checks and seems to finish building the depends normally. I can then do the following:

    cd ..
    ./autogen.sh
    CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
    make
    

    And it builds without error.

    To reproduce I get the error every time I run it on my system.

    1. Clone repository to WSL /home/billy/bitcoin
    2. Follow steps at https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md "Cross-compilation for Ubuntu and Windows Subsystem for Linux" and "Building for 64-bit Windows" up to and including make HOST=x86_64-w64-mingw32
    3. Let it run until the error message (screenshot above) pops up

    System information

    Other information Similar issue here: #17277

    Here's a copy of the full output from making the depends: https://gist.githubusercontent.com/billygarrison/c548ea99d3b498065c3dc1438d1561c7/raw/64359504e6bf5639396c9aa2313e73a1b0dd2ce8/out.log

    And here's a subset of that with showing just the bdb output (line 283 is where it hangs until I click OK on the error popup): https://gist.github.com/billygarrison/ebaad2b2f93c8e89281e7a1d2ce9d88b

    EDIT: Removed mention of make check test failing as it is not supported in WSL.

    EDIT 2: This issue only occurs if I use make HOST=x86_64-w64-mingw32, if I use it with sudo make HOST=x86_64-w64-mingw32 then it builds fine, and the output includes checking for clock_gettime monotonic clock... yes instead of no.

  2. billygarrison added the label Bug on Mar 13, 2020
  3. brakmic commented at 12:38 PM on March 19, 2020: contributor

    Hi @billygarrison ,

    I just cloned, configured and compiled successfully a Windows Bitcoin-Qt binary.

    My setup is:

    • Windows 10 Pro, 1909, Build 18363.719
    • WSL with Linux 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
    • Intel CPU i7
    • Fresh Bitcoin clone

    Before having started building the binaries I executed the usual

    sudo apt update
    sudo apt upgrade -y
    

    to update my Ubuntu.

    I did neither encounter problems with make in depends-directory nor later when building Bitcoin itself.

    Here the About window of my local build:

    build_bitcoin

    Now I have one "stupid" question: did you also set the compiler for Ubuntu 18.04 as stated here?:

    sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
    

    I actually assume you did, because you wrote you were following the Bitcoin Windows Compilation docs.

    Regards,

  4. billygarrison commented at 7:40 PM on March 19, 2020: contributor

    Thanks for looking into this @brakmic - yes, I did do that step as well as the rest in build-windows.md

    I'm also using Linux DESKTOP-LLRVDLC 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux, a fresh install of that as well as a fresh clone of the bitcoin repo.

    I've run other installations through a different WSL install on this machine. I wonder if some kind of system setting or config was changed in the process that is somehow also accessed by my new WSL

  5. billygarrison commented at 1:15 PM on June 20, 2020: contributor

    Update on this issue:

    I rebuilt again and did not get this error. I'm not sure what has changed since I opened this issue. Perhaps the issue was fixed by a recent commit. The only thing I can think that has changed on my end is I built it in /src/bitcoin/depends this time instead of /home/billy/bitcoin/depends. I had to use sudo make, which could be why it worked without error.

    I will try building the depends in /home/billy/bitcoin/depends again, with and without sudo, to see if the error occurs.

  6. billygarrison commented at 1:28 AM on June 21, 2020: contributor

    This issue only occurs if I use make HOST=x86_64-w64-mingw32, if I use it with sudo make HOST=x86_64-w64-mingw32 then it builds fine, and the output includes checking for clock_gettime monotonic clock... yes instead of no

  7. sipsorcery commented at 9:04 PM on June 23, 2020: member

    @billygarrison there's almost no chance a recent commit changed anything to do with the build of the BerkeleyDB dependency. Much more likely is something with the WSL config changed.

    I've attempted to replicate this issue again (previously tried unsuccessfully with #17277).

    Would you be able to test with a fresh install of Ubuntu 20.04 from the Microsoft Store? I did a fresh install and ran the steps below and did not experience the problem.

    cd ~
    sudo apt update
    sudo apt upgrade
    sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git g++-mingw-w64-x86-64
    sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
    mkdir src
    git clone https://github.com/bitcoin/bitcoin.git
    cd bitcoin
    PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')
    cd depends
    make HOST=x86_64-w64-mingw32 bdb_configured
    
  8. fanquake deleted a comment on Jun 23, 2020
  9. billygarrison commented at 12:00 AM on June 27, 2020: contributor

    Thanks for the suggestion @sipsorcery, unfortunately the error still occurs. The only deviation I took from your instructions was that I did cd src after mkdir src.

    In case you missed it, I don't think it suddenly working for me has anything to do with an update to BDB/Bitcoin/WSL. It works when I do sudo make HOST=x86_64-w64-mingw32 (which I hadn't tried when originally posting this issue)

  10. sipsorcery commented at 3:19 PM on June 27, 2020: member

    @billygarrison yes I saw it works when using sudo. Also the last update the bdb dependency package was 9 months ago. It's almost certain that the need to use sudo is something to do with the Windows and/or WSL version and/or configuration.

    I'd like to track it down as a matter of interest but given I can't reproduce the problem I need a guinea pig to run the tests. If you don't want to be that guinea pig, no problems.

    If you are happy to do another test could you strace the bdb configure step on one of your WSL installs:

    PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')
    cd ~/src/bitcoin/depends
    make clean
    strace make HOST=x86_64-w64-mingw32 bdb_configured
    

    In the strace log I'm interested to see what's attempting to execute conftest.exe. In my strace log there are no messages relating to conftest.exe or any other .exe file.

  11. billygarrison commented at 4:20 PM on June 27, 2020: contributor

    @sipsorcery I am happy to run as many tests as necessary. Thanks for taking this on. I will be able to run the latest in a couple hours.

    When I originally tried your instructions, it didn't work using bdb_configured. I can post the results in a bit, but the depends didn't build at all. What does that option do?

  12. billygarrison commented at 4:50 PM on June 27, 2020: contributor

    @sipsorcery Not sure if related, but make clean gave me a permissions error. sudo make clean worked.

    Have you read through #17277? They have narrowed the problem to a few possible fixes (that I didn't understand or wasn't able to implement by myself)

    The log from using strace didn't turn up anything containing "conftest" either

  13. sipsorcery commented at 5:20 PM on June 27, 2020: member

    Yes I've followed #17277 but the only real fix is to use sudo which we don't want to recommend unless we know the reason why.

    With a fresh install of the WSL Ubuntu 20.04 app we should both have the exact same environment. I'm going to remove my 20.04 instance, reinstall and set the WSL version to 1 and see if that makes any difference.

    What do you get if you execute sudo find / -path /mnt -prune -o -name libwinpthread-1.dll?

    Here's my result:

    $ sudo find / -path /mnt -prune -o  -name libwinpthread-1.dll
    /mnt
    /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll
    
  14. billygarrison commented at 5:25 PM on June 27, 2020: contributor

    @sipsorcery Same result here. My Linux version is Linux version 4.4.0-18362-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) [#836](/bitcoin-bitcoin/836/)-Microsoft Mon May 05 16:04:00 PST 2020 from cat /proc/version in WSL. Ubuntu 20.04 LTS from Microsoft Store (fresh install)

  15. sipsorcery commented at 5:48 PM on June 27, 2020: member

    WSL 2: Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) [#1](/bitcoin-bitcoin/1/) SMP Wed Feb 19 06:37:35 UTC 2020 Downgrade WSL2 VM to WSL1 PS: wsl --set-version Ubuntu-20.04 1 WSL 1: Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) [#1](/bitcoin-bitcoin/1/)-Microsoft Fri Dec 06 14:06:00 PST 2019

    There is a bit of a difference in our Windows 10 versions -18362 compared to 19041 - but I was able to build Bitcoin Core on WSL nearly 3 years ago so that's not exactly a smoking gun.

    cd ~/src/bitcoin/depends
    make clean
    make HOST=x86_64-w64-mingw32 bdb
    

    Success building the bdb dependency after downgrading VM to WSL1.

    I've set my default WSL version to 1 and will now delete my Ubuntu 20.04 VM and try again from scratch.

  16. sipsorcery commented at 7:39 PM on June 27, 2020: member

    My WSL1 build of the bdb dependency ran without issue.

    I've trawled back through the logs on #17277 and have a couple more tests to keep trying to identify what's different.

    • First test is to repeat the monotonic clock check:
    • On your WSL instance create a new file called main.c and copy the contents as:
    #include <stdio.h>
    #include <sys/time.h>
    main() {
            struct timespec t;
            int res = (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
            printf("Result %d.\n", res);
    }
    
    • Build with x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread
    • Execute and report the result:
    $ ./main.exe
    Result 0.
    
    • Second test is to check the list of installed packages. There are a few reports of problems accessing the libwinpthread-1.dll due to pollution from different mingw packages. That seems unlikely here as the failure has occurred on a fresh WSL install. Run command below and report the results:
    $ apt list --installed | grep mingw
    
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    
    binutils-mingw-w64-x86-64/focal,now 2.34-5ubuntu1+8.8 amd64 [installed,automatic]
    g++-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed]
    gcc-mingw-w64-base/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    gcc-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    mingw-w64-common/focal,now 7.0.0-2 all [installed,automatic]
    mingw-w64-x86-64-dev/focal,now 7.0.0-2 all [installed,automatic]
    
  17. billygarrison commented at 9:53 PM on June 27, 2020: contributor

    @sipsorcery

    First test:

    $ x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread
    main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
        3 | main() {
          | ^~~~
    
    $ ./main.exe
    

    image No print statement.

    Second test: Identical results to yours (checked with diffchecker.com)

    $ apt list --installed | grep mingw
    
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    
    binutils-mingw-w64-x86-64/focal,now 2.34-5ubuntu1+8.8 amd64 [installed,automatic]
    g++-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed]
    gcc-mingw-w64-base/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    gcc-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    mingw-w64-common/focal,now 7.0.0-2 all [installed,automatic]
    mingw-w64-x86-64-dev/focal,now 7.0.0-2 all [installed,automatic]
    
  18. billygarrison commented at 9:58 PM on June 27, 2020: contributor

    @sipsorcery it looks like the bitcoin/bitcoin code only contains "conftest" in these three places: https://github.com/bitcoin/bitcoin/search?q=conftest&type=Code

  19. sipsorcery commented at 7:53 AM on June 28, 2020: member

    @billygarrison conftest.exe is the name the autoconf tools use when building test programs to check if the system supports a particular feature. In this case the bdb configure script builds and executes multiple conftest.exe programs. It's good news that the small program with the CLOCK_MONOTONIC check causes the error on your system. That should be enough to log an issue with WSL.

    Last step before I create the WSL issue. Can you generate an strace log for the previous test program execution (WSL issues require an strace log).

    strace ./main.exe

  20. billygarrison commented at 12:14 PM on June 28, 2020: contributor

    main.exe does not get created, here is the output of strace x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread:

    $ strace x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread
    execve("/usr/bin/x86_64-w64-mingw32-gcc", ["x86_64-w64-mingw32-gcc", "-o", "main.exe", "main.c", "-lpthread"], 0x7fffefd30a10 /* 20 vars */) = 0
    brk(NULL)                               = 0x203f000
    arch_prctl(0x3001 /* ARCH_??? */, 0x7fffcd071f20) = -1 EINVAL (Invalid argument)
    access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
    openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=30204, ...}) = 0
    mmap(NULL, 30204, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1adb2000
    close(3)                                = 0
    openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
    read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\341\t\0\0\0\0\0"..., 832) = 832
    fstat(3, {st_mode=S_IFREG|0644, st_size=1952928, ...}) = 0
    mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c1adb0000
    mmap(NULL, 1968128, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1ab90000
    mprotect(0x7f6c1ac26000, 1286144, PROT_NONE) = 0
    mmap(0x7f6c1ac26000, 983040, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x96000) = 0x7f6c1ac26000
    mmap(0x7f6c1ad16000, 299008, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x186000) = 0x7f6c1ad16000
    mmap(0x7f6c1ad60000, 57344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1cf000) = 0x7f6c1ad60000
    mmap(0x7f6c1ad6e000, 10240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6c1ad6e000
    close(3)                                = 0
    openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
    read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3405\0\0\0\0\0\0"..., 832) = 832
    fstat(3, {st_mode=S_IFREG|0644, st_size=104984, ...}) = 0
    mmap(NULL, 107592, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1ab70000
    mmap(0x7f6c1ab73000, 73728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f6c1ab73000
    mmap(0x7f6c1ab85000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f6c1ab85000
    mmap(0x7f6c1ab89000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f6c1ab89000
    close(3)                                = 0
    openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
    read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360q\2\0\0\0\0\0"..., 832) = 832
    pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
    pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
    pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0cBR\340\305\370\2609W\242\345)q\235A\1"..., 68, 880) = 68
    fstat(3, {st_mode=S_IFREG|0755, st_size=2029224, ...}) = 0
    pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
    pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
    pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0cBR\340\305\370\2609W\242\345)q\235A\1"..., 68, 880) = 68
    mmap(NULL, 2036952, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1a970000
    mprotect(0x7f6c1a995000, 1847296, PROT_NONE) = 0
    mmap(0x7f6c1a995000, 1540096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f6c1a995000
    mmap(0x7f6c1ab0d000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7f6c1ab0d000
    mmap(0x7f6c1ab58000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f6c1ab58000
    mmap(0x7f6c1ab5e000, 13528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6c1ab5e000
    close(3)                                = 0
    openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
    read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\363\0\0\0\0\0\0"..., 832) = 832
    fstat(3, {st_mode=S_IFREG|0644, st_size=1369352, ...}) = 0
    mmap(NULL, 1368336, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1a821000
    mmap(0x7f6c1a830000, 684032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f6c1a830000
    mmap(0x7f6c1a8d7000, 618496, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb6000) = 0x7f6c1a8d7000
    mmap(0x7f6c1a96e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14c000) = 0x7f6c1a96e000
    close(3)                                = 0
    mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c1a810000
    arch_prctl(ARCH_SET_FS, 0x7f6c1a810dc0) = 0
    mprotect(0x7f6c1ab58000, 12288, PROT_READ) = 0
    mprotect(0x7f6c1a96e000, 4096, PROT_READ) = 0
    mprotect(0x7f6c1ab89000, 4096, PROT_READ) = 0
    mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c1a800000
    mprotect(0x7f6c1ad60000, 45056, PROT_READ) = 0
    mprotect(0x509000, 4096, PROT_READ)     = 0
    mprotect(0x7f6c1adad000, 4096, PROT_READ) = 0
    munmap(0x7f6c1adb2000, 30204)           = 0
    brk(NULL)                               = 0x203f000
    brk(0x2060000)                          = 0x2060000
    ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    ioctl(0, TIOCGWINSZ, {ws_row=30, ws_col=126, ws_xpixel=0, ws_ypixel=0}) = 0
    brk(0x2086000)                          = 0x2086000
    openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=3035952, ...}) = 0
    mmap(NULL, 3035952, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1a51a000
    close(3)                                = 0
    openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=2996, ...}) = 0
    read(3, "# Locale name alias data base.\n#"..., 512) = 512
    read(3, "See the\n# GNU General Public Lic"..., 512) = 512
    read(3, "und for the time being for\n# bac"..., 512) = 512
    read(3, "These lines were removed\n# becau"..., 512) = 512
    read(3, "-8859-1\ngalego\t\tgl_ES.ISO-8859-1"..., 512) = 512
    read(3, "NO.ISO-8859-1 nb_NO.ISO-8859-1\nn"..., 512) = 436
    read(3, "", 512)                        = 0
    close(3)                                = 0
    openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=201272, ...}) = 0
    mmap(NULL, 201272, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1a4e8000
    close(3)                                = 0
    openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=27002, ...}) = 0
    mmap(NULL, 27002, PROT_READ, MAP_SHARED, 3, 0) = 0x7f6c1adb3000
    close(3)                                = 0
    openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    close(3)                                = 0
    openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=48, ...}) = 0
    mmap(NULL, 48, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1adb2000
    close(3)                                = 0
    openat(AT_FDCWD, "/usr/share/locale/C.UTF-8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    openat(AT_FDCWD, "/usr/share/locale/C.utf8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    openat(AT_FDCWD, "/usr/share/locale/C/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    openat(AT_FDCWD, "/usr/share/locale-langpack/C.UTF-8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    openat(AT_FDCWD, "/usr/share/locale-langpack/C.utf8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    openat(AT_FDCWD, "/usr/share/locale-langpack/C/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    ioctl(0, TIOCGWINSZ, {ws_row=30, ws_col=126, ws_xpixel=0, ws_ypixel=0}) = 0
    ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f0b57fa6210}, 8) = 0
    rt_sigaction(SIGINT, {sa_handler=0x40a150, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_IGN, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, 8) = 0
    rt_sigaction(SIGHUP, {sa_handler=SIG_IGN, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f0b57fa6210}, 8) = 0
    rt_sigaction(SIGHUP, {sa_handler=0x40a150, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_IGN, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, 8) = 0
    rt_sigaction(SIGTERM, {sa_handler=SIG_IGN, sa_mask=[TERM], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f0b57fa6210}, 8) = 0
    rt_sigaction(SIGTERM, {sa_handler=0x40a150, sa_mask=[TERM], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_IGN, sa_mask=[TERM], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, 8) = 0
    rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f0b57fa6210}, 8) = 0
    rt_sigaction(SIGPIPE, {sa_handler=0x40a150, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, 8) = 0
    rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[CHLD], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c1a9b6210}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fa0e9a96210}, 8) = 0
    prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=8192*1024}) = 0
    access("/usr/local/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/local/bin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/bin/x86_64-w64-mingw32-gcc", X_OK) = 0
    stat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=40, ...}) = 0
    readlink("/usr/bin/x86_64-w64-mingw32-gcc", "/etc/alternatives/x86_64-w64-min"..., 4095) = 40
    lstat("/etc", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/etc/alternatives", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/etc/alternatives/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=37, ...}) = 0
    readlink("/etc/alternatives/x86_64-w64-mingw32-gcc", "/usr/bin/x86_64-w64-mingw32-gcc-"..., 4095) = 37
    lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin/x86_64-w64-mingw32-gcc-win32", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    access("/usr/local/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/local/bin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/bin/x86_64-w64-mingw32-gcc", X_OK) = 0
    stat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=40, ...}) = 0
    readlink("/usr/bin/x86_64-w64-mingw32-gcc", "/etc/alternatives/x86_64-w64-min"..., 4095) = 40
    lstat("/etc", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/etc/alternatives", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/etc/alternatives/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=37, ...}) = 0
    readlink("/etc/alternatives/x86_64-w64-mingw32-gcc", "/usr/bin/x86_64-w64-mingw32-gcc-"..., 4095) = 37
    lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    lstat("/usr/bin/x86_64-w64-mingw32-gcc-win32", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    access("main.c", F_OK)                  = 0
    getcwd("/home/billy/src/clockcheck", 4096) = 27
    lstat("/home/billy/src/clockcheck/main.c", {st_mode=S_IFREG|0666, st_size=177, ...}) = 0
    getcwd("/home/billy/src/clockcheck", 4096) = 27
    lstat("/home/billy/src/clockcheck/main.exe", {st_mode=S_IFREG|0777, st_size=317211, ...}) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/", X_OK) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/", X_OK) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/specs", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/9.3-win32/specs", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/specs", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/specs", R_OK) = -1 ENOENT (No such file or directory)
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/lto-wrapper", {st_mode=S_IFREG|0755, st_size=981752, ...}) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/lto-wrapper", X_OK) = 0
    access("/tmp", R_OK|W_OK|X_OK)          = 0
    getpid()                                = 28617
    clock_gettime(CLOCK_MONOTONIC, {tv_sec=131503, tv_nsec=133213300}) = 0
    openat(AT_FDCWD, "/tmp/ccgwViY6.s", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
    close(3)                                = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/cc1", {st_mode=S_IFREG|0755, st_size=25822248, ...}) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/cc1", X_OK) = 0
    pipe2([3, 4], O_CLOEXEC)                = 0
    vfork()                                 = 28618
    close(4)                                = 0
    read(3, "", 16)                         = 0
    close(3)                                = 0
    wait4(28618, main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
        3 | main() {
          | ^~~~
    [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 28618
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28618, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
    getpid()                                = 28617
    clock_gettime(CLOCK_MONOTONIC, {tv_sec=131503, tv_nsec=184392300}) = 0
    openat(AT_FDCWD, "/tmp/ccwXpJC6.o", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
    close(3)                                = 0
    access("/usr/bin/x86_64-w64-mingw32-as", X_OK) = 0
    pipe2([3, 4], O_CLOEXEC)                = 0
    vfork()                                 = 28619
    close(4)                                = 0
    read(3, "", 16)                         = 0
    close(3)                                = 0
    wait4(28619, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 28619
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28619, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", {st_mode=S_IFREG|0755, st_size=563808, ...}) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", X_OK) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/liblto_plugin.so", R_OK) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/9.3-win32/.", 0x7fffcd071c40) = -1 ENOENT (No such file or directory)
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/bin/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/9.3-win32/.", 0x7fffcd071c40) = -1 ENOENT (No such file or directory)
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    getpid()                                = 28617
    clock_gettime(CLOCK_MONOTONIC, {tv_sec=131503, tv_nsec=209722200}) = 0
    openat(AT_FDCWD, "/tmp/ccdrV2w7.res", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
    close(3)                                = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/crt2.o", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/9.3-win32/crt2.o", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/crt2.o", R_OK) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/crtbegin.o", R_OK) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/9.3-win32/.", 0x7fffcd070d90) = -1 ENOENT (No such file or directory)
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/default-manifest.o", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/9.3-win32/default-manifest.o", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/default-manifest.o", R_OK) = -1 ENOENT (No such file or directory)
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/crtend.o", R_OK) = 0
    stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", {st_mode=S_IFREG|0755, st_size=563808, ...}) = 0
    access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", X_OK) = 0
    pipe2([3, 4], O_CLOEXEC)                = 0
    vfork()                                 = 28620
    close(4)                                = 0
    read(3, "", 16)                         = 0
    close(3)                                = 0
    wait4(28620, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 28620
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28620, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
    stat("/tmp/ccdrV2w7.res", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
    unlink("/tmp/ccdrV2w7.res")             = 0
    stat("/tmp/ccwXpJC6.o", {st_mode=S_IFREG|0600, st_size=940, ...}) = 0
    unlink("/tmp/ccwXpJC6.o")               = 0
    stat("/tmp/ccgwViY6.s", {st_mode=S_IFREG|0600, st_size=735, ...}) = 0
    unlink("/tmp/ccgwViY6.s")               = 0
    exit_group(0)                           = ?
    +++ exited with 0 +++
    
  21. billygarrison commented at 12:17 PM on June 28, 2020: contributor

    @sipsorcery if you ctrl+F that output/this page for -Wimplicit-int, that line + the following two lines are the ones that only ones that get output when not using strace.

  22. sipsorcery commented at 12:19 PM on June 28, 2020: member

    Sorry I meant to build main.exe first and then execute it with strace.

    x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread
    strace ./main.exe
    
  23. billygarrison commented at 12:27 PM on June 28, 2020: contributor

    @sipsorcery My mistake, I thought part of the issue was that main.exe wasn't successfully building in the first place.

    Here is the output of strace ./main.exe

    $ strace ./main.exe
    execve("./main.exe", ["./main.exe"], 0x7fffd0df4910 /* 20 vars */) = 0
    arch_prctl(ARCH_SET_FS, 0x293820)       = 0
    set_tid_address(0x293858)               = 28751
    brk(NULL)                               = 0x1709000
    brk(0x170a000)                          = 0x170a000
    sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7]) = 64
    uname({sysname="Linux", nodename="DESKTOP-LLRVDLC", ...}) = 0
    getpid()                                = 28751
    getcwd("/home/billy/src/clockcheck", 4096) = 27
    open("/dev/lxss", O_RDWR)               = 3
    ioctl(3, _IOC(_IOC_NONE, 0, 0x2f, 0x22), 0x7fffcf6d8298) = 0
    getcwd("/home/billy/src/clockcheck", 4096) = 27
    getcwd("/home/billy/src/clockcheck", 4096) = 27
    open("/proc/self/mountinfo", O_RDONLY)  = 5
    readv(5, [{iov_base="", iov_len=0}, {iov_base="2 2 0:2 / / rw,noatime - lxfs ro"..., iov_len=1024}], 2) = 920
    readv(5, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
    close(5)                                = 0
    getcwd("/home/billy/src/clockcheck", 4096) = 27
    open("/proc/self/mountinfo", O_RDONLY)  = 5
    readv(5, [{iov_base="", iov_len=0}, {iov_base="2 2 0:2 / / rw,noatime - lxfs ro"..., iov_len=1024}], 2) = 920
    readv(5, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
    close(5)                                = 0
    ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    ioctl(0, TIOCGPGRP, [28748])            = 0
    getpgid(0)                              = 28748
    fstat(0, {st_mode=S_IFCHR|0660, st_rdev=makedev(0x4, 0x1), ...}) = 0
    fstat(1, {st_mode=S_IFCHR|0660, st_rdev=makedev(0x4, 0x1), ...}) = 0
    fstat(2, {st_mode=S_IFCHR|0660, st_rdev=makedev(0x4, 0x1), ...}) = 0
    ioctl(0, TIOCGWINSZ, {ws_row=50, ws_col=211, ws_xpixel=0, ws_ypixel=0}) = 0
    ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                     dup(0)                                  = 5
                                                                                                                                ioctl(4, _IOC(_IOC_NONE, 0, 0xb7, 0x22), 0x7fffcf6d8248) = 0
                                                                                                                                                                                            ioctl(4, _IOC(_IOC_NONE, 0, 0xb7, 0x22), 0x7fffcf6d8248) = 0
                                     ioctl(4, _IOC(_IOC_NONE, 0, 0xb7, 0x22), 0x7fffcf6d8248) = 0
                                                                                                 write(4, "\0\0\0\0\376\0\0\0b\2\0\0\0\0\0\0c\2\0\0\0\0\0\0d\2\0\0\0\0\0\0"..., 254) = 254
                                                                                                                                                                                          close(0)                                = 0
                  close(1)                                = 0
                                                             close(2)                                = 0
                                                                                                        rt_sigprocmask(SIG_BLOCK, [INT WINCH], NULL, 8) = 0
                                                                                                                                                           signalfd4(-1, [INT WINCH], 8, 0)        = 0
                                                                                                                                                                                                      poll([{fd=4, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                             read(4, "\10\0\0\0 \0\0\0\0\0\0\0\0\0\0\0e\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 32) = 32
                                                                                                                                                                ioctl(4, _IOC(_IOC_NONE, 0, 0xa3, 0x22), 0x7fffcf6d8268) = 0
         poll([{fd=4, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                                                   read(4, "\6\0\0\0\f\0\0\0005\1\0\300", 32) = 12
                                                                                                                                                  write(4, "\6\0\0\0\f\0\0\0005\1\0\300", 12) = -1 EPIPE (Broken pipe)
                                                                                                                                                                                                                      close(1)                                = 0
                                              close(3)                                = 0
                                                                                         close(4)                                = 0
                                                                                                                                    ioctl(5, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
    close(5)                                = 0
    exit_group(-1073741515)                 = ?
    +++ exited with 53 +++
    
  24. sipsorcery commented at 1:55 PM on June 28, 2020: member

    @billygarrison thx for the trace.

    When I went to log this problem on the WSL repo there are a bunch of system clock related issues from 2018/2019. Supposedly they've been fixed but your Windows 10 should have the fix.

    Apparently one of the WSL problems relates to the time the system was last rebooted and can be worked around by restarting the WSL service. Could you try the commands below from a DOS box, re-open your WSL app and then re-execute main.exe?

    sc stop LxssManager
    sc start LxssManager
    
  25. billygarrison commented at 2:05 PM on June 28, 2020: contributor

    @sipsorcery Thanks for the tip, unfortunately I still get the System Error popup referring to libwinpthread-1.dll and an exit code 53

  26. sipsorcery commented at 11:14 AM on June 29, 2020: member

    @billygarrison as mentioned in the WSL issue disabling the hook that allows WSL to execute Windows PE files looks like a potential fix. Can you try:

    sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status"

    and then re-attempt the Bitcoin Core build.

    After testing you can revert the change with:

    sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status"

    I was able to reproduce the original libwinpthread-1.dll not found issue by removing the Windows 10 application that contained that dll. After then disabled the PE binfmt_misc hook, using the command above, the build was successful.

  27. billygarrison commented at 3:47 PM on June 29, 2020: contributor

    That took care of the issue. Thank you for walking me through this!

  28. billygarrison closed this on Jun 29, 2020

  29. laanwj referenced this in commit 85a68952f8 on Jul 1, 2020
  30. random-zebra referenced this in commit 18a91240f6 on Dec 7, 2020
  31. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me