Hi All,

I'm trying to built  FB from the source code v. 2.5.2.26540-0 on AIX 6.1
(PPC). I've made some minor changes in the build script to let it create
./configure script, also a couple of source code files slightly changed
(mostly to avoid conflicts).
But now I'm facing a problem - attempt to create/access to DB file causes
core dump in Jrd::LockManager::attach_shared_file() function.
Actually, it happens during the build when empty.fdb and other DB files are
created. Manually retrying create_db I can get all all .fdb files created
(files are created in spite of  core dump).

AIX 6.1 PPC, IBM XL C/C++ for AIX, V12.1

My settings:
export CC=xlc_r
export CXX=xlC_r
export CFLAGS="-q64 -gxlc -D_REENTRANT"
export CXXFLAGS="-q64 -gxlC D_REENTRANT"

./autogen.sh --enable-debug=yes

Also I set FIREBIRD to .../firebird, FIREBIRD_LOCK to one of temp folders,
and LIBPATH (LD_LIBRARY_PATH) to .../firebird/lib

I'd like to share some results of debugging.

Assert happens after the following sequence of function calls (in create_db
exec):
 main at lineline 49 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/utilities/create_db.cpp"
($t1)
 49           isc_attach_database(sv, 0, argv[1], &db,
dpb.getBufferLength(),
-->
 jrd8_attach_database at line 1039 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/jrd/jrd.cpp" ($t1)
 1039                   dbb->dbb_lock_mgr =
LockManager::create(dbb->getUniqueFileId());
--->

 Jrd::LockManager::create(const
Firebird::StringBase<Firebird::StringComparator>&) at line 182 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/lock/lock.cpp"
($t1)
  182                   lockMgr = new LockManager(id);
--->
 Jrd::LockManager::LockManager(const
Firebird::StringBase<Firebird::StringComparator>&) at line 232 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/lock/lock.cpp"
($t1)
  232           if (!attach_shared_file(local_status))
--->
Jrd::LockManager::attach_shared_file(long*)(this = 0x0700000000006df0,
status = 0x0fffffffffffe680), line 339 in "lock.cpp"
--->
ISC_map_file(long*,const char*,void(*)(void*,sh_mem*,bool),void*,unsigned
int,sh_mem*) at line 2335 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/jrd/isc_sync.cpp"
($t1)
 2335           gds__prefix_lock(expanded_filename, filename);
...
ISC_map_file(long*,const char*,void(*)(void*,sh_mem*,bool),void*,unsigned
int,sh_mem*)(status_vector = 0x0fffffffffffe680, filename =
"fb_lock_80000030000000010000000001619004", init_routine =
0x000000011018c928, init_arg = 0x0700000000006df0, length = 1048576,
shmem_data = 0x0700000000006e20), line 2526 in "isc_sync.cpp"
<---
Jrd::LockManager::attach_shared_file(long*)(this = 0x0700000000006df0,
status = 0x0fffffffffffe680), line 341 in "lock.cpp"

After that point, m_header (and it's lhb_version field):
(dbx) n
stopped in Jrd::LockManager::attach_shared_file(long*) at line 341 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/lock/lock.cpp"
($t1)
  341           if (!m_header)
(dbx) p *m_header
(lhb_type = '^G', *lhb_version = '\0'*, lhb_secondary = 139264,
lhb_active_owner = 1, lhb_owners = (srq_forward = 8769248, srq_backward =
1), lhb_processes = (srq_forward = 5283304, srq_backward = 117440512),
lhb_free_processes = (srq_forward = 28144, srq_backward = 1),
lhb_free_owners = (srq_forward = 268503808, srq_backward = 117440512),
lhb_free_locks = (srq_forward = 93728, srq_backward = 2621504),
lhb_free_requests = (srq_forward = 29392, srq_backward = 0), lhb_length =
1320, lhb_used = 1, lhb_hash_slots = 56, lhb_flags = 43932, lhb_mutex =
(mtx_mutex = (
(__mt_word = (504403158265589406, 504403158265523696, 4563807096,
1152921504606840656, 1152921504606842736, 4295013508, 675840, 8))
)), lhb_history = 0, lhb_scan_interval = 8, lhb_acquire_spins = 117440512,
lhb_acquires = 1328, lhb_acquire_blocks = 0, lhb_acquire_retries = 0,
lhb_retry_success = 0, lhb_enqs = 0, lhb_converts = 0, lhb_downgrades = 0,
lhb_deqs = 0, lhb_read_data = 0, lhb_write_data = 0, lhb_query_data = 0,
lhb_operations = (0, 0, 0, 0, 0, 0, 0), lhb_waits = 0, lhb_denies = 0,
lhb_timeouts = 0, lhb_blocks = 0, lhb_wakeups = 0, lhb_scans = 0,
lhb_deadlocks = 0, lhb_data = (
(srq_forward = 352, srq_backward = 352)
(srq_forward = 360, srq_backward = 360)
(srq_forward = 368, srq_backward = 368)
(srq_forward = 376, srq_backward = 376)
(srq_forward = 384, srq_backward = 384)
(srq_forward = 392, srq_backward = 392)
(srq_forward = 400, srq_backward = 400)
), lhb_hash = (
(srq_forward = 408, srq_backward = 408)
))

But according to lock_proto.h (line line 107 and above), lhb_version should
be equal to LHB_VERSION = PLATFORM_LHB_VERSION + BASE_LHB_VERSION, i.e.
128+17 = 145 decimal, or 221 octal.
Actually, this is the value of lhb_version field which I see during
previous call of LockManager::attach_shared_file (during execution of
isc_create_database(), line 22 in create_db.cpp file):

(dbx) where
Jrd::LockManager::create(const
Firebird::StringBase<Firebird::StringComparator>&)(id = &(...)), line 177
in "lock.cpp"
unnamed block in jrd8_create_database(user_status = 0x0ffffffffffff6f0,
filename =
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/empty.fdb", handle =
0x0ffffffffffff388, dpb_length = 14, dpb = "^AM"), line 2135 in "jrd.cpp"
jrd8_create_database(user_status = 0x0ffffffffffff6f0, filename =
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/empty.fdb", handle =
0x0ffffffffffff388, dpb_length = 14, dpb = "^AM"), line 2135 in "jrd.cpp"
unnamed block in isc_create_database(user_status = 0x0ffffffffffff6f0,
file_length = 0, file_name = "empty.fdb", public_handle =
0x0ffffffffffff790, dpb_length = 0, dpb = (nil),  = 0), line 2069 in
"why.cpp"
isc_create_database(user_status = 0x0ffffffffffff6f0, file_length = 0,
file_name = "empty.fdb", public_handle = 0x0ffffffffffff790, dpb_length =
0, dpb = (nil),  = 0), line 2069 in "why.cpp"
main(argc = 2, argv = 0x0ffffffffffff930), line 22 in "create_db.cpp"
(dbx) c
[2] stopped in Jrd::LockManager::LockManager(const
Firebird::StringBase<Firebird::StringComparator>&) at line 232 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/lock/lock.cpp"
($t1)
  232           if (!attach_shared_file(local_status))
(dbx) c
[1] stopped in Jrd::LockManager::attach_shared_file(long*) at line 337 in
file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/lock/lock.cpp"
($t1)
  337           get_shared_file_name(name);
(dbx) n
stopped in Jrd::LockManager::attach_shared_file(long*) at line 339 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/lock/lock.cpp"
($t1)
  339           m_header = (lhb*) ISC_map_file(status, name.c_str(),
initialize, this, m_memorySize, &m_shmem);
(dbx) n
stopped in Jrd::LockManager::attach_shared_file(long*) at line 341 in file
"/export/home/ilmbuild/TEST/FB/Firebird-2.5.2.26540-0/src/lock/lock.cpp"
($t1)
  341           if (!m_header)
(dbx) p *m_header
(lhb_type = '^A', *lhb_version = '\221'*, lhb_secondary = 8488,
lhb_active_owner = 0, lhb_owners = (srq_forward = 12, srq_backward = 12),
lhb_processes = (srq_forward = 20, srq_backward = 20), lhb_free_processes =
(srq_forward = 28, srq_backward = 28), lhb_free_owners = (srq_forward = 36,
srq_backward = 36), lhb_free_locks = (srq_forward = 44, srq_backward = 44),
lhb_free_requests = (srq_forward = 52, srq_backward = 52), lhb_length =
1048576, lhb_used = 20800, lhb_hash_slots = 1009, lhb_flags = 1, lhb_mutex
= (mtx_mutex = (
(__mt_word = (0, 0, 0, 0, 1029, 5, 0, 0))
)), lhb_history = 8512, lhb_scan_interval = 10, lhb_acquire_spins = 0,
lhb_acquires = 0, lhb_acquire_blocks = 0, lhb_acquire_retries = 0,
lhb_retry_success = 0, lhb_enqs = 0, lhb_converts = 0, lhb_downgrades = 0,
lhb_deqs = 0, lhb_read_data = 0, lhb_write_data = 0, lhb_query_data = 0,
lhb_operations = (0, 0, 0, 0, 0, 0, 0), lhb_waits = 0, lhb_denies = 0,
lhb_timeouts = 0, lhb_blocks = 0, lhb_wakeups = 0, lhb_scans = 0,
lhb_deadlocks = 0, lhb_data = (
(srq_forward = 352, srq_backward = 352)
(srq_forward = 360, srq_backward = 360)
(srq_forward = 368, srq_backward = 368)
(srq_forward = 376, srq_backward = 376)
(srq_forward = 384, srq_backward = 384)
(srq_forward = 392, srq_backward = 392)
(srq_forward = 400, srq_backward = 400)
), lhb_hash = (
(srq_forward = 408, srq_backward = 408)
))

Continue my debugging. Any ideas would be appreciated.
Thanks!
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to