[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#33505: Test case for bug 33505



An example place it occurs...

ftp://typhaon.ucs.uwa.edu.au/pub/shm_program/shm_program-1.0.tgz

In one window:

typhaon; tar xzf shm_program-1.0.tgz
typhaon; cd shm_program-1.0
typhaon; ls
COPYING         README          dummy_client.c  shm_daemon.c
Makefile        cat_client.c    shm_client.c
typhaon; make
gcc -O2 -ansi -Wall -pedantic   -c shm_client.c -o shm_client.o
gcc -s -export-dynamic shm_client.o -ldl -o shm_client
gcc -O2 -ansi -Wall -pedantic  -s  shm_daemon.c   -o shm_daemon
gcc -O2 -ansi -Wall -pedantic -shared -s dummy_client.c -o dummy_client.so
gcc -O2 -ansi -Wall -pedantic -shared -s cat_client.c -o cat_client.so
typhaon; ./shm_daemon README README.shm
shmctl: Operation not permitted
WARNING: Continuing without locking down memory pages.
[daemon continues in foreground]

In a second window:

typhaon; ./shm_client README.shm ././././././././././././././dummy_client.so
Dummy client ready.  Press 'q' to quit or 'd' to dump shared memory.
Quitting ('q' found).
typhaon; ./shm_client README.shm ././././././././././././././COPYING
././././././././././

typhaon; ./shm_client README.shm ./././././././././././././COPYING
././././././././././

typhaon; ./shm_client README.shm ././././././././././././COPYING
././././././

typhaon; ./shm_client README.shm ./COPYING
./COPYING: invalid ELF header
typhaon;

So - it's a problem with dlerror() after a dlopen() of an invalid file.
As for the comment 22 or so characters is insanely short for a pathname
buffer - yes, but not if you're thinking it will always be a library
name.

(doesn't excuse the original poor coding, wherever it is, but may explain
it)

And the characte that the buffer gets on the end can be any kind of
random junk.

David.


Reply to: