dbTalk Databases Forums  

set_thread_id and error with env close

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss set_thread_id and error with env close in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mshyam2@gmail.com
 
Posts: n/a

Default set_thread_id and error with env close - 03-07-2006 , 02:39 PM






Hi,

If I set a callback using set_thread_id, I always get an error while
closing the env. The stack is at the end of the email.
I looked into the bdb source code and it looks like a bug to me. But I
am not sure.

DbEnv::close calls:
cleanup()
env->close(env, flags))

The call to cleanup sets the internal env representation to NULL.
Finally when DbEnv::_thread_id_intercept is called as shown in the
stack below, the env is null and it will always throws an exception.

This doesn't happen if I don't set a callback using set_thread_id. In
that case DbEnv::_thread_id_intercept is not called, instead the
default implementation __os_id is called.


#0 0x415d5ae1 in __kill () at __kill:-1
#1 0x409c876b in raise (sig=6) at signals.c:65
#2 0x415d7062 in abort () at ../sysdeps/generic/abort.c:88
#3 0x4016c28b in __default_terminate () at ./libgcc2.c:-1
#4 0x4016c2ac in __terminate ()
from libdb_cxx-4.4.so
#5 0x4016cbe4 in throw_helper (eh=0x40196e50, pc=0x40117024,
my_udata=0xbfffee38, offset_p=0xbfffee34)
from libdb_cxx-4.4.so
#6 0x4016cd9c in __throw ()
from libdb_cxx-4.4.so
#7 0x40052309 in DbEnv::runtime_error (env=0x0, caller=0x401717e1
"DbEnv::thread_id_callback", error=22, error_policy=1)
at ../dist/../cxx/cxx_env.cpp:589
#8 0x40050591 in DbEnv::_thread_id_intercept (env=0x806e160,
pidp=0xbfffefbc, thridp=0xbfffefc0) at ../dist/../cxx/cxx_env.cpp:226
#9 0x40050176 in _thread_id_intercept_c (env=0x806e160,
pidp=0xbfffefbc, thridp=0xbfffefc0) at ../dist/../cxx/cxx_env.cpp:132
#10 0x40117025 in __env_set_state (dbenv=0x806e160, ipp=0xbffff014,
state=THREAD_ACTIVE) at ../dist/../env/env_failchk.c:240
#11 0x4011a872 in __env_close_pp (dbenv=0x806e160, flags=0) at
.../dist/../env/env_open.c:666
#12 0x400508ce in DbEnv::close (this=0x806e0f8, flags=0) at
.../dist/../cxx/cxx_env.cpp:330
#13 0x40020d2e in NewEnv::close (this=0x806e0f8)
at NewEnv.cpp:50
#14 0x40020be0 in NewEnv::~NewEnv (this=0x806e0f8, __in_chrg=3)
at NewEnv.cpp:35
#15 0x0804e122 in CBdbTest::~CBdbTest (this=0xbffff134, __in_chrg=2)
at BdbTest.cpp:308
#16 0x0804dc50 in main (argc=14, argv=0xbffff234)
at BdbTest.cpp:263
#17 0x415c3627 in __libc_start_main (main=0x804dbc8 <main>, argc=14,
ubp_av=0xbffff234, init=0x804d3d4 <_init>, fini=0x805616c <_fini>,
rtld_fini=0x4000dcc4 <_dl_fini>, stack_end=0xbffff22c) at
.../sysdeps/generic/libc-start.c:129


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: set_thread_id and error with env close - 03-08-2006 , 12:18 AM






This is caused by a known bug in the C++ API introduced in DB 4.4. I
will send you a patch directly, since posting diffs to the newsgroup is
not very useful. If anyone else experiences this problem, please
contact Sleepycat Support.

Regards,
Michael.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.