c++cgdbcoredump

What does _dopr mean


I have a gdb be crashed dump having crashed at dopr

What does this do ? I have not defined this function and not using calling anywhere. Is is libc function ?

[Switching to thread 1 (Thread 5339)]#0  0x00000000005f0937 in _dopr ()
(gdb) bt
#0  0x00000000005f0937 in _dopr ()
#1  0x00000000000003ff in ?? ()
#2  0x000000000111c3b0 in ?? ()
#3  0x00007fced1fe1f80 in ?? ()
#4  0x0000000000000000 in ?? ()

Solution

  • As mentioned in the comments _dopr isn't your problem. What you are looking at is stack corruption, and again, in the comments, a buffer overflow is the most likely problem.

    Assuming you are compiling your application with gcc, add the option:

    -fstack-protector-all
    

    to your compile and link options. This stick a couple of extra sentinel bits around the stack, and when your buffer overflow occurs, in gdb you'll see a much more useful 'stack smashing detected' message, along with the stack trace of your application before it actually destroys the stack.