This came from the test suite of the Perl Firebird driver, 
DBD::Firebird, but I am able to reproduce it with plain isql, so the 
problem seems to be somewhere else -- either Firebird or libc.

Firebird is 2.5.1.26351 from the Debian package, running on unstable. 
Embedded server.

The rest of DBD::Firebird test suite (not involving parallel 
connections) runs fine. On other architecture the whole test suite completes 
without errors.

At first I thought that the problem is in atomic-ops, whose 
substitution for hardware-based atomic operations using semaphores is 
buggy, but one of the failing architectures is ia64, and looking at 
the atomic-ops sources it seems there is a native implementation for 
ia64 :/

What is observed:

# session 1
$ FIREBIRD=. FIREBIRD_LOCK=. isql-fb dbd-firebird-test.fdb
Database:  dbd-firebird-test.fdb
SQL> 

# session 2, from another terminal, running in the same working 
# directory
FIREBIRD=. FIREBIRD_LOCK=. isql-fb dbd-firebird-test.fdb 
# hangs

Attaching gdb to the second session's isql and requesting a backtrace 
gives the following:

Thread 4 (Thread 0x42333450 (LWP 3876)):
#0  0x4065bc6c in __new_sem_wait (sem=<optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/sem_wait.c:60
#1  0x40330444 in Firebird::SignalSafeSemaphore::enter (this=0x400341f8)
    at ../src/common/classes/semaphore.cpp:95
#2  0x4007d51c in (anonymous namespace)::shutdownThread ()
    at ../src/jrd/why.cpp:933
#3  0x40078f20 in run (this=<synthetic pointer>)
    at ../src/jrd/ThreadStart.cpp:128
#4  (anonymous namespace)::threadStart (arg=<optimized out>)
    at ../src/jrd/ThreadStart.cpp:139
#5  0x40653ac0 in start_thread (arg=<optimized out>) at pthread_create.c:306
#6  0x4073602c in ?? ()
    at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:113
   from /lib/arm-linux-gnueabi/libc.so.6
#7  0x4073602c in ?? ()
    at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:113
   from /lib/arm-linux-gnueabi/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0x42e03450 (LWP 3877)):
#0  0x4065bf1c in sem_timedwait (sem=0x425e7078, abstime=0x42e02d78)
    at ../nptl/sysdeps/unix/sysv/linux/sem_timedwait.c:88
#1  0x40330520 in Firebird::SignalSafeSemaphore::tryEnter (this=0x425e7078, 
    seconds=<optimized out>, milliseconds=<optimized out>)
    at ../src/common/classes/semaphore.cpp:132
#2  0x40240948 in Jrd::ConfigStorage::touchThreadFunc (this=0x425e36c8)
    at ../src/jrd/trace/TraceConfigStorage.cpp:338
#3  0x402409f8 in Jrd::ConfigStorage::touchThread (arg=0x425e36c8)
    at ../src/jrd/trace/TraceConfigStorage.cpp:321
#4  0x40078f20 in run (this=<synthetic pointer>)
    at ../src/jrd/ThreadStart.cpp:128
#5  (anonymous namespace)::threadStart (arg=<optimized out>)
    at ../src/jrd/ThreadStart.cpp:139
#6  0x40653ac0 in start_thread (arg=<optimized out>) at pthread_create.c:306
#7  0x4073602c in ?? ()
    at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:113
   from /lib/arm-linux-gnueabi/libc.so.6
#8  0x4073602c in ?? ()
    at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:113
   from /lib/arm-linux-gnueabi/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0x4379c450 (LWP 3878)):
#0  __pthread_cond_wait (cond=0x42f9c750, mutex=<optimized out>)
    at pthread_cond_wait.c:156
#1  0x40193200 in ISC_event_wait (event=0x42f9c730, value=<optimized out>, 
    micro_seconds=0) at ../src/jrd/isc_sync.cpp:1290
#2  0x402bf2ac in Jrd::LockManager::blocking_action_thread (this=0x4002e778)
    at ../src/lock/lock.cpp:1568
#3  0x402c3304 in Jrd::LockManager::blocking_action_thread (
    arg=<optimized out>) at ../src/lock/../lock/lock_proto.h:402
#4  0x40078f20 in run (this=<synthetic pointer>)
    at ../src/jrd/ThreadStart.cpp:128
#5  (anonymous namespace)::threadStart (arg=<optimized out>)
    at ../src/jrd/ThreadStart.cpp:139
#6  0x40653ac0 in start_thread (arg=<optimized out>) at pthread_create.c:306
#7  0x4073602c in ?? ()
    at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:113
   from /lib/arm-linux-gnueabi/libc.so.6
#8  0x4073602c in ?? ()
    at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:113
   from /lib/arm-linux-gnueabi/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x40021100 (LWP 3875)):
#0  0x40659afc in __pthread_cond_timedwait (cond=0x42ea07f8, 
    mutex=<optimized out>, abstime=0xbeeb78d8) at pthread_cond_timedwait.c:168
#1  0x401931d8 in ISC_event_wait (event=0x42ea07d8, value=<optimized out>, 
    micro_seconds=1000000) at ../src/jrd/isc_sync.cpp:1270
#2  0x402c1568 in Jrd::LockManager::wait_for_request (this=0x4002e778, 
    tdbb=0x4ec15ec2, request=<optimized out>, lck_wait=<optimized out>)
    at ../src/lock/lock.cpp:3998
#3  0x402c1fe4 in Jrd::LockManager::grant_or_que (this=0x4002e778, 
    tdbb=<optimized out>, request=0x42ea0830, lock=<optimized out>, 
    lck_wait=-1) at ../src/lock/lock.cpp:2295
#4  0x402c22c8 in Jrd::LockManager::enqueue (this=0x4002e778, tdbb=0xbeeb8328, 
    prior_request=<optimized out>, parent_request=<optimized out>, series=1, 
    value=0x425fa874 "\001\376", length=16, type=4 '\004', ast_routine=
    0x40127430 <CCH_down_grade_dbb(void*)>, ast_argument=0x426010c0, data=0, 
    lck_wait=-1, owner_offset=22408) at ../src/lock/lock.cpp:566
#5  0x401ae12c in enqueue (wait=-1, level=4, lock=0x425fa830, tdbb=0xbeeb8328)
    at ../src/jrd/lck.cpp:906
#6  ENQUEUE (wait=-1, level=4, lock=0x425fa830, tdbb=0xbeeb8328)
    at ../src/jrd/lck.cpp:144
#7  LCK_lock (tdbb=0xbeeb8328, lock=0x425fa830, level=<optimized out>, 
    wait=<optimized out>) at ../src/jrd/lck.cpp:617
#8  0x40194de4 in init_database_lock (tdbb=0xbeeb8328)
    at ../src/jrd/jrd.cpp:4923
#9  0x401a51d4 in jrd8_attach_database (user_status=0x6503c, 
    filename=0xbeeb87e0 "dbd-firebird-test.fdb", handle=0xbeeb8938, 
    dpb_length=<optimized out>, dpb=0xbeeb897c "\001M")
    at ../src/jrd/jrd.cpp:999
#10 0x40089a64 in isc_attach_database (user_status=<optimized out>, 
    file_length=<optimized out>, file_name=<optimized out>, public_handle=0x1, 
    dpb_length=0, dpb=0xbeeb8bf0 "\001\214\353\276܌\353\276\310M\002@i\315i")
    at ../src/jrd/why.cpp:1488
#11 0x0001cbbc in newdb (dbname=0x62e3c "dbd-firebird-test.fdb", 
    usr=<optimized out>, psw=<optimized out>, numbufs=<optimized out>, 
    sql_role_nm=0x64edc "", start_user_trans=true)
    at ../temp/std/isql/isql.cpp:7333
#12 0x0002307c in do_isql () at ../temp/std/isql/isql.cpp:4991
#13 0x000263bc in ISQL_main (argc=2, argv=<optimized out>)
    at ../temp/std/isql/isql.cpp:986
#14 0x40683664 in __libc_start_main (main=<optimized out>, 
    argc=<optimized out>, ubp_av=<optimized out>, init=<optimized out>, 
    fini=0x46740 <__libc_csu_fini>, rtld_fini=0xed50 <_start+44>, 
    stack_end=0xbeebe844) at libc-start.c:228
#15 0x0000ed50 in _start ()


I hope this brings some ideas about what might be wrong.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to