Menu

#11 pxlib causes stack smashing in pxview when blobs are used

open
nobody
None
5
2012-09-16
2012-09-16
Zoltan P
No

Hi,

when trying to use pxview with databases that have binary blobs in them, a stack smashing error gets generated. Example output below:

$ ./pxview.elf "/tmp/profoto/Profoto/profoto.db" -b /tmp/profoto/Profoto/profoto.MB -p img --blobextension=bmp -x -o index.htm
*** stack smashing detected ***: ./pxview.elf terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0xb7690c75]
/lib/i386-linux-gnu/libc.so.6(+0xe8c27)[0xb7690c27]
/home/zoltanp/Desktop/profoto-dump/pxlib-0.6.5/../pxlib/lib/libpx.so.0(+0x11151)[0xb777f151]
/home/zoltanp/Desktop/profoto-dump/pxlib-0.6.5/../pxlib/lib/libpx.so.0(PX_open_blob_fp+0x3a7)[0xb7775d17]
/home/zoltanp/Desktop/profoto-dump/pxlib-0.6.5/../pxlib/lib/libpx.so.0(PX_open_blob_file+0x4e)[0xb7775dee]
./pxview.elf[0x804a00c]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb75c1113]
./pxview.elf[0x804fb99]
======= Memory map: ========
08048000-08054000 r-xp 00000000 08:06 961263 /home/zoltanp/Desktop/profoto-dump/pxview.elf
08054000-08055000 r--p 0000b000 08:06 961263 /home/zoltanp/Desktop/profoto-dump/pxview.elf
..... cut the memory map ...
b77c6000-b77c7000 rw-p 0001e000 08:06 5720787 /lib/i386-linux-gnu/ld-2.13.so
bfbeb000-bfc0c000 rw-p 00000000 00:00 0 [stack]
Aborted

This happens on an Ubuntu 11.10 system, both with the pxlib from the distribution, and also with the pxlib compiled from source.

The system is:
$ uname -a
Linux e6pzoltanlaptop 3.0.0-25-generic-pae #41-Ubuntu SMP Mon Aug 13 18:20:25 UTC 2012 i686 i686 i386 GNU/Linux

An incorrect workaround I found is to recompile pxlib with stack smashing protection disabled, but that is not solving the main issue.

Versions 0.6.0, 0.6.4 and 0.6.5 all generate this error.

Unfortunately valgrind is not able to catch the source of this error.

The files that generate this error contain private data, so I'm not uploading them here; Feel free to contact me, and I can send a minimal crashing example.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.