-
Notifications
You must be signed in to change notification settings - Fork 51
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
Segmentation fault with --pic #1033
Comments
master
branch we are able to build with our code with commenting and without using --pic
flag. Output binaries are also running successfully.
Since I'm a sucker for segfaults, I've briefly looked into this. The symbols seem to be all there (checked nm, objdump and gdb), so I started commenting out POUs until I ended up with the minimal reproducible example for the segfault, which is simply
I've omitted the stdlib during compilation and added debug-information with the -g flag to attempt a backtrace in gdb, but we don't even reach gdb outputs of the MRE:
info functions
Of note here is that main() is being shown as void type when it is declared as i32 but this is also true when compiling without -pic, which runs without segfault so this might just be gdb. I've also tried setting a breakpoint at
A workaround for now would be to compile using |
Further tests: |
With new
master
branch we are able to build with our code with commenting and without using--pic
flag. Output binaries are also running successfully.But if we use
--pic
flag to build the code, it build successfully but when running the binary we are still gettingSegmentation fault
while running the code.Originally posted by @eddkhfjgdkhgkjfbhnfguh in #1024 (comment)
The text was updated successfully, but these errors were encountered: