what means these error?

Started by
36 comments, last by cambalinho 7 years, 9 months ago

i'm Debugging my application test, but i see some problems.

Debugger Output:

Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\Cambalinho\Documents\CodeBlocks\classcontrols\
Adding source dir: C:\Users\Cambalinho\Documents\CodeBlocks\classcontrols\
Adding file: C:\Users\Cambalinho\Documents\CodeBlocks\classcontrols\bin\Debug\classcontrols.exe
Changing directory to: C:/Users/Cambalinho/Documents/CodeBlocks/classcontrols/bin/Debug
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\mingw32\i686-w64-mingw32\lib;C:\Program Files (x86)\CodeBlocks\mingw32\bin;C:\Program Files (x86)\CodeBlocks\mingw32;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Program Files (x86)\PC Connectivity Solution;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Broadcom\Broadcom 802.11\Driver;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools;C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin;C:\Program Files (x86)\Dr. Memory\bin
Starting debugger: C:\Program Files (x86)\CodeBlocks\mingw32\bin\gdb.exe -nx -fullname -quiet -args C:/Users/Cambalinho/Documents/CodeBlocks/classcontrols/bin/Debug/classcontrols.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6
Child process PID: 3264
Program received signal SIGSEGV, Segmentation fault.
In ?? () ()
Continuing...
In ntdll!ZwClose () (C:\Windows\system32\ntdll.dll)
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In std::_Function_base::_M_empty() const () ()
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In std::_Function_base::_M_empty() const () ()
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In consolewindow::mtRead::{lambda(void*)#1}::operator()(consolewindow::mtRead) const () ()
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In consolewindow::mtRead::{lambda(void*)#1}::operator()(consolewindow::mtRead) const () ()
Continuing...
[Inferior 1 (process 3264) exited with code 030000000005]
Debugger finished with status 0

what means(for exemple):

"Program received signal SIGSEGV, Segmentation fault.
In consolewindow::mtRead::{lambda(void*)#1}::operator()(consolewindow::mtRead) const () ()"???

Advertisement

Hello Cambalinho,

it has been awhile since I received a similar error, so I had to do a little bit of research. The general consensus is that the error is given when attempting to access a pointer that has either not been properly initialized, or has been deleted. Essentially trying to de-reference a dangling pointer that may point to an unexpected area in memory. If my explanation proves to be insufficient, i'll attempt to clarify, or through a google search you will be able to procure a wealth of info in regards to this particular error.

Might also be helpful to post the source file(s) that is generating the errors.

Marcus Hansen

Here: https://en.wikipedia.org/wiki/Segmentation_fault

thanks now i understand better. but i can't find the error. maybe it's some lambdas been 'NULL' or something... but i'm searching

i can share the code but it's very code.... i don't know where is the code problem, only some ideas

eis o meu Debugger Output:

Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\Cambalinho\Documents\CodeBlocks\classcontrols\
Adding source dir: C:\Users\Cambalinho\Documents\CodeBlocks\classcontrols\
Adding file: C:\Users\Cambalinho\Documents\CodeBlocks\classcontrols\bin\Debug\classcontrols.exe
Changing directory to: C:/Users/Cambalinho/Documents/CodeBlocks/classcontrols/bin/Debug
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\mingw32\i686-w64-mingw32\lib;C:\Program Files (x86)\CodeBlocks\mingw32\bin;C:\Program Files (x86)\CodeBlocks\mingw32;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Program Files (x86)\PC Connectivity Solution;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Broadcom\Broadcom 802.11\Driver;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools;C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin;C:\Program Files (x86)\Dr. Memory\bin
Starting debugger: C:\Program Files (x86)\CodeBlocks\mingw32\bin\gdb.exe -nx -fullname -quiet -args C:/Users/Cambalinho/Documents/CodeBlocks/classcontrols/bin/Debug/classcontrols.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6
Child process PID: 3212
Program received signal SIGSEGV, Segmentation fault.
In consolewindow::mtRead::{lambda(void*)#1}::operator()(consolewindow::mtRead) const () ()
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In consolewindow::mtRead::{lambda(void*)#1}::operator()(consolewindow::mtRead) const () ()
Continuing...
In ntdll!ZwClose () (C:\Windows\system32\ntdll.dll)
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In std::string::assign(char const*, unsigned int) () ()
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In std::string::assign(char const*, unsigned int) () ()
Continuing...
[Inferior 1 (process 3212) exited with code 030000000005]
Debugger finished with status 0

and yes: i fixed some problems.

the assign() don't make sence to me. but mtRead, maybe. i must see more

What does your debugger tell you? Not the output, the actual debugger. Step through the program until you get to the line that is causing the problem.

Look at your data.

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

Set your debugger to break into the program when the crash happens. Then look at your data to see what is happening.

eis o meu Debugger Output:

Adoro a mistura of languages you did lá. :)

it seems like you are getting those seg faults in some string manipulation functions. i would look at the possibility that you are indexing into an array beyond its bounds (ie. accessing the 10th character of a string that is only 7 characters long).

Also if you are passing strings into those functions by pointer or by reference and then the original string gets deleted or goes out of scope you could have the same problem.

What does that line of code with the lambda look like? Specifically: Is anything captured?

I'm asking because "segfault" in the same sentence as "lambda" smells like lambda with capture with a reference-to-local or pointer-to-local passed to a callback function (or something similar).
Unluckily, gdb does not show lambda captures in its output, so without knowing the code it's all guessing.

This topic is closed to new replies.

Advertisement