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

issue billygarrison openend 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:

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

    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

    0sudo apt update
    1sudo 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?:

    0sudo 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.

     0cd ~
     1sudo apt update
     2sudo apt upgrade
     3sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git g++-mingw-w64-x86-64
     4sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
     5mkdir src
     6git clone https://github.com/bitcoin/bitcoin.git
     7cd bitcoin
     8PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')
     9cd depends
    10make HOST=x86_64-w64-mingw32 bdb_configured
    
  8. fanquake deleted a comment on Jun 23, 2020
  9. billygarrison commented at 0: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:

    0PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')
    1cd ~/src/bitcoin/depends
    2make clean
    3strace 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:

    0$ sudo find / -path /mnt -prune -o  -name libwinpthread-1.dll
    1/mnt
    2/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.

    0cd ~/src/bitcoin/depends
    1make clean
    2make 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:
    0#include <stdio.h>
    1#include <sys/time.h>
    2main() {
    3        struct timespec t;
    4        int res = (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
    5        printf("Result %d.\n", res);
    6}
    
    • Build with x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread
    • Execute and report the result:
    0$ ./main.exe
    1Result 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:
    0$ apt list --installed | grep mingw
    1
    2WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    3
    4binutils-mingw-w64-x86-64/focal,now 2.34-5ubuntu1+8.8 amd64 [installed,automatic]
    5g++-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed]
    6gcc-mingw-w64-base/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    7gcc-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    8mingw-w64-common/focal,now 7.0.0-2 all [installed,automatic]
    9mingw-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:

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

    image No print statement.

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

    0$ apt list --installed | grep mingw
    1
    2WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    3
    4binutils-mingw-w64-x86-64/focal,now 2.34-5ubuntu1+8.8 amd64 [installed,automatic]
    5g++-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed]
    6gcc-mingw-w64-base/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    7gcc-mingw-w64-x86-64/focal,now 9.3.0-7ubuntu1+22~exp1ubuntu4 amd64 [installed,automatic]
    8mingw-w64-common/focal,now 7.0.0-2 all [installed,automatic]
    9mingw-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:

      0$ strace x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread
      1execve("/usr/bin/x86_64-w64-mingw32-gcc", ["x86_64-w64-mingw32-gcc", "-o", "main.exe", "main.c", "-lpthread"], 0x7fffefd30a10 /* 20 vars */) = 0
      2brk(NULL)                               = 0x203f000
      3arch_prctl(0x3001 /* ARCH_??? */, 0x7fffcd071f20) = -1 EINVAL (Invalid argument)
      4access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
      5openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
      6fstat(3, {st_mode=S_IFREG|0644, st_size=30204, ...}) = 0
      7mmap(NULL, 30204, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1adb2000
      8close(3)                                = 0
      9openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
     10read(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
     11fstat(3, {st_mode=S_IFREG|0644, st_size=1952928, ...}) = 0
     12mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c1adb0000
     13mmap(NULL, 1968128, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1ab90000
     14mprotect(0x7f6c1ac26000, 1286144, PROT_NONE) = 0
     15mmap(0x7f6c1ac26000, 983040, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x96000) = 0x7f6c1ac26000
     16mmap(0x7f6c1ad16000, 299008, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x186000) = 0x7f6c1ad16000
     17mmap(0x7f6c1ad60000, 57344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1cf000) = 0x7f6c1ad60000
     18mmap(0x7f6c1ad6e000, 10240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6c1ad6e000
     19close(3)                                = 0
     20openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
     21read(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
     22fstat(3, {st_mode=S_IFREG|0644, st_size=104984, ...}) = 0
     23mmap(NULL, 107592, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1ab70000
     24mmap(0x7f6c1ab73000, 73728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f6c1ab73000
     25mmap(0x7f6c1ab85000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f6c1ab85000
     26mmap(0x7f6c1ab89000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f6c1ab89000
     27close(3)                                = 0
     28openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
     29read(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
     30pread64(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
     31pread64(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
     32pread64(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
     33fstat(3, {st_mode=S_IFREG|0755, st_size=2029224, ...}) = 0
     34pread64(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
     35pread64(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
     36pread64(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
     37mmap(NULL, 2036952, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1a970000
     38mprotect(0x7f6c1a995000, 1847296, PROT_NONE) = 0
     39mmap(0x7f6c1a995000, 1540096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f6c1a995000
     40mmap(0x7f6c1ab0d000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7f6c1ab0d000
     41mmap(0x7f6c1ab58000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f6c1ab58000
     42mmap(0x7f6c1ab5e000, 13528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6c1ab5e000
     43close(3)                                = 0
     44openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
     45read(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
     46fstat(3, {st_mode=S_IFREG|0644, st_size=1369352, ...}) = 0
     47mmap(NULL, 1368336, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c1a821000
     48mmap(0x7f6c1a830000, 684032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f6c1a830000
     49mmap(0x7f6c1a8d7000, 618496, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb6000) = 0x7f6c1a8d7000
     50mmap(0x7f6c1a96e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14c000) = 0x7f6c1a96e000
     51close(3)                                = 0
     52mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c1a810000
     53arch_prctl(ARCH_SET_FS, 0x7f6c1a810dc0) = 0
     54mprotect(0x7f6c1ab58000, 12288, PROT_READ) = 0
     55mprotect(0x7f6c1a96e000, 4096, PROT_READ) = 0
     56mprotect(0x7f6c1ab89000, 4096, PROT_READ) = 0
     57mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c1a800000
     58mprotect(0x7f6c1ad60000, 45056, PROT_READ) = 0
     59mprotect(0x509000, 4096, PROT_READ)     = 0
     60mprotect(0x7f6c1adad000, 4096, PROT_READ) = 0
     61munmap(0x7f6c1adb2000, 30204)           = 0
     62brk(NULL)                               = 0x203f000
     63brk(0x2060000)                          = 0x2060000
     64ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
     65ioctl(0, TIOCGWINSZ, {ws_row=30, ws_col=126, ws_xpixel=0, ws_ypixel=0}) = 0
     66brk(0x2086000)                          = 0x2086000
     67openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
     68fstat(3, {st_mode=S_IFREG|0644, st_size=3035952, ...}) = 0
     69mmap(NULL, 3035952, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1a51a000
     70close(3)                                = 0
     71openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
     72fstat(3, {st_mode=S_IFREG|0644, st_size=2996, ...}) = 0
     73read(3, "# Locale name alias data base.\n#"..., 512) = 512
     74read(3, "See the\n# GNU General Public Lic"..., 512) = 512
     75read(3, "und for the time being for\n# bac"..., 512) = 512
     76read(3, "These lines were removed\n# becau"..., 512) = 512
     77read(3, "-8859-1\ngalego\t\tgl_ES.ISO-8859-1"..., 512) = 512
     78read(3, "NO.ISO-8859-1 nb_NO.ISO-8859-1\nn"..., 512) = 436
     79read(3, "", 512)                        = 0
     80close(3)                                = 0
     81openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 3
     82fstat(3, {st_mode=S_IFREG|0644, st_size=201272, ...}) = 0
     83mmap(NULL, 201272, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1a4e8000
     84close(3)                                = 0
     85openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
     86fstat(3, {st_mode=S_IFREG|0644, st_size=27002, ...}) = 0
     87mmap(NULL, 27002, PROT_READ, MAP_SHARED, 3, 0) = 0x7f6c1adb3000
     88close(3)                                = 0
     89openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
     90fstat(3, {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
     91close(3)                                = 0
     92openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
     93fstat(3, {st_mode=S_IFREG|0644, st_size=48, ...}) = 0
     94mmap(NULL, 48, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c1adb2000
     95close(3)                                = 0
     96openat(AT_FDCWD, "/usr/share/locale/C.UTF-8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
     97openat(AT_FDCWD, "/usr/share/locale/C.utf8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
     98openat(AT_FDCWD, "/usr/share/locale/C/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
     99openat(AT_FDCWD, "/usr/share/locale-langpack/C.UTF-8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    100openat(AT_FDCWD, "/usr/share/locale-langpack/C.utf8/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    101openat(AT_FDCWD, "/usr/share/locale-langpack/C/LC_MESSAGES/gcc-9.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    102ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    103ioctl(0, TIOCGWINSZ, {ws_row=30, ws_col=126, ws_xpixel=0, ws_ypixel=0}) = 0
    104ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    105rt_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
    106rt_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
    107rt_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
    108rt_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
    109rt_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
    110rt_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
    111rt_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
    112rt_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
    113rt_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
    114prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=8192*1024}) = 0
    115access("/usr/local/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    116access("/usr/local/bin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    117access("/usr/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    118access("/usr/bin/x86_64-w64-mingw32-gcc", X_OK) = 0
    119stat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    120lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    121lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    122lstat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=40, ...}) = 0
    123readlink("/usr/bin/x86_64-w64-mingw32-gcc", "/etc/alternatives/x86_64-w64-min"..., 4095) = 40
    124lstat("/etc", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    125lstat("/etc/alternatives", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    126lstat("/etc/alternatives/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=37, ...}) = 0
    127readlink("/etc/alternatives/x86_64-w64-mingw32-gcc", "/usr/bin/x86_64-w64-mingw32-gcc-"..., 4095) = 37
    128lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    129lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    130lstat("/usr/bin/x86_64-w64-mingw32-gcc-win32", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    131access("/usr/local/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    132access("/usr/local/bin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    133access("/usr/sbin/x86_64-w64-mingw32-gcc", X_OK) = -1 ENOENT (No such file or directory)
    134access("/usr/bin/x86_64-w64-mingw32-gcc", X_OK) = 0
    135stat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    136lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    137lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    138lstat("/usr/bin/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=40, ...}) = 0
    139readlink("/usr/bin/x86_64-w64-mingw32-gcc", "/etc/alternatives/x86_64-w64-min"..., 4095) = 40
    140lstat("/etc", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    141lstat("/etc/alternatives", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    142lstat("/etc/alternatives/x86_64-w64-mingw32-gcc", {st_mode=S_IFLNK|0777, st_size=37, ...}) = 0
    143readlink("/etc/alternatives/x86_64-w64-mingw32-gcc", "/usr/bin/x86_64-w64-mingw32-gcc-"..., 4095) = 37
    144lstat("/usr", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    145lstat("/usr/bin", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    146lstat("/usr/bin/x86_64-w64-mingw32-gcc-win32", {st_mode=S_IFREG|0755, st_size=1090880, ...}) = 0
    147access("main.c", F_OK)                  = 0
    148getcwd("/home/billy/src/clockcheck", 4096) = 27
    149lstat("/home/billy/src/clockcheck/main.c", {st_mode=S_IFREG|0666, st_size=177, ...}) = 0
    150getcwd("/home/billy/src/clockcheck", 4096) = 27
    151lstat("/home/billy/src/clockcheck/main.exe", {st_mode=S_IFREG|0777, st_size=317211, ...}) = 0
    152access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/", X_OK) = 0
    153access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/", X_OK) = 0
    154access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/specs", R_OK) = -1 ENOENT (No such file or directory)
    155access("/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)
    156access("/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)
    157access("/usr/lib/gcc/x86_64-w64-mingw32/specs", R_OK) = -1 ENOENT (No such file or directory)
    158stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/lto-wrapper", {st_mode=S_IFREG|0755, st_size=981752, ...}) = 0
    159access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/lto-wrapper", X_OK) = 0
    160access("/tmp", R_OK|W_OK|X_OK)          = 0
    161getpid()                                = 28617
    162clock_gettime(CLOCK_MONOTONIC, {tv_sec=131503, tv_nsec=133213300}) = 0
    163openat(AT_FDCWD, "/tmp/ccgwViY6.s", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
    164close(3)                                = 0
    165stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/cc1", {st_mode=S_IFREG|0755, st_size=25822248, ...}) = 0
    166access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/cc1", X_OK) = 0
    167pipe2([3, 4], O_CLOEXEC)                = 0
    168vfork()                                 = 28618
    169close(4)                                = 0
    170read(3, "", 16)                         = 0
    171close(3)                                = 0
    172wait4(28618, main.c:3:1: warning: return type defaults to int [-Wimplicit-int]
    173    3 | main() {
    174      | ^~~~
    175[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 28618
    176--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28618, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
    177getpid()                                = 28617
    178clock_gettime(CLOCK_MONOTONIC, {tv_sec=131503, tv_nsec=184392300}) = 0
    179openat(AT_FDCWD, "/tmp/ccwXpJC6.o", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
    180close(3)                                = 0
    181access("/usr/bin/x86_64-w64-mingw32-as", X_OK) = 0
    182pipe2([3, 4], O_CLOEXEC)                = 0
    183vfork()                                 = 28619
    184close(4)                                = 0
    185read(3, "", 16)                         = 0
    186close(3)                                = 0
    187wait4(28619, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 28619
    188--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28619, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
    189stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", {st_mode=S_IFREG|0755, st_size=563808, ...}) = 0
    190access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", X_OK) = 0
    191access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/liblto_plugin.so", R_OK) = 0
    192stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    193stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    194stat("/usr/lib/gcc/x86_64-w64-mingw32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    195stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    196stat("/usr/lib/gcc/x86_64-w64-mingw32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    197stat("/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)
    198stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/bin/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    199stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    200stat("/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)
    201stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    202getpid()                                = 28617
    203clock_gettime(CLOCK_MONOTONIC, {tv_sec=131503, tv_nsec=209722200}) = 0
    204openat(AT_FDCWD, "/tmp/ccdrV2w7.res", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
    205close(3)                                = 0
    206access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/crt2.o", R_OK) = -1 ENOENT (No such file or directory)
    207access("/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)
    208access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/crt2.o", R_OK) = 0
    209access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/crtbegin.o", R_OK) = 0
    210stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    211stat("/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)
    212stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/../../../../x86_64-w64-mingw32/lib/.", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
    213access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/default-manifest.o", R_OK) = -1 ENOENT (No such file or directory)
    214access("/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)
    215access("/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)
    216access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/crtend.o", R_OK) = 0
    217stat("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", {st_mode=S_IFREG|0755, st_size=563808, ...}) = 0
    218access("/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/collect2", X_OK) = 0
    219pipe2([3, 4], O_CLOEXEC)                = 0
    220vfork()                                 = 28620
    221close(4)                                = 0
    222read(3, "", 16)                         = 0
    223close(3)                                = 0
    224wait4(28620, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 28620
    225--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=28620, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
    226stat("/tmp/ccdrV2w7.res", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
    227unlink("/tmp/ccdrV2w7.res")             = 0
    228stat("/tmp/ccwXpJC6.o", {st_mode=S_IFREG|0600, st_size=940, ...}) = 0
    229unlink("/tmp/ccwXpJC6.o")               = 0
    230stat("/tmp/ccgwViY6.s", {st_mode=S_IFREG|0600, st_size=735, ...}) = 0
    231unlink("/tmp/ccgwViY6.s")               = 0
    232exit_group(0)                           = ?
    233+++ 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.

    0x86_64-w64-mingw32-gcc -o main.exe main.c -lpthread
    1strace ./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

     0$ strace ./main.exe
     1execve("./main.exe", ["./main.exe"], 0x7fffd0df4910 /* 20 vars */) = 0
     2arch_prctl(ARCH_SET_FS, 0x293820)       = 0
     3set_tid_address(0x293858)               = 28751
     4brk(NULL)                               = 0x1709000
     5brk(0x170a000)                          = 0x170a000
     6sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7]) = 64
     7uname({sysname="Linux", nodename="DESKTOP-LLRVDLC", ...}) = 0
     8getpid()                                = 28751
     9getcwd("/home/billy/src/clockcheck", 4096) = 27
    10open("/dev/lxss", O_RDWR)               = 3
    11ioctl(3, _IOC(_IOC_NONE, 0, 0x2f, 0x22), 0x7fffcf6d8298) = 0
    12getcwd("/home/billy/src/clockcheck", 4096) = 27
    13getcwd("/home/billy/src/clockcheck", 4096) = 27
    14open("/proc/self/mountinfo", O_RDONLY)  = 5
    15readv(5, [{iov_base="", iov_len=0}, {iov_base="2 2 0:2 / / rw,noatime - lxfs ro"..., iov_len=1024}], 2) = 920
    16readv(5, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
    17close(5)                                = 0
    18getcwd("/home/billy/src/clockcheck", 4096) = 27
    19open("/proc/self/mountinfo", O_RDONLY)  = 5
    20readv(5, [{iov_base="", iov_len=0}, {iov_base="2 2 0:2 / / rw,noatime - lxfs ro"..., iov_len=1024}], 2) = 920
    21readv(5, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
    22close(5)                                = 0
    23ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    24ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    25ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
    26ioctl(0, TIOCGPGRP, [28748])            = 0
    27getpgid(0)                              = 28748
    28fstat(0, {st_mode=S_IFCHR|0660, st_rdev=makedev(0x4, 0x1), ...}) = 0
    29fstat(1, {st_mode=S_IFCHR|0660, st_rdev=makedev(0x4, 0x1), ...}) = 0
    30fstat(2, {st_mode=S_IFCHR|0660, st_rdev=makedev(0x4, 0x1), ...}) = 0
    31ioctl(0, TIOCGWINSZ, {ws_row=50, ws_col=211, ws_xpixel=0, ws_ypixel=0}) = 0
    32ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
    33                                                                                 dup(0)                                  = 5
    34                                                                                                                            ioctl(4, _IOC(_IOC_NONE, 0, 0xb7, 0x22), 0x7fffcf6d8248) = 0
    35                                                                                                                                                                                        ioctl(4, _IOC(_IOC_NONE, 0, 0xb7, 0x22), 0x7fffcf6d8248) = 0
    36                                 ioctl(4, _IOC(_IOC_NONE, 0, 0xb7, 0x22), 0x7fffcf6d8248) = 0
    37                                                                                             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
    38                                                                                                                                                                                      close(0)                                = 0
    39              close(1)                                = 0
    40                                                         close(2)                                = 0
    41                                                                                                    rt_sigprocmask(SIG_BLOCK, [INT WINCH], NULL, 8) = 0
    42                                                                                                                                                       signalfd4(-1, [INT WINCH], 8, 0)        = 0
    43                                                                                                                                                                                                  poll([{fd=4, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
    44                                                                         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
    45                                                                                                                                                            ioctl(4, _IOC(_IOC_NONE, 0, 0xa3, 0x22), 0x7fffcf6d8268) = 0
    46     poll([{fd=4, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
    47                                                                                               read(4, "\6\0\0\0\f\0\0\0005\1\0\300", 32) = 12
    48                                                                                                                                              write(4, "\6\0\0\0\f\0\0\0005\1\0\300", 12) = -1 EPIPE (Broken pipe)
    49                                                                                                                                                                                                                  close(1)                                = 0
    50                                          close(3)                                = 0
    51                                                                                     close(4)                                = 0
    52                                                                                                                                ioctl(5, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
    53close(5)                                = 0
    54exit_group(-1073741515)                 = ?
    55+++ 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?

    0sc stop LxssManager
    1sc 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: 2024-11-17 12:12 UTC

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