-
Notifications
You must be signed in to change notification settings - Fork 75
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
SSE2 implementation of JPEG loader crashes on 32bit builds. #5
Comments
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). I doesn't need any compiler flag in particular, it should work without problems with MingW-64 ( it's what i'm using by the way ). |
Original comment by RoestVrijStaal (Bitbucket: RoestVrijStaal, GitHub: RoestVrijStaal). I tried to compile SOIL2 with premake4 in the beginning, but make / mingw32-make ignores environment variables so I gave up on trying to compile via command line. After experimenting, I noticed it seem only to apply to jpeg loading. At other formats like bmp, png and tga loading and using goes fine. I tried different jpgs, but it ends up in the same result. The segmentation fault occurs in emmintrin.h, rule 670, initiated by rule 1508 in stb_image.c. // emmintrin.h (r605) return extension (__m128i)(__v8hi){ // stb_image.c (r1508) __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f)); ATM I'm using MinGW-w64 i686-4.9.2-posix-dwarf-rt_v3-rev1 on Win7 x84_64. The same occurs on a Win7 x86_32. Here are the links to the test projects: http://go4up.com/dl/d8ee78678e79/SpartanJ-soil2__test_perf_SOIL2.rar http://go4up.com/dl/de0a9112f8fb/SpartanJ-soil2__test_SOIL2.rar |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). It seems to be a compilation problem, since i compiled the project by myself and worked fine with jpgs, but your project crashes with the jpg files. I used TDM-GCC, i'm not using the same mingw as you, so, i recommend you to try it. You should not have the SDL2 include problem, just copy the files as they come in the SDL2 for mingw file and it'll work. Before doing anything pull and update the SOIL2 repo with the new changes. Please try to compile the project again updating the repository, creating the project width premake4 ( premake4 gmake or premake4 codeblocks ), and try to use TDC-GCC that it's working fine, copy the SDL2 stuff to the TDM-GCC folder ( copy the x86_64-w64-mingw32 directory, that's what you should be using for x64, otherwise i686-w64-mingw32 ), and that should be enough. Regards |
Original comment by CHAOS-THEORY (Bitbucket: CHAOS-THEORY, GitHub: CHAOS-THEORY). Yo ! wassup,
Now that you are here with a new Static Lib. project.
Else if you followed this tut correctly and failed, please report back with all the errors and warnings returned by your compiler. And finally i have uploaded it for you, the whole project including the library compiled if you ever need it. And don't forget am using the 32b architecture under winxp, go ahead and use it compile it. SOIL2 - LIB - AK' Download < Hosted by OneDrive > < Updated, added the release Lib as well > Good luck and Peace yo ! |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). Wow, that's a lot of work, thanks for the comment. Regards! |
Original comment by CHAOS-THEORY (Bitbucket: CHAOS-THEORY, GitHub: CHAOS-THEORY). An i actually didn't notice it till now, ma bad since i didn't read the whole post and skipped directly to compiling from codeblocks, thought it would be better to just give a graphical view on how to compile it to have a better understanding on the error. |
Original comment by RoestVrijStaal (Bitbucket: RoestVrijStaal, GitHub: RoestVrijStaal). Hello, I tried to reproduce the bug with TDM-GCC, but I couldn't set up the toolchain properly because TDM-GCC installs the 64-bit compiler and I'm using 32-bit Windows. The TDM-GCC docs tells using -m32 would work, but since other dlls are used, it doesn't. Trying to the "old" MinGW environment installed by TDM-GCC doesn't play nice with SDL2 either. The installation process of TDM-GCC makes me wonder if difference between things like SJLJ, SEH and DWARF2 and POSIX / Win32 threads could cause the jpg-view problem. I know they shouldn't, but it could be. Are the used jpg-loading dll's the same? To compare, you'll find the one I use (libjpeg-9.dll) in the \bin\Debug directory of the uploaded projects I linked to in the previous post. It's the one shipped with SDL2_image-2.0.0. Please notice I'm able to build SOIL2 in the beginning, but I felt something was wrong because I had to add -msse2 to get a successful build. I guess the title of this issue is somewhat misleading now, because it seems only jpg-view doesn't work. Sorry for your efforts CHAOS-THEORY, but likely someone else will find it a handy tutorial. Since it seems only a problem with jpg. I guess working it around by using other file formats is my best option for the time being. Best Regards, RoestVrijStaal |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). OK, so now i understand the problem! The new stb_image SSE2 jpeg decoder implementation is not working on 32bit builds. Meanwhile i disabled SSE2 in 32bit builds, that fixes the problem. I don't know if this is a Window only problem, i'll test it in some minutes so i can report the bug correctly in the stb_image repo. |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). RoestVrijStaal, just to let you know: To compile with TDM-GCC64 in 32bits, it's OK to use To generate the project with 32bit forced with premake you should do |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). Issue on github: nothings/stb#81 |
Original comment by RoestVrijStaal (Bitbucket: RoestVrijStaal, GitHub: RoestVrijStaal). It's kinda overwhelming for me. What should I do now? |
Original report by RoestVrijStaal (Bitbucket: RoestVrijStaal, GitHub: RoestVrijStaal).
Hello,
I try to compile SOIL2 but my attempts with standalone MinGW-w64 with its own command line and Code::Blocks inclusive MinGW-64 failed.
The most successful result was with Code::Blocks after adding -msse2 as extra compiler flag.
However, test_perf_SOIL2.cpp SIGSEGs in SSE2 instructions again.
Which compiler + flags (and IDE) do you use?
The text was updated successfully, but these errors were encountered: