-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIGSEGV
on MacOS when running tests with relative path
#102
Comments
Hi @cprieto, thanks reporting the issue in detail. I'll try to replicate this scenario, and provide back some feedback |
@cprieto by now, I didn't succeed to reproduce the issue. To avoid falling into the cliché "On my machine works :)", I've put in place a dedicated repository with related github actions trying to reproduce your enviroment and example. More in detail you can look at:
In the action you can find some useful output like these: May I ask to you 3 things:
int main()
{
unsigned int i = 1;
char *c = (char*)&i;
if (*c) puts("System Endianess: Little endian");
else puts("System Endianess: Big endian");
return 0;
} |
Ok, thanks for answering! I did a little more research around this and tested in different systems:
In conclusion, so far the problem is appearing only in Apple Silicon running macOS. I had not tried in Apple Intel but I suspect it will be the same problem. Yes, file is Machos and little endian. |
Thanks for your analisys. About platforms and compilers:
For what I know, MACH-O binary format should be the same for Intel and Apple Silicon.
At the moment I don't have an Apple Silicon hardware, but I'll try to dig it further PS: I'll rename this issue accordly to reflect the problem |
SIGSEGV
when running exampleSIGSEGV
while running tests on Apple Silicon hardware
@cprieto I succeeded to replicate the issue on MacOS Apply Silicon and Intel. Basically the issue is present mainly when running test using a relative path to the executable (instead with absolute path every worked fine) With relative path, an error in computing the proper image slide address of the binary is done. This bring to wrong test symbol function address and then a segmentation fault. Meanwhile I add more tests and make the solution more robust, you could try this clove-unit.h patch |
SIGSEGV
while running tests on Apple Silicon hardwareSIGSEGV
on MacOS when running tests with relative path
I am facing a
SIGSEGV
when trying to compile a copy of the examples. I am usingcmake
andconan
to handle dependencies. This is myconanfile.txt
:I placed the example in
src/example.c
:And
src/main.c
:My
CMakeLists.txt
file is simple as well:From there simple steps:
But when running the tests:
I am on macOS 14.4.1 using Clang 15.0.0, my conan profile is:
Any idea what could be happening?
The text was updated successfully, but these errors were encountered: