Full_Name: Stanislav Ravas Version: 49ae28a2eec73bdf8e5811a1880ea6229ad10b38 OS: buildroot, gcc-4.7.3 URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (193.87.79.243)
LMDB mtest fails when running on ARM platform (kernel v3.3.0, gcc-4.7.3 with uclibc-0.9.33.2, ARM926ejs CPU).
mtest output: Adding 348 values 58 duplicates skipped Deleted 0 values Cursor next Cursor last mtest.c:111: mdb_cursor_get(cursor, &key, &data, MDB_LAST): MDB_NOTFOUND: No matching key/data pair found Aborted
I've discovered this bug when debugging my application. mdb_cursor_put() was returning MDB_NOTFOUND, I think it came from mdb_page_search(). So I ran mtest to rule out my application as the cause.
So far I can provide mtest strace log: execve("./lmdb6-mtest", ["./lmdb6-mtest"], [/* 22 vars */]) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0xb6ffa000 stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=8680, ...}) = 0 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 mmap2(NULL, 8680, PROT_READ, MAP_SHARED, 3, 0) = 0xb6ff7000 close(3) = 0 open("/lib/libpthread.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=95305, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0xb6ff6000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\260C\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 114688, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fd1000 mmap2(0xb6fd1000, 67452, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6fd1000 mmap2(0xb6fe9000, 4124, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0xb6fe9000 mmap2(0xb6feb000, 4328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6feb000 close(3) = 0 munmap(0xb6ff6000, 4096) = 0 open("/lib/libc.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=358156, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0xb6ff6000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\360\253\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 413696, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f6c000 mmap2(0xb6f6c000, 354188, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f6c000 mmap2(0xb6fca000, 4852, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x56000) = 0xb6fca000 mmap2(0xb6fcc000, 17520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6fcc000 close(3) = 0 munmap(0xb6ff6000, 4096) = 0 stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=29392, ...}) = 0 open("/lib/libdl.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=13216, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0xb6ff6000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\200\v\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 49152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f60000 mmap2(0xb6f60000, 8660, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f60000 mmap2(0xb6f6a000, 4120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0xb6f6a000 close(3) = 0 munmap(0xb6ff6000, 4096) = 0 open("/lib/libc.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=358156, ...}) = 0 close(3) = 0 open("/lib/libc.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=358156, ...}) = 0 close(3) = 0 munmap(0xb6ff7000, 8680) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0xb6ff9000 set_tls(0xb6ff9480, 0xb6ff9b20, 0xb6ff9b28, 0xb6ff9480, 0xb6ffbf74) = 0 mprotect(0xb6fe9000, 4096, PROT_READ) = 0 mprotect(0xb6fca000, 4096, PROT_READ) = 0 mprotect(0xb6ffb000, 4096, PROT_READ) = 0 mprotect(0xb6f6a000, 4096, PROT_READ) = 0 set_tid_address(0xb6ff9068) = 1748 set_robust_list(0xb6ff9070, 12) = 0 rt_sigaction(SIGRTMIN, {0xb6fda708, [], SA_SIGINFO|0x4000000}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0xb6fda5ac, [], SA_RESTART|SA_SIGINFO|0x4000000}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=18014398505295872*1024, rlim_max=1152921524856792492}) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 gettimeofday({1399032254, 599658}, NULL) = 0 brk(0) = 0x355000 brk(0x356000) = 0x356000 mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb6edf000 mmap2(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb6dde000 open("./testdb/lock.mdb", O_RDWR|O_CREAT|O_CLOEXEC, 0664) = 3 fcntl64(3, 0x6 /* F_??? */, 0xbef42940) = 0 lseek(3, 0, SEEK_END) = 0 ftruncate(3, 8192) = 0 mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0xb6ff7000 open("./testdb/data.mdb", O_RDWR|O_CREAT, 0664) = 4 pread(4, "", 92, 0) = 0 mmap2(NULL, 10485760, PROT_READ, MAP_SHARED, 4, 0) = 0xb63de000 brk(0x358000) = 0x358000 pwrite(4, "\0\0\0\0\0\0\10\0\0\0\0\0\336\300\357\276\1\0\0\0\0\340=\266\0\0\240\0\0\20\0\0"..., 8192, 0) = 8192 open("./testdb/data.mdb", O_RDWR|O_SYNC) = 5 fcntl64(3, 0x6 /* F_??? */, 0xbef42984) = 0 write(1, "Adding 79 values\n", 17Adding 79 values ) = 17 write(1, "2 duplicates skipped\n", 212 duplicates skipped ) = 21 pwrite(4, "\2\0\0\0\0\0\2\0\246\0\304\2\204\5\20\7H\16\354\7\244\t0\v\30\10L\t\360\r\344\6"..., 4096, 0) = 4096 fdatasync(4) = 0 pwrite(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\0\0\0\0\0\0\1\0\0\0"..., 58, 0) = 58 write(1, "Deleted 0 values\n", 17Deleted 0 values ) = 17 write(1, "Cursor next\n", 12Cursor next ) = 12 write(1, "Cursor last\n", 12Cursor last ) = 12 write(2, "mtest.c", 7mtest.c) = 7 write(2, ":", 1:) = 1 write(2, "111", 3111) = 3 write(2, ": ", 2: ) = 2 write(2, "mdb_cursor_get(cursor, &key, &da"..., 45mdb_cursor_get(cursor, &key, &data, MDB_LAST)) = 45 write(2, ": ", 2: ) = 2 write(2, "MDB_NOTFOUND: No matching key/da"..., 45MDB_NOTFOUND: No matching key/data pair found) = 45 write(2, "\n", 1 ) = 1 rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 tgkill(1748, 1748, SIGABRT) = 0 --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=1748, si_uid=0} --- +++ killed by SIGABRT +++ Aborted