tjko / jpegoptim

jpegoptim - utility to optimize/compress JPEG files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
1.56k stars 116 forks source link

SEGV on unknown address #61

Closed eeeeYxN closed 2 years ago

eeeeYxN commented 6 years ago
./jpegoptim -d ./jpg_out -o ./g8.jpg

g8.jpg 25x25 8bit N JFIF [OK] 436 --> 250 bytes (42.66%), optimized. AddressSanitizer:DEADLYSIGNAL

==22892==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000380 (pc 0x7fb5811da8be bp 0x0000000000fa sp 0x7ffe3f1ac380 T0) ==22892==The signal is caused by a READ memory access. ==22892==Hint: address points to the zero page.

0 0x7fb5811da8bd (/lib/x86_64-linux-gnu/libc.so.6+0x7f8bd)

#1 0x49ce56  (/my/jpegoptim/jpegoptim+0x49ce56)
#2 0x51c538  (/my/jpegoptim/jpegoptim+0x51c538)
#3 0x7fb58117cb96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#4 0x41ad09  (/my/jpegoptim/jpegoptim+0x41ad09)

AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x7f8bd) ==22892==ABORTING

g8.zip

file g8.jpg g8.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 25x25, frames 1

tjko commented 6 years ago

Couldn't reproduce with latest version. Was this on latest version or some older one? Can you share more details compiler version and options. libjpeg version, etc ?

eeeeYxN commented 5 years ago

I just type "make" to compile the project. Should I use cmake to regenerate the Makefile? My environment: ··· CFLAGS="-Og -g3 -fsanitize=address -w -std=c11" CXXFLAGS="-Og -g3 -fsanitize=address -w -std=c++14" LDFLAGS="-fsanitize=address" ··· besides, I delete the -W options in your Makefile.

tjko commented 5 years ago

Still, cant seem to be reproduce this (against latest version from git).

Maybe issue is triggered by libjpeg (or libjpeg-turbo or mozjpeg), which library/version are you testing with?

eeeeYxN commented 5 years ago

Package: libjpeg-dev Version: 8c-2ubuntu8 Priority: optional Section: libdevel Source: libjpeg8-empty Origin: Ubuntu Maintainer: Ubuntu Developers ubuntu-devel-discuss@lists.ubuntu.com Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 26.6 kB Depends: libjpeg8-dev Supported: 5y Download-Size: 1,546 B APT-Manual-Installed: yes APT-Sources: http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 Packages Description: Independent JPEG Group's JPEG runtime library (dependency package) This package will always depend on the current default JPEG library development package version.

So I should update my libjpeg-dev to the newest version? Thanks.