New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
makescene crashes when importing PNG files #368
Comments
A crash in
Is there anything else special about the image? Is it an 8 or 16 bit PNG? |
Okay, I have compiled the test program and try to load a PNG that is in the same folder as the test app. I get the same result, the program crashes with "Ungültiger Maschinenbefehl (Speicherabzug geschrieben)". However, if I change the function call to "load_tiff_file" and load a TIFF file instead, it seems to run fine. Maybe the load_png_file function is broken specifically? |
Not sure if this is of any help, but I have changed the code back to load_png_file and used strace to get the system logs related to this app. These are the last few lines of that log before it crashes: 14:00:46.197536 open("./frame_0001.png", O_RDONLY) = 3 |
Do you mind sending me a link to that image? |
My guess is the image just has a png extension but isn’t actually a png... I’ve seen similar issues where a “.png” file was actually jpeg encoded. |
http://maxdid.it/gamejam/img/frame_0001.png I used ffmpeg to export the frames of a video into image files. I thought it might be the wrong file format as well, but I have used the convert command to convert it from png to tiff and back, with no effect. |
The file loads fine here.
|
According to your |
So, I have uninstalled the libpng version I installed via apt-get install and instead downloaded the libpng repository directly, compiled it an installed that. Unfortunately, it has the same effect. Maybe it really is my processor? I currently use a AMD Phenom II X4 965 processor, which isn't the newest model, I guess. Still, I don't think I ever had any similar problems before. Anyways, since you guys can't reproduce the problem, I guess I will close the issue. |
I sorry to hear it still doesn't work. I don't really think it's your hardware... but I am out of ideas. Maybe there are compile-time flags to disable certain acceleration features for libpng? At this point I'm just guessing without really knowing what's causing the issue. |
I know why makescene crashes when importing image files after many experiments. It's not the reason of libjpeg or libpng, the actual reason is openMP. You could fix this bug with these codes in makescene.cc: |
But that change doesn't make a lot of sense. You're storing the image in the Have you tried just putting the #pragma omp critical before image loading? |
@timlgy, can you please tell us a bit more about your system? Which CPU, operating system and compiler are you using? |
It works for me on Ubuntu 14.04.5 LTS, 16U32G and compiler is gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) P.S. 'wrong data' what is that? prebundle.sfm? |
according to this article #pragma omp critical |
Now just to get a feeling for this issue, who is actually affected by these crashes? |
When I load only one image(any type jpg tif or png) it is OK, but when I load two images(any type) it crashes with a high probability. |
I don't know what causes the issue. Loading of images should be possible in parallel, and I have never seen issues. Is this crash maybe related to your available memory, if you load really large images? I can imagine that loading 32 images (in case you have that many cores) in parallel on a 2GB RAM machine will cause issues. In the meantime, just put a line |
@timlgy, can you post a backtrace of the crash? |
@andre-schulz 16U32G means CPU 16 multiple threads and 32GB Mem |
Tried to import just one image: I also get same crash. |
Hi @stiv-yakovenko, |
The problem seems to be that If you need to run |
I confirm ReleaseWithDeb version works. |
@andre-schulz Hi, thanks for your analysis about debug mode. I have re-compile the 3rdparty libraries in Debug mode and add tiffd.dll, zlibd.dll to the Debug version of makescene. The program still crashed in
|
@andre-schulz It's OK now! After a complete compiling of debug after modifying CMAKE_CONFIGURATION_TYPES in CMakeLists.txt of the 3rdparty libraries and modifying input lib configuration of MVE.sln, it's resolved for the jpg loading problem. |
I have an issue with the makescene command I can't resolve myself.
I have cloned and build the repository according to the instructions in the Readme.md under Ubuntu 16.04 64 bit. The build compiles without errors and all the apps are there.
However, if I run the makescene command with the parameters -i <IMAGE_FOLDER> <SCENE_FOLDER>, it will only create the scene folder and then crashes with the message "Ungültiger Maschinenbefehl (Speicherabzug geschrieben)" (I run the German version of Ubuntu)
I have added output messages to the code to see how far the command gets executed and apparently, the crash occurs in the image_io.cc file, in the load_png_file function, around the lines 311-314, where the pointers are set up.
I don't know how to fix it, though. The values for headers.height and headers.channels seem to make sense.
The text was updated successfully, but these errors were encountered: