1

I'm working on a single C file project. Here is the make command:

gcc -std=c99 -ggdb picaca.c -o aca -lm

It has segmentation fault. I used gdb to backtrace the segmentation, but it could not find debugging information:

Program received signal SIGSEGV, Segmentation fault.
0x0000000200419a77 in ?? ()

I double checked to have -g in gcc command, and set ulimit to unlimited. How do I fix this error?

asked Jun 28, 2016 at 3:56
2
  • 1
    An alternative interpretation of ?? is that you're at an invalid address due to, e.g, stack corruption. What does bt say and what happens if you type b main - does it know where main is? Commented Jun 28, 2016 at 5:38
  • 1
    It looks like stack corruption. Try stepping through reasonable chunks of code to see where it happens, or for starters run your executable under valgrind. Commented Jun 28, 2016 at 6:44

1 Answer 1

1

Do you have core files enabled? Try 'ulimit -c unlimited' on the command line if you don't see a core file in the execution directory.

answered Jun 28, 2016 at 4:36
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.