I have a problem when running Fortran program on windows (the problem is gone in linux) that i can't overwrite existing file, he give me an error after running the code
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
but if i'm deleting the file everything work just fine. That is very annoying problem because during the code testing i'm running it a lot of times, any ideas?
Related
I am developing an application that saves some data into other formats including .bag format. Therefore, I use ROS code to save into this format if desired.
When I run this program, I get the following error:
terminate called after throwing an instance of 'std::runtime_error'
what(): time_duration is out of dual 32-bit range
Aborted (core dumped)
Here is the piece of code related to the error:
ros::Time::init();
bag->write("point", ros::Time::now(), arr);
Notes:
When I comment both of these lines, the code works without error, but of course I cannot save any .bag file this way.
I tried to wrap these lines in a try/catch block, but I still got an exception, and this sounds weird for me (I tried try/catch(...) which shall catch any exception from the program).
Also, when the program does not get into the if condition related to the .bag format, the program still craches. This is still weird for me as this way the code did not reach the ros code, so why does the application craches? I also tried to wrap the ros code in a if (false) block and run the application, it does work fine! Is this somehow related to the compiler?
I am using Ubuntu 16.04 and Kinetic version of ROS
I already searched the web for a while but it appears my problem is very rare:
I'm programming a Audio Unit Plugin with JUCE in C++.
When I run it in a host, the host crashes. When I attach the XCode debugger to the hoist before loading my plugin, it points me to the following:
error: address doesn't contain a section that points to a section in a object file
If I type "bt" into the debug console, it says:
* thread #1: tid = 0x1f03, 0x00000000, stop reason = EXC_BAD_ACCESS (code=2, address=0x0)
frame #0: 0x00000000
I don't get a stack trace, making it impossible to find the source of the bug. It would help a lot to see, what was executed right before the bad access happened, but I can't figure out how.
I can set a breakpoint somewhere in the program and from there slowly make my way through the code until I reach the crash. I did this and eventually the execution leaves my source code and I get the assembly lines. I can see it jumping out of a lot of calls with the "ret" command. Eventually on one "ret" command, the crash occurs.
The assembly code is from the host that runs my plugin. But the crash appears on different types of host so I'm pretty sure, its a fault on my side. Any ideas?
Thank you!
I am working on a network simulator which involves generating random connection requests, making connections and releasing them after a specific service time, also generated randomly.
My code is 1000 lines long code. I am using multi-threading and this code is a part of one of two threads.
I am always getting the same error(segmentation fault) always after the same statement in the code(after the "connection request between _ and _ line:").
error-
mokamaConnection request between 10 and 4
Segmentation fault (core dumped)
A very small part of my code which contain the statement after which error is coming. I had added cout statements both above and below the statement after which error is coming.
code-
cout<<"mokama";
//generate the value of src and dest
cout<<"Connection request between "<<src<<" and "<<dest<<endl;
//initmat(topocust,0); //topocust matrix intialised with all zero
cout<<"this printed before matrix.";
I know what segmentation error means. But what i am really unable to understand is that how this error can possibly be occur after a cout statement.Is this even possible? I know i should show you the entire code but i can't since it is not feasible. Can anyone without looking at the entire code can suggest me where the problem should lie..
Also, since i know the entire code so i can say confidently that problem lie in this thread only.
Thanks in advance!
I know this will sound weird but if you are using CodeBlocks IDE, CodeBlocks may sometimes refer to wrong lines of code when segmentation errors appear (don't know why). You may try looking at the code above the indicated line.
Well. that´s the question. Just that.
I got an app made with SDL and OpenGL. SDL opens an extra window (which is the console) additional to the graphical one. When i execute i´m getting a 3 output error, the console tells me. And it gets closed (the graphical one).
But i know this happens when a SIGSEGV signal is received (don´t know how to capture it) and it appears in my IDE (Code::blocks) while debugging. But this time nothing appears, and everything works all right. But when executing it crashes..
What the...
What kind of error can i expect?. Sometimes it gets closed, sometimes it doesn´t. How to know what kind of problem i got?.
SIGSEGV is a segmentation fault, you're trying to access memory that isn't accessible to your process.
Assuming you're on a UNIXy system, you should be able to get the program to core dump and then look at the core dump in a debugger; alternatively, use a memory debugger like Valgrind to pinpoint the memory management issue that's causing this problem.
I'm working on a computer vision program at the moment with OpenCV in C++. It seems to work 100% fine with a live feed from a webcam but when I tried to feed in a stream from an avi file it started crashing with an "Access Violation" error. I can't see why this would be the case because the only difference between the two is the initial frame-grabbing- the image processing is the same afterwards.
I'm developing in VS2008. The curious thing is that when I place a breakpoint in my main() and debug (F5) the program runs fine. However, when I Start Without Debugging (Ctrl+F5) I get the error.
Has anybody encountered a similar problem or would anyone know why my program would appear to work fine when debugging but not in normal execution?
I would suspect uninitialized variables. Many debuggers initialize all variables, including those that are not.
Nothing specific about OpenCV, but the fact that it behaves differently with a different source stream, and in or out of the debugger, makes me think it is a timing issue. You could try attachng the debugger after the crash happens maybe.