Hi,

I've been chasing this for some time, and finally I've come (with help 
from others) to a environment which makes the segfault relatively easy 
to reproduce, although it still requires patience.

Everything happens on a POSIX (Debian testing or unstable) system. On a fast
(3GHz) single-threaded single-core virtual machine (qemu-kvm). This is the
important part, slow CPU or multi-core environments makes the segfault go away.

This is a freshly built firebird 3.0.1.32609 using
CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security
CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2
CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security
LDFLAGS=-Wl,-z,relro -Wl,-z,now

Below is a backtrace from the following command:

 echo "show tables;" | $ISQL $FB_IMG/examples/empbuild/employee.fdb

I had t run it in a loop for about 2 minutes time before the problem showed
itself.

FB_IMG=gen/Release/firebird
ISQL="$FB_IMG/bin/isql -user SYSDBA"

and the following variables are exported in the environment:

 FIREBIRD=gen/Release/firebird
 LD_LIBRARY_PATH=gen/Release/firebird/lib
 FIREBIRD_MSG=gen/Release/firebird

A core file may be downloaded from https://people.debian.org/~dmn/fb-core.xz
(124KB)

I browsed the commits in the B3_0_Release branch, but none seemed to touch any
code that seems relevant to me.

Any help is appreciated. This got reported twice in the Debian bug-tracker,
once for the firebird3.0 package (https://bugs.debian.org/846392) and in
libdbd-firebird-perl (firebird driver for Perl -
https://bugs.debian.org/847288)

Thank you,
        Damyan

Thread 3 (Thread 0x7f0bca6f3500 (LWP 15517)):
#0  0x00007f0bc8923b77 in sched_yield () at 
../sysdeps/unix/syscall-template.S:84
#1  0x00007f0bca23453a in Thread::yield () at ./src/common/ThreadStart.cpp:244
#2  0x00007f0bca19e115 in Why::Dispatcher::shutdown 
(this=this@entry=0x7f0bca6e3ee0, userStatus=userStatus@entry=0x7ffc95def0e0, 
    timeout=timeout@entry=5000, reason=reason@entry=-7) at 
./src/yvalve/why.cpp:5923
#3  0x00007f0bca19ed05 in fb_shutdown (timeout=timeout@entry=5000, 
reason=reason@entry=-7) at ./src/yvalve/why.cpp:3725
#4  0x00007f0bca1ca268 in Firebird::PluginManager::unregisterModule 
(this=<optimized out>, cleanup=0x7f0bc5d58578)
    at ./src/yvalve/PluginManager.cpp:1060
#5  0x00007f0bca1d1749 in 
Firebird::IPluginManagerBaseImpl<Firebird::PluginManager, 
Firebird::CheckStatusWrapper, Firebird::IVersionedImpl<Firebird::PluginManager, 
Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IPluginManager> > 
>::cloopunregisterModuleDispatcher (
    self=<optimized out>, cleanup=<optimized out>) at 
./src/include/firebird/IdlFbInterfaces.h:6450
#6  0x00007f0bc5dbaacb in Firebird::IPluginManager::unregisterModule 
(cleanup=0x7f0bc5d58578, this=<optimized out>)
    at ./src/include/firebird/IdlFbInterfaces.h:804
#7  Firebird::UnloadDetectorHelper::~UnloadDetectorHelper (this=0x7f0bc5d58570, 
__in_chrg=<optimized out>)
    at ./src/include/../common/classes/ImplementHelper.h:295
#8  Firebird::UnloadDetectorHelper::~UnloadDetectorHelper (this=0x7f0bc5d58570, 
__in_chrg=<optimized out>)
    at ./src/include/../common/classes/ImplementHelper.h:298
#9  Firebird::GlobalPtr<Firebird::UnloadDetectorHelper, 
(Firebird::InstanceControl::DtorPriority)1>::dtor (
    this=0x7f0bc5feaf18 <(anonymous namespace)::myModule>) at 
./src/include/../common/classes/init.h:124
#10 
Firebird::InstanceControl::InstanceLink<Firebird::GlobalPtr<Firebird::UnloadDetectorHelper,
 (Firebird::InstanceControl::DtorPriority)1>, 
(Firebird::InstanceControl::DtorPriority)1>::dtor (this=0x7f0bc5d585a8) at 
./src/include/../common/classes/init.h:98
#11 0x00007f0bc5dba4bc in Firebird::InstanceControl::InstanceList::destructors 
() at ./src/common/classes/init.cpp:231
#12 0x00007f0bc5dba566 in Firebird::InstanceControl::destructors () at 
./src/common/classes/init.cpp:212
#13 0x00007f0bc5dba6cc in (anonymous namespace)::allClean () at 
./src/common/classes/init.cpp:87
#14 (anonymous namespace)::Cleanup::~Cleanup (this=<optimized out>, 
__in_chrg=<optimized out>) at ./src/common/classes/init.cpp:118
#15 0x00007f0bc8887920 in __run_exit_handlers (status=0, listp=0x7f0bc8bea5d8 
<__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, 
    run_dtors=run_dtors@entry=true) at exit.c:83
#16 0x00007f0bc888797a in __GI_exit (status=<optimized out>) at exit.c:105
#17 0x00007f0bc88722b8 in __libc_start_main (main=0x55ecc06124f0 <main(int, 
char**)>, argc=4, argv=0x7ffc95def488, init=<optimized out>, 
    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc95def478) 
at ../csu/libc-start.c:325
#18 0x000055ecc061289a in _start ()

Thread 2 (Thread 0x7f0bc8433700 (LWP 15518)):
#0  0x00007f0bc8bff577 in futex_abstimed_wait_cancelable (private=0, 
abstime=0x0, expected=0, futex_word=0x7f0bca6e12d0)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x7f0bca6e12d0, abstime=0x0) at 
sem_waitcommon.c:111
#2  0x00007f0bc8bff624 in __new_sem_wait_slow (sem=0x7f0bca6e12d0, abstime=0x0) 
at sem_waitcommon.c:181
#3  0x00007f0bc8bff6b9 in __new_sem_wait (sem=sem@entry=0x7f0bca6e12d0) at 
sem_wait.c:29
#4  0x00007f0bca259132 in Firebird::SignalSafeSemaphore::enter 
(this=0x7f0bca6e12d0) at ./src/common/classes/semaphore.cpp:163
#5  0x00007f0bca19f01d in (anonymous namespace)::shutdownThread () at 
./src/yvalve/why.cpp:810
#6  0x00007f0bca23459e in (anonymous namespace)::ThreadArgs::run 
(this=<synthetic pointer>) at ./src/common/ThreadStart.cpp:78
#7  (anonymous namespace)::threadStart (arg=0x7f0bca6e1308) at 
./src/common/ThreadStart.cpp:93
#8  0x00007f0bc8bf7464 in start_thread (arg=0x7f0bc8433700) at 
pthread_create.c:333
#9  0x00007f0bc893a9df in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:105

Thread 1 (Thread 0x7f0bc2377700 (LWP 15521)):
#0  0x00007f0bc6cec864 in ?? ()
#1  0x0000000000000000 in ?? ()


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to