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
Related
I'm trying to get back into programming with OCaml after a long time of not using it, and since I don't have Linux on my current computer, I've been trying to do it through WSL (Windows Subsystem for Linux).
After doing everything as I would have in Linux, whenever I try to compile a piece of code using the Graphics module, I get the following outcomes:
If I try to use the open_graph command, I get the following error:
Exception: Graphics.Graphic_failure "Cannot open display ".
I get that exact error if the argument of open_graph is an empty string, or starts with a space. If the string argument is not empty and doesn't start with a space (which, from what I've read, shouldn't be used anyway), the error message includes said argument as follows:
Exception: Graphics.Graphic_failure "Cannot open display [argument of open_graph]".
If the code only uses base OCaml commands and Graphics commands that doesn't require an open graph (like rgb), everything compiles normally.
I found this thread where users raised the question of the DISPLAY variable possibly being "wrong". The original poster of said thread has a different issue, but I felt it is relevant, as I was thinking that perhaps using WSL could have made my DISPLAY variable "off", or could require me to use a different value for DISPLAY than I would use on a complete Linux OS - but, to be perfectly honest, I have no idea what that would be.
I tried my best to understand everything I read and to explain my issue clearly, but I only have moderate experience with Linux and programming in general, so I'm sorry if I misunderstood something or if my explanations weren't the clearest. In that case, please let me know, and I will try my best to rectify it.
Cheers!
Example of complete code and exact error message:
#use "topfind";; #require "graphics";; Graphics.open_graph "";;
Error message returned:
Exception: Graphics.Graphic_failure "Cannot open display ".
According to https://github.com/ocaml/graphics/issues/21 you need to install a X11 server in your WSL environment.
This one is really frustrating, I have no idea where it is coming from.
A little backstory
I am working on my chess game in c++, and currently I'm on the chess engine part. Everything is going on well, suddenly, at this very specific position of pieces on the board, this error comes
Process returned -1073741819 (0xC0000005) execution time : 2.049 s
Press any key to continue.
It comes during the calculation on the moves, it just stops in the middle and shows this error. The project itself isn't small. I haven't been able to narrow this error down to any of the functions, it just happens. I have read a lot about it and I have seen it being related to pointers?, I am not using them in my program, What can I do to start solving this issue?
I don't really know where the error comes from so I have no idea what code I can provide here.
I am using The Code::Blocks IDE with mingw compiler
If you're on linux and have command line executable, you can follow below steps
Run your executable inside gdb ( gdb ./your_executable )
Start running your executable by run command
This will crash your program inside gdb env.
Now enter where command to know full back trace of crash
You can also apply break point to that function ( break "fun_name" ) after knowing the location of crash and monitor its stack contents by entering bt full
newbie here. I am following along this SFML flappy bird tutorial. I am currently stuck at this portion of stage creation where a "Splash State" (or logo loading screen) is made. The code of which is exactly the same as what is shown here.
I am using xcode 10.1.
The project builds. But when I tried running it, it crashes and I am greeted with the following:
Failed to load image "Resouces/res/Splash Background.png". Reason: Unable to open file
libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: map::at: key not found
(lldb)"
If I understand it correctly, it's saying it cannot perform the action of loading the image at the aforementioned path because it is not able to open "libc++abi.dylib". And now the program is being terminated. (please help me understand this problem better by either confirming or correcting me here).
When I tried looking for "libc++abi.dylib", it is missing. Instead, I can only find "libc++abi.td".
This thread says to add that under Link Binary With Libraries. That did not produce any result.
The tutorial shows that the code runs and a "Splash State" or logo screen is expected to appear. Instead my program crashes and I am greeted with the aforementioned error.
I was wondering if anyone else ran into similar issues?
It's solved. It is made by a typo on my end... sorry.
I'll try my best to explain it here for those of you who may have the same issues:
The game asset is governed by a map, which is a private member variable of a "AssetManager" class. The typo is at the file path. Because of this, the map never inserted the key since the file path isn't valid.
When the map is later accessed, it would be out of range since nothing ever got inserted (since the asset did not load).
Basically, the error of not being to open "libc++abi.dylib" is caused by the map being out of range.
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?
I just installed dlib and I created one project with the cpu introduction example and another one with the gpu introduction example. the first one is compiled and executed on my computer and the second one is compiled and executed on a linux server to use the Nvidia GC. For the cpu example I can compile and execute without any problem. For the gpu example, I can compile without any problem but when I execute it, the initialization is ok but when the network is training I have the first epoch done properly and then I have a segmentation fault. The method used is trainer.train_one_step(mini_batch_samples, mini_batch_labels);
I also tried to train a network using the cpu and then to import it to the gpu example using the deserialize method but I also have a segmentation fault when it tried to do the prediction. The method used for the prediction is std::vector<unsigned long> predicted_labels = tnet(training_images);
I have this problem even without changing anything in the example code so I don't understand why I have this segfault. If someone can help me I will be very grateful.
I apologize for this question but just in case this really stupid mistake happens to someone, I didn't installed the latest version of dlib and this was causing troubles. After installing the latest version it's working properly...