Václav Ovsík <[EMAIL PROTECTED]> writes: > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "s390-linux-gnu"... > Using host libthread_db library "/lib/libthread_db.so.1". > (gdb) run > Starting program: /home/zito/ustr-1.0.3/tst_99_64bit > > Program received signal SIGSEGV, Segmentation fault. > 0x00408cc0 in big_tst (fsz=2147483707, usz=2147483707, hack=1, tst_add=1) at > tst_99_64bit.c:37 > 37 tst_99_64bit.c: No such file or directory. > in tst_99_64bit.c > (gdb) bt > #0 0x00408cc0 in big_tst (fsz=2147483707, usz=2147483707, hack=1, tst_add=1) > at tst_99_64bit.c:37 > #1 0x0040978e in tst () at tst_99_64bit.c:121 > #2 0x00409fc4 in main () at tst.h:172 > > > [EMAIL PROTECTED]:~/ustr-1.0.3$ file ./tst_99_64bit > ./tst_99_64bit: ELF 32-bit MSB executable, IBM S/390, version 1 (SYSV), for > GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped
Seeing where it died showed the obvious bug in the test case: diff --git a/T/ctst_99_64bit.c b/T/ctst_99_64bit.c index e01176c..aa084b6 100644 --- a/T/ctst_99_64bit.c +++ b/T/ctst_99_64bit.c @@ -29,7 +29,8 @@ static int big_tst(size_t fsz, size_t usz, int hack, int tst_a if (ftruncate(fd, fsz) == -1) goto fail_ftrunc; - if (!(ptr = mmap(0, fsz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0))) + ptr = mmap(0, fsz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if (ptr == MAP_FAILED) goto fail_mmap; memset(ptr, '-', ((fsz < 32) ? fsz : 32)); -- James Antill -- [EMAIL PROTECTED] http://www.and.org/and-httpd/ -- $2,000 security guarantee http://www.and.org/ustr/ http://www.and.org/vstr/