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
SEGV in function pngwriter::readfromfile #129
Comments
|
Thank you for the report and thank you for fuzzying PNGwriter! Just for reference, can you attach the exact build command you used for AddressSanitizer as well (CMake line)? |
|
I use this command before export CFLAGS="-g -fsanitize=address" CXXFLAGS="-g -fsanitize=address" |
|
Thanks! |
|
I am trying to reproduce the error with your file and clang 6. I am using libpng In my case, it just aborts reading after ./blackwhite crash_SEGV_readfromfile 1>/dev/null
PNGwriter::check_if_png - ERROR **: File /crash_SEGV_readfromfile does not appear to be a valid PNG file. png_check_sig() failed.
PNGwriter::readfromfile - ERROR **: Error opening file /crash_SEGV_readfromfile. This may not be a valid png file. (check_if_png() failed). |
|
Looks to me like the string name passing is the one causing the trouble, not the test file. An other issue in |
|
I use libpng 1.6 . |
|
Ah, can reproduce now. Checking! |
|
Hm, still slightly different but at least crashing with an address violation. Contrary to the offical docs, calling |
|
Probably it's the missing error handling of the call to |
|
Is this a bug of libpng? |
|
libpng has a nifty way of error handling. Something like C++ exceptions but in C with jumps. |
|
Although, it could also be an error in |
|
Full stack with libpng 1.6.34: 4: 1: will ultimately call 0: in |
|
@fouzhe I now think it might actually be a libpng bug... |
|
@fouzhe I tried against libpng 1.5.30 and 1.6.34 now. The error is The error seems to be part of the cleanup routines when text support is enabled. |
|
Oh,I will try it! |
I use Clang 6.0 and AddressSanitizer to build pngwriter v0.7.0, this file can cause SEGV signal when running the test
blackwhitein folderpngwriter-buildwith the following command:This is the ASAN information:
The text was updated successfully, but these errors were encountered: