skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.66k stars 185 forks source link

`pkg-config --version` exits with code 29 #137

Closed Semphriss closed 3 weeks ago

Semphriss commented 3 weeks ago

Running pkg-config --version fails with "Illegal instruction".

I'd like to report the version of pkg-config where this error happens, but...

skeeto commented 3 weeks ago

Hmm, was this with one of the w64devkit 1.23.0 releases. Built yourself from master? What version of Windows? The full source is distributed with the release under src/. The version string is at the top, which I expect is 0.33.1. You can also use that to get more detailed information like a stack trace: Use the build command in the source header, but add -g3 and run under gdb.

I'm unable to reproduce even in a fresh installation. Perhaps one of the environment variables isn't handled properly. I'm interested in knowing their values on your system when the crash occurs, if set at all:

Another possibility is some mishandling of GetModuleFileNameW, so if it's installed under an unusual path, that would be interesting as well.

Do other commands work? For example, commands that behave differently but don't require .pc files:

$ pkg-config --help $ pkg-config --modversion pkg-config $ pkg-config --variable pc_path pkg-config

Also interesting to know would be any unusual environment under which it might be running (e.g. ConEmu).

Lastly, and least likely, if it's the 32-bit version, the host CPU must support SSE2 (i.e. at least a Pentium 4), or such errors are likely.

Semphriss commented 3 weeks ago

Hey! Sorry for the long delay.

I had compiled w64devkit myself, so I tried recompiling from source with w64devkit GCC, and now it works. I noticed that when I compile w64devkit, it happens that the compilation crashes many times due to random segfaults or internal errors, so I suspect that my RAM is faulty, and there's one bug that unfortunately resulted in a malformed program.

Sorry for the false alarm!