Hi All,

I've built  FB from the source code (v. 2.5.2.26540-0) on HP-UX IA64
(Itanium).

This is my setup: HP-UX ia64, HP C/aC++ B3910B A.06.25

My settings:
export CC=cc
export CXX=aCC
export CFLAGS=+DD64
export CFLAGS=+DD64

./configure --enable-debug=yes

Resolving a few build issues, I've been able to build create_db, but
similar to a situation which I had building FB on AIX (see corresponding
discussion) it produced a core dump:

Pid 14664 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.

I checked corresponding system settings using kctune and swapinfo, and it
looked OK.
I started debugging and figure out that during creation of static object
GlobalPtr<IntlUtil::Utf8CharSet> IntlUtil::utf8CharSet
(.../jrd/IntlUtil.cpp), the assert fb_assert(keySet) is met at
.../common/classes/fb_tls.h:129 during a call of TLS_GET macro at
.../common/classes/alloc.cpp:300.
Then this assert is supposed to be stored into the log, and during that
TLS_GET called again, then, in turn assert happens again, etc. recursively.
Finally, it kills the stack (I've attached a file with stack details).

In my understanding, it happens 'cause TLS_GET uses FB's own implementation
of TLS instead of the one provided by the system compiler.

In file .../src/include/gen/autoconfig.h, corresponding macro is defined:

/* Define it if compiler supports ISO syntax for thread-local storage */
#define HAVE___THREAD 1

which means that the system supports it.

Also, there is another comment in fb_tls.h:

#if defined(HAVE___THREAD)
// Recent GCC supports __thread keyword. Sun compiler and HP-UX should have
it too
# define TLS_DECLARE(TYPE, NAME) __thread TYPE NAME
# define TLS_GET(NAME) NAME

But all this is in contradiction with definition in file
.../src/common/classes/common.h:

#if defined (__HP_aCC)
// aCC error, __thread can be used only with C-like structs
#undef HAVE___THREAD
#endif

Having that, my suggestion was to comment the line "#undef HAVE___THREAD".
After that I've been able to finalize a build successfully and pass basic
tests.

Thanks,

Vadim.
STACK 1 - before core dump:
---
Stack at this point:
2031            MemoryPool* p = MemoryPool::getContextPool();
(gdb) where
#0  Firebird::AutoStorage::getAutoMemoryPool ()
    at ../src/common/classes/alloc.cpp:2031
#1  0x4000000001263690:2 in inline Firebird::AutoStorage::AutoStorage() ()
    at ../src/include/../common/classes/alloc.h:588
#2  0x4000000001263690:0 in inline Firebird::InlineStorage<unsigned 
short,(unsigned long)256>::InlineStorage() ()
    at ../src/jrd/../jrd/../common/classes/array.h:42
#3  0x4000000001263690:0 in inline Firebird::Array<unsigned 
short,Firebird::InlineStorage<unsigned short,(unsigned long)256> >::Array() ()
    at ../src/jrd/../jrd/../common/classes/array.h:83
#4  0x4000000001263680:0 in inline Firebird::HalfStaticArray<unsigned 
short,(unsigned long)256>::HalfStaticArray() (this=0x9fffffffffffe900)
    at ../src/jrd/../jrd/../common/classes/array.h:466
#5  0x4000000001263670:2 in inline Firebird::Aligner<unsigned 
short>::Aligner(unsigned char const*,unsigned int) (this=0x9fffffffffffe900, 
len=2,
    buf=0x4000000000500d92 "") at ../src/jrd/../common/classes/Aligner.h:95
#6  0x4000000001263660:0 in Firebird::IntlUtil::cvtUtf16ToUtf8 (
    obj=0x6000000000100ff0, nSrc=2, ppSrc=0x4000000000500d92 "", nDest=4,
    pDest=0x6000000000100f08 
"\376\355\253\355\376\355\253\355\376\355\253\355\376\355\253\355", 
err_code=0x9fffffffffffeb30, err_position=0x9fffffffffffeb34)
    at ../src/jrd/IntlUtil.cpp:385
#7  0x40000000008c24e0:0 in Jrd::CsConvert::convert (this=0x9fffffffffffeea0,
    srcLen=2, src=0x4000000000500d92 "", dstLen=4,
---Type <return> to continue, or q <return> to quit---
    dst=0x6000000000100f08 
"\376\355\253\355\376\355\253\355\376\355\253\355\376\355\253\355", 
badInputPos=0x0, ignoreTrailingSpaces=false)
    at ../src/jrd/../jrd/../jrd/CsConvert.h:199
#8  0x400000000112d730:2 in inline Jrd::CsConvert::convert(unsigned 
int,unsigned short const*,unsigned int,unsigned char*,unsigned int*,bool) ()
    at ../src/jrd/../jrd/../jrd/CsConvert.h:89
#9  0x400000000112d5b0:1 in inline Jrd::CharSet::CharSet(unsigned 
short,charset*) () at ../src/jrd/../jrd/../jrd/CharSet.h:58
#10 0x400000000112d560:0 in inline MultiByteCharSet::MultiByteCharSet(unsigned 
short,charset*) (this=0x6000000000100ef0, _id=4, _cs=0x6000000000100f38)
    at ../src/jrd/CharSet.cpp:118
#11 0x400000000112d4a0:0 in Jrd::CharSet::createInstance (
    pool=@0x60000000000f2d20, id=4, cs=0x6000000000100f38)
    at ../src/jrd/CharSet.cpp:246
#12 0x400000000126e040:0 in Firebird::IntlUtil::Utf8CharSet::Utf8CharSet (
    this=0x6000000000100f38, pool=@0x60000000000f2d20)
    at ../src/jrd/IntlUtil.cpp:82
#13 0x400000000126e6f0:2 in inline 
Firebird::GlobalPtr<Firebird::IntlUtil::Utf8CharSet>::GlobalPtr() () at 
../src/jrd/../jrd/../common/classes/init.h:127
#14 0x400000000126e5d0:2 in __sinit_IntlUtil_cpp_+0x112 ()
    at ../src/jrd/IntlUtil.cpp:77
#15 0x9fffffffef7a8ce0:0 in EM_mark_BOS+0x50 () from /usr/lib/hpux64/dld.so
(gdb)


STACK 1 - after core dump
---
Program received signal SIGSEGV, Segmentation fault
  si_code: 1 - SEGV_MAPERR - Address not mapped to object.
Firebird::MemoryPool::getContextPool () at ../src/common/classes/alloc.cpp:299
299     {
(gdb) where
#0  Firebird::MemoryPool::getContextPool ()
    at ../src/common/classes/alloc.cpp:299
#1  0x400000000058d480:0 in Firebird::AutoStorage::getAutoMemoryPool ()
    at ../src/common/classes/alloc.cpp:2031
#2  0x40000000005bc190:2 in inline Firebird::AutoStorage::AutoStorage() ()
    at ../src/include/../common/classes/alloc.h:588
#3  0x40000000005bc180:1 in inline Firebird::AbstractString::AbstractString()
    () at ../src/common/../common/../common/classes/fb_string.h:159
#4  0x40000000005bc170:1 in 
Firebird::StringBase<Firebird::PathNameComparator>::StringBase 
(this=0x9ffffffffdce5ef0)
    at ../src/common/../common/../common/classes/fb_string.h:609
#5  0x40000000005c15c0:0 in fb_utils::getPrefix (
    No.Identifier_5=0x9ffffffffdce6420, prefType=fb_utils::FB_DIR_LOG,
    name=0x400000000033a6e0 "firebird.log") at ../src/common/utils.cpp:926
#6  0x40000000005fbde0:0 in gds__log (
    text=0x4000000000322b60 "Assertion (%s) failure: %s %ld\n")
    at ../src/jrd/gds.cpp:1188
#7  0x400000000057f110:2 in inline 
Firebird::TlsValue<Firebird::MemoryPool*>::get() (this=0x60000000000d7540) at 
../src/include/../common/classes/fb_tls.h:129
#8  0x400000000057f0b0:0 in Firebird::MemoryPool::getContextPool ()
    at ../src/common/classes/alloc.cpp:300
#9  0x400000000058d480:0 in Firebird::AutoStorage::getAutoMemoryPool ()
    at ../src/common/classes/alloc.cpp:2031
---Type <return> to continue, or q <return> to quit---
#10 0x40000000005bc190:2 in inline Firebird::AutoStorage::AutoStorage() ()
    at ../src/include/../common/classes/alloc.h:588
#11 0x40000000005bc180:1 in inline Firebird::AbstractString::AbstractString()
    () at ../src/common/../common/../common/classes/fb_string.h:159
#12 0x40000000005bc170:1 in 
Firebird::StringBase<Firebird::PathNameComparator>::StringBase 
(this=0x9ffffffffdce68b0)
    at ../src/common/../common/../common/classes/fb_string.h:609
#13 0x40000000005c15c0:0 in fb_utils::getPrefix (
    No.Identifier_5=0x9ffffffffdce6de0, prefType=fb_utils::FB_DIR_LOG,
    name=0x400000000033a6e0 "firebird.log") at ../src/common/utils.cpp:926
#14 0x40000000005fbde0:0 in gds__log (
    text=0x4000000000322b60 "Assertion (%s) failure: %s %ld\n")
    at ../src/jrd/gds.cpp:1188
#15 0x400000000057f110:2 in inline 
Firebird::TlsValue<Firebird::MemoryPool*>::get() (this=0x60000000000d7540) at 
../src/include/../common/classes/fb_tls.h:129
#16 0x400000000057f0b0:0 in Firebird::MemoryPool::getContextPool ()
    at ../src/common/classes/alloc.cpp:300
#17 0x400000000058d480:0 in Firebird::AutoStorage::getAutoMemoryPool ()
    at ../src/common/classes/alloc.cpp:2031
#18 0x40000000005bc190:2 in inline Firebird::AutoStorage::AutoStorage() ()
    at ../src/include/../common/classes/alloc.h:588
#19 0x40000000005bc180:1 in inline Firebird::AbstractString::AbstractString()
    () at ../src/common/../common/../common/classes/fb_string.h:159
---Type <return> to continue, or q <return> to quit---
#20 0x40000000005bc170:1 in 
Firebird::StringBase<Firebird::PathNameComparator>::StringBase 
(this=0x9ffffffffdce7270)
    at ../src/common/../common/../common/classes/fb_string.h:609
#21 0x40000000005c15c0:0 in fb_utils::getPrefix (
    No.Identifier_5=0x9ffffffffdce77a0, prefType=fb_utils::FB_DIR_LOG,
    name=0x400000000033a6e0 "firebird.log") at ../src/common/utils.cpp:926
#22 0x40000000005fbde0:0 in gds__log (
    text=0x4000000000322b60 "Assertion (%s) failure: %s %ld\n")
    at ../src/jrd/gds.cpp:1188
#23 0x400000000057f110:2 in inline 
Firebird::TlsValue<Firebird::MemoryPool*>::get() (this=0x60000000000d7540) at 
../src/include/../common/classes/fb_tls.h:129
#24 0x400000000057f0b0:0 in Firebird::MemoryPool::getContextPool ()
    at ../src/common/classes/alloc.cpp:300
#25 0x400000000058d480:0 in Firebird::AutoStorage::getAutoMemoryPool ()
    at ../src/common/classes/alloc.cpp:2031
#26 0x40000000005bc190:2 in inline Firebird::AutoStorage::AutoStorage() ()
    at ../src/include/../common/classes/alloc.h:588
#27 0x40000000005bc180:1 in inline Firebird::AbstractString::AbstractString()
    () at ../src/common/../common/../common/classes/fb_string.h:159
#28 0x40000000005bc170:1 in 
Firebird::StringBase<Firebird::PathNameComparator>::StringBase 
(this=0x9ffffffffdce7c30)
    at ../src/common/../common/../common/classes/fb_string.h:609
#29 0x40000000005c15c0:0 in fb_utils::getPrefix (
---Type <return> to continue, or q <return> to quit---
    No.Identifier_5=0x9ffffffffdce8160, prefType=fb_utils::FB_DIR_LOG,
    name=0x400000000033a6e0 "firebird.log") at ../src/common/utils.cpp:926
#30 0x40000000005fbde0:0 in gds__log (
    text=0x4000000000322b60 "Assertion (%s) failure: %s %ld\n")
    at ../src/jrd/gds.cpp:1188
#31 0x400000000057f110:2 in inline 
Firebird::TlsValue<Firebird::MemoryPool*>::get() (this=0x60000000000d7540) at 
../src/include/../common/classes/fb_tls.h:129
#32 0x400000000057f0b0:0 in Firebird::MemoryPool::getContextPool ()
    at ../src/common/classes/alloc.cpp:300
#33 0x400000000058d480:0 in Firebird::AutoStorage::getAutoMemoryPool ()
    at ../src/common/classes/alloc.cpp:2031
#34 0x40000000005bc190:2 in inline Firebird::AutoStorage::AutoStorage() ()
    at ../src/include/../common/classes/alloc.h:588
#35 0x40000000005bc180:1 in inline Firebird::AbstractString::AbstractString()
    () at ../src/common/../common/../common/classes/fb_string.h:159
#36 0x40000000005bc170:1 in 
Firebird::StringBase<Firebird::PathNameComparator>::StringBase 
(this=0x9ffffffffdce85f0)
    at ../src/common/../common/../common/classes/fb_string.h:609
#37 0x40000000005c15c0:0 in fb_utils::getPrefix (
    No.Identifier_5=0x9ffffffffdce8b20, prefType=fb_utils::FB_DIR_LOG,
    name=0x400000000033a6e0 "firebird.log") at ../src/common/utils.cpp:926
#38 0x40000000005fbde0:0 in gds__log (
    text=0x4000000000322b60 "Assertion (%s) failure: %s %ld\n")
---Type <return> to continue, or q <return> to quit---
---
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to