Subject Re: DROP table statement hangs Firebird Server process with 100% CPU usage
Author
Hello, I'm no programmer but here's what I have in gdb, but I have a feeling it's not going to be very useful. Let me know if I need to get something else. The "good" news is that I can reproduce the problem every time I issue "drop table CONTEXTS;" in isql-fb.

(gdb) attach 18405
Attaching to process 18405
[New LWP 18406]
[New LWP 18407]
[New LWP 18413]
[New LWP 18414]
[New LWP 18415]
[New LWP 18416]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fd2f4b2e74d in poll () at ../sysdeps/unix/syscall-template.S:84
84      ../sysdeps/unix/syscall-template.S: No such file or directory.

(gdb) bt
#0  0x00007fd2f4b2e74d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00000000006dc7da in ?? ()
#2  0x0000000000414407 in ?? ()
#3  0x000000000040a5ad in ?? ()
#4  0x00007fd2f4a53830 in __libc_start_main (main=0x4074f0, argc=1, 
    argv=0x7ffda4e76ff8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffda4e76fe8) at ../csu/libc-start.c:291
#5  0x0000000000409d89 in ?? ()
(gdb) 
#0  0x00007fd2f4b2e74d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00000000006dc7da in ?? ()
#2  0x0000000000414407 in ?? ()
#3  0x000000000040a5ad in ?? ()
#4  0x00007fd2f4a53830 in __libc_start_main (main=0x4074f0, argc=1, 
    argv=0x7ffda4e76ff8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffda4e76fe8) at ../csu/libc-start.c:291
#5  0x0000000000409d89 in ?? ()
(gdb) 
#0  0x00007fd2f4b2e74d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00000000006dc7da in ?? ()
#2  0x0000000000414407 in ?? ()
#3  0x000000000040a5ad in ?? ()
#4  0x00007fd2f4a53830 in __libc_start_main (main=0x4074f0, argc=1, 
    argv=0x7ffda4e76ff8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffda4e76fe8) at ../csu/libc-start.c:291
#5  0x0000000000409d89 in ?? ()

(gdb) info threads
  Id   Target Id         Frame 
* 1    Thread 0x7fd2f606a740 (LWP 18405) "fbserver" 0x00007fd2f4b2e74d in poll ()
    at ../sysdeps/unix/syscall-template.S:84
  2    Thread 0x7fd2f273b700 (LWP 18406) "fbserver" 0x00007fd2f4e0c827 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7fd2f6066e50)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  3    Thread 0x7fd2f1a65700 (LWP 18407) "fbserver" 0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, abstime=0x7fd2f1a64e40, expected=0, 
    futex_word=0x7fd2f60061a0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  4    Thread 0x7fd2eff33700 (LWP 18413) "fbserver" 0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, abstime=0x7fd2eff32bf0, expected=0, 
    futex_word=0x7fd2f5ed7208) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  5    Thread 0x7fd2ef722700 (LWP 18414) "fbserver" 0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, abstime=0x7fd2ef721b40, expected=0, 
    futex_word=0x7fd2f5ed7268) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  6    Thread 0x7fd2ee720700 (LWP 18415) "fbserver" 0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, abstime=0x7fd2ee71fbf0, expected=0, 
    futex_word=0x7fd2f5e97208) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  7    Thread 0x7fd2edf1f700 (LWP 18416) "fbserver" 0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, abstime=0x7fd2edf1eb40, expected=0, 
    futex_word=0x7fd2f5e97268) at ../sysdeps/unix/sysv/linux/futex-internal.h:205

(gdb) thread apply all bt

Thread 7 (Thread 0x7fd2edf1f700 (LWP 18416)):
#0  0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, 
    abstime=0x7fd2edf1eb40, expected=0, futex_word=0x7fd2f5e97268)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x7fd2f5e97268, 
    abstime=abstime@entry=0x7fd2edf1eb40) at sem_waitcommon.c:111
#2  0x00007fd2f4e0cadf in __new_sem_wait_slow (sem=0x7fd2f5e97268, 
    abstime=0x7fd2edf1eb40) at sem_waitcommon.c:181
#3  0x00007fd2f4e0cb92 in sem_timedwait (sem=<optimized out>, 
    abstime=<optimized out>) at sem_timedwait.c:36
#4  0x0000000000732cb0 in ?? ()
#5  0x00000000006070a7 in ?? ()
#6  0x0000000000428235 in ?? ()
#7  0x00007fd2f4e046ba in start_thread (arg=0x7fd2edf1f700) at pthread_create.c:333
#8  0x00007fd2f4b3a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7fd2ee720700 (LWP 18415)):
#0  0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, 
    abstime=0x7fd2ee71fbf0, expected=0, futex_word=0x7fd2f5e97208)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x7fd2f5e97208, 
    abstime=abstime@entry=0x7fd2ee71fbf0) at sem_waitcommon.c:111
#2  0x00007fd2f4e0cadf in __new_sem_wait_slow (sem=0x7fd2f5e97208, 
    abstime=0x7fd2ee71fbf0) at sem_waitcommon.c:181
#3  0x00007fd2f4e0cb92 in sem_timedwait (sem=<optimized out>, 
    abstime=<optimized out>) at sem_timedwait.c:36
#4  0x0000000000732cb0 in ?? ()
#5  0x00000000004eefef in ?? ()
#6  0x0000000000428235 in ?? ()
#7  0x00007fd2f4e046ba in start_thread (arg=0x7fd2ee720700) at pthread_create.c:333
#8  0x00007fd2f4b3a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7fd2ef722700 (LWP 18414)):
#0  0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, 
    abstime=0x7fd2ef721b40, expected=0, futex_word=0x7fd2f5ed7268)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x7fd2f5ed7268, 
    abstime=abstime@entry=0x7fd2ef721b40) at sem_waitcommon.c:111
#2  0x00007fd2f4e0cadf in __new_sem_wait_slow (sem=0x7fd2f5ed7268, 
    abstime=0x7fd2ef721b40) at sem_waitcommon.c:181
#3  0x00007fd2f4e0cb92 in sem_timedwait (sem=<optimized out>, 
    abstime=<optimized out>) at sem_timedwait.c:36
#4  0x0000000000732cb0 in ?? ()
---Type <return> to continue, or q <return> to quit---
#5  0x00000000006070a7 in ?? ()
#6  0x0000000000428235 in ?? ()
#7  0x00007fd2f4e046ba in start_thread (arg=0x7fd2ef722700) at pthread_create.c:333
#8  0x00007fd2f4b3a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7fd2eff33700 (LWP 18413)):
#0  0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, 
    abstime=0x7fd2eff32bf0, expected=0, futex_word=0x7fd2f5ed7208)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x7fd2f5ed7208, 
    abstime=abstime@entry=0x7fd2eff32bf0) at sem_waitcommon.c:111
#2  0x00007fd2f4e0cadf in __new_sem_wait_slow (sem=0x7fd2f5ed7208, 
    abstime=0x7fd2eff32bf0) at sem_waitcommon.c:181
#3  0x00007fd2f4e0cb92 in sem_timedwait (sem=<optimized out>, 
    abstime=<optimized out>) at sem_timedwait.c:36
#4  0x0000000000732cb0 in ?? ()
#5  0x00000000004eefef in ?? ()
#6  0x0000000000428235 in ?? ()
#7  0x00007fd2f4e046ba in start_thread (arg=0x7fd2eff33700) at pthread_create.c:333
#8  0x00007fd2f4b3a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fd2f1a65700 (LWP 18407)):
#0  0x00007fd2f4e0ca15 in futex_abstimed_wait_cancelable (private=0, 
    abstime=0x7fd2f1a64e40, expected=0, futex_word=0x7fd2f60061a0)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x7fd2f60061a0, 
    abstime=abstime@entry=0x7fd2f1a64e40) at sem_waitcommon.c:111
#2  0x00007fd2f4e0cadf in __new_sem_wait_slow (sem=0x7fd2f60061a0, 
    abstime=0x7fd2f1a64e40) at sem_waitcommon.c:181
#3  0x00007fd2f4e0cb92 in sem_timedwait (sem=<optimized out>, 
    abstime=<optimized out>) at sem_timedwait.c:36
#4  0x0000000000732cb0 in ?? ()
#5  0x00000000006338cc in ?? ()
#6  0x0000000000633989 in ?? ()
#7  0x0000000000428235 in ?? ()
#8  0x00007fd2f4e046ba in start_thread (arg=0x7fd2f1a65700) at pthread_create.c:333
#9  0x00007fd2f4b3a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fd2f273b700 (LWP 18406)):
#0  0x00007fd2f4e0c827 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, 
    expected=0, futex_word=0x7fd2f6066e50)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x7fd2f6066e50, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007fd2f4e0c8d4 in __new_sem_wait_slow (sem=0x7fd2f6066e50, abstime=0x0)
---Type <return> to continue, or q <return> to quit---
    at sem_waitcommon.c:181
#3  0x00007fd2f4e0c97a in __new_sem_wait (sem=<optimized out>) at sem_wait.c:29
#4  0x0000000000732bc2 in ?? ()
#5  0x000000000042bf59 in ?? ()
#6  0x0000000000428235 in ?? ()
#7  0x00007fd2f4e046ba in start_thread (arg=0x7fd2f273b700) at pthread_create.c:333
#8  0x00007fd2f4b3a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7fd2f606a740 (LWP 18405)):
#0  0x00007fd2f4b2e74d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00000000006dc7da in ?? ()
#2  0x0000000000414407 in ?? ()
#3  0x000000000040a5ad in ?? ()
#4  0x00007fd2f4a53830 in __libc_start_main (main=0x4074f0, argc=1, 
    argv=0x7ffda4e76ff8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffda4e76fe8) at ../csu/libc-start.c:291
#5  0x0000000000409d89 in ?? ()