473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Need help on rogue wave template classes..

I am using evaluation copy of RW 9.0 for porting one of C++
application on RHEL4 (x86 platform).
We are getting some issues into RW template classes. Please need
assistance on this issue.

Here is the problem:

Application is using below mentioned template class which is declared
at static in Engine.h

RWTPtrHashDictionary<RWCString, RuleClass RWDefHArgs(RWCString)>
Engine::ruleHash(RWCString::hash);

Above line definition is found in Engine.C at the beginning of the
file.

Here is sample piece of code where ruleHash is used. This code is
Engine.C. I am calling insertRule(this) static method from RuleClass.h
file.

Void Engine::insertRule( RuleClass* newRule )
{
RuleClass* rule = NULL;
if( 0 != ruleHash.entries() )
............
Core dump....

}

Application is using template object ruleHash to call entries()
method.
I am getting core dump at releHash.entries() line. Its not only with
entries method, it crashes for any methods of RWTPtrHashDictionary.
I have also tried with other template class RWTValDlist<RWCStringto
test whether it is problem with deprecated RWTPtrHashDictionary
template.
But I see that application crashes for RWTValDlist template too.

FYI: gdb output

(gdb) p ruleHash
$1 = {<RW_PMapAssoc<rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*,RWTPtrHashMap<RWCString, RuleClass,
RWTHasher<RWCString>, std::equal_to<RWCString>,
std::allocator<RWCString*,RWCString,RuleClass,std: :less<RWCString>
>= {<RW_PMapCntnr<rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*,RWTPtrHashMap<RWCString, RuleClass,
RWTHasher<RWCString>, std::equal_to<RWCString>,
std::allocator<RWCString*,RWCString,RuleClass>=
{<RW_PBase<rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*,RWTPtrHashMap<RWCString, RuleClass,
RWTHasher<RWCString>, std::equal_to<RWCString>,
std::allocator<RWCString* >= {<No data fields>}, <No data
fields>}, <No data fields>}, impl_ = {impl = {
listAllocator =
{<__gnu_cxx::new_allocator<rw_internal_pair_slist< std::pair<RWCString*
const, RuleClass*>, long unsigned int,
std::allocator<std::pair<std::pair<RWCString* const, RuleClass*>, long
unsigned int = {<No data fields>}, <No data fields>},
vectorAllocator =
{<__gnu_cxx::new_allocator<std::vector<LHashTable< std::pair<RWCString*
const, RuleClass*>, rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*::h_k, rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*::eq_k, std::allocator<RWCString*>
>::bucket_t, std::allocator<LHashTable<std::pair<RWCString* const,
RuleClass*>, rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*::h_k, rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*::eq_k, std::allocator<RWCString*>
>::bucket_t >= {<No data fields>}, <No data fields>}, list_ =
0x0, table_ = 0x0, eq_ = {eq_ =
{<std::binary_function<RWCString*,RWCString*,RWBoo lean>= {<No data
fields>},
cmp_ = {<std::binary_function<RWCString,RWCString,bool>=
{<No data fields>}, <No data fields>}}}, hash_ = {
h_ = {<std::unary_function<RWCString*,unsigned int>= {<No
data fields>}, hash_ = {hfun_ = 0}}}}}}
(gdb) bt
#0 0x08068308 in rw_slist<std::pair<std::pair<RWCString* const,
RuleClass*>, unsigned long>,
std::allocator<std::pair<std::pair<RWCString* const, RuleClass*>,
unsigned long >::size (this=0x0)
at /opt/RogueWave/SourcePro/Ed9_Eval/rw/stdex/slist.h:322
#1 0x08066c1f in LHashTable<std::pair<RWCString* const, RuleClass*>,
rw_hashmap<RWCString*, RuleClass*, rw_deref_hash<RWTHasher<RWCString>,
RWCString>, rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*::h_k, rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*::eq_k, std::allocator<RWCString*::size
(this=0x8436f50)
at /opt/RogueWave/SourcePro/Ed9_Eval/rw/stdex/lhash.h:586
#2 0x08064620 in rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*::size (this=0x8436f50)
at /opt/RogueWave/SourcePro/Ed9_Eval/rw/stdex/hashmap.h:256
#3 0x0806280b in RW_PBase<rw_hashmap<RWCString*, RuleClass*,
rw_deref_hash<RWTHasher<RWCString>, RWCString>,
rw_deref_compare<std::equal_to<RWCString>, RWCString>,
std::allocator<RWCString*, RWTPtrHashMap<RWCString, RuleClass,
RWTHasher<RWCString>, std::equal_to<RWCString>,
std::allocator<RWCString* >::entries (this=0x8436f50)
at /opt/RogueWave/SourcePro/Ed9_Eval/rw/ep_cntnr.h:82
#4 0x08060c8d in RuleEngine::insertRule (newRule=0x84373f8) at
RuleEngine.C:179
#5 0x0806fe20 in RuleClass (this=0x84373f8, ruleName=@0xbff2a2e0) at /
common/Rule/inc/RuleClass.h:30
#6 0x08080dac in ServiceLevelRule (this=0x84373f8) at /common/Rule/
inc/ServiceLevelRule.h:37
#7 0x08080887 in __static_initialization_and_destruction_0
(__initialize_p=1, __priority=65535)
at /common/Rule/src/ServiceLevelRule.C:15
#8 0x08080cd9 in global constructors keyed to
_ZN16ServiceLevelRule7executeER7Package ()
at /common/Rule/src/ServiceLevelRule.C:179
#9 0x0837c9a1 in __do_global_ctors_aux ()
#10 0x0805139d in _init ()
#11 0x0837c90a in __libc_csu_init ()
#12 0x03517d91 in __libc_start_main () from /lib/tls/libc.so.6
#13 0x080526e1 in _start ()
(gdb)
Please need help on this. Is it problem with initilizing the static
variables?. I am waiting for you reply.
Thanks & Regards,
Prakash

May 28 '07 #1
5 2981
pr***********@gmail.com a écrit :[snip]
Here is the problem:

Application is using below mentioned template class which is declared
at static in Engine.h

RWTPtrHashDictionary<RWCString, RuleClass RWDefHArgs(RWCString)>
Engine::ruleHash(RWCString::hash);

Above line definition is found in Engine.C at the beginning of the
file.

Here is sample piece of code where ruleHash is used. This code is
Engine.C. I am calling insertRule(this) static method from RuleClass.h
file.

Void Engine::insertRule( RuleClass* newRule )
{
RuleClass* rule = NULL;
if( 0 != ruleHash.entries() )
............
Core dump....

}
[snip]
#10 0x0805139d in _init ()
#11 0x0837c90a in __libc_csu_init ()
#12 0x03517d91 in __libc_start_main () from /lib/tls/libc.so.6
#13 0x080526e1 in _start ()
(gdb)
Please need help on this. Is it problem with initilizing the static
variables?. I am waiting for you reply.
It seems you have a static initialization order problem.

Use singleton pattern if you can or avoid using static initialisation of
object using another static object (ruleHash in this case).

Alternatively, you can swap the order of the object at final link to
ensure ruleHash is initialized first (not portable but that doesn't seem
to be an issue in your case).

Otherwise, have a look at your compiler's doc. They may have custom
procedures for this kind of problem.

Michael
May 28 '07 #2
Hi Prakash,

On May 28, 8:18 am, prakash.mi...@gmail.com wrote:
I am using evaluation copy of RW 9.0 for porting one of C++
application on RHEL4 (x86 platform).
The best place to ask questions about our SourcePro libraries,
especially the evaluation copies, is the Rogue Wave forum.
Alternatively, you can try our tech support -- they'll be more than
happy to assist you.
We are getting some issues into RW template classes. Please need
assistance on this issue.

Here is the problem:

Application is using below mentioned template class which is declared
at static in Engine.h

RWTPtrHashDictionary<RWCString, RuleClass RWDefHArgs(RWCString)>
Engine::ruleHash(RWCString::hash);

......
I believe the issue you are observing is not specific to the SourcePro
classes; judging by the appearance of the stack trace you are posting,
it seems it has to do with the structure of your program and it seems
it is an issue related to the order of initialization of objects with
static storage duration which are dependent on each other. FWIW, this
is a relatively frequent issue in the reports and requests for help we
are receiving from customers. You must employ an appropriate technique
to make sure your globals are initialized when you first use them.

This is the page with the relevant information on how to get support
from us:
http://www.roguewave.com/support/con....cfm#sourcepro

HTH,
Liviu

May 28 '07 #3
nikkoara a écrit :
On May 28, 8:18 am, prakash.mi...@gmail.com wrote:
>I am using evaluation copy of RW 9.0 for porting one of C++
application on RHEL4 (x86 platform).
[snip]

This is the page with the relevant information on how to get support
from us:
http://www.roguewave.com/support/con....cfm#sourcepro
I am not a native english speaker but the following extracted from the
roguewave web site striked me:

SourcePro® Core: An extensive set of fundamental C++ components that
shields users from many of the intricacies of the C++ language.[snip]

I see that "shielding user from the intricacies of the C++ language" is
an asset.
Marketing reality or I am missing the point ? :)

Michael

May 28 '07 #4
On May 28, 3:31 pm, Michael DOUBEZ <michael.dou...@free.frwrote:
nikkoara a écrit :
On May 28, 8:18 am, prakash.mi...@gmail.com wrote:
I am using evaluation copy of RW 9.0 for porting one of C++
application on RHEL4 (x86 platform).
[snip]
This is the page with the relevant information on how to get support
from us:
http://www.roguewave.com/support/con....cfm#sourcepro

I am not a native english speaker but the following extracted from the
roguewave web site striked me:

SourcePro® Core: An extensive set of fundamental C++ components that
shields users from many of the intricacies of the C++ language.[snip]

I see that "shielding user from the intricacies of the C++ language" is
an asset.
Marketing reality or I am missing the point ? :)
Yes, that seems to be "marketing speak". I agree it does not sound
right. Thanks for pointing it out, I'll pass this to the people in
marketing.

Liviu

May 28 '07 #5
On May 28, 3:31 pm, Michael DOUBEZ <michael.dou...@free.frwrote:
nikkoara a écrit :
On May 28, 8:18 am, prakash.mi...@gmail.com wrote:
I am using evaluation copy of RW 9.0 for porting one of C++
application on RHEL4 (x86 platform).
[snip]
This is the page with the relevant information on how to get support
from us:
http://www.roguewave.com/support/con....cfm#sourcepro

I am not a native english speaker but the following extracted from the
roguewave web site striked me:

SourcePro® Core: An extensive set of fundamental C++ components that
shields users from many of the intricacies of the C++ language.[snip]

I see that "shielding user from the intricacies of the C++ language" is
an asset.
Marketing reality or I am missing the point ? :)
Yes, that seems to be "marketing speak". I agree it does not sound
right. Thanks for pointing it out, I'll pass this to the people in
marketing.

Liviu

May 28 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas Lenarz | last post by:
Hello, we have got C++-programs (older SUN-Compiler) using the Rogue-Wave-Class-Library and consider to port the application to AIX 5.2 (GNU gcc/g++) The only drawback we could find ist the...
1
by: Don Tucker | last post by:
Hello, I am receiving the following compile-time error: /opt/include/rw/dcomplex.h line 218 error(1420): argument list for class template "complex" is missing typedef complex DComplex when...
5
by: Old Wolf | last post by:
The following code causes a deallocation of a random amount of bytes, with the Rogue Wave STL supplied with Borland C++ 5.5.1 : #include <vector> int main() { std::vector<char> v, w(1); v =...
0
by: sebor | last post by:
Hi all, The latest release of the Rogue Wave C++ Standard Library, version 4.1.0, has just been released into public domain under the Apache License, version 2.0, as the Apache stdcxx project:...
11
by: Micha | last post by:
Hello there, I think I've run into some classic c++ pitfall and maybe some of you guys can help me out. For my project I will need to use matrices and vectors and so I decided to implement them...
3
by: TonyHa | last post by:
Hello I try to install boost_1_33_1 on RedHat Linux. I have downloaded boost into /user/dtgtools/tmp and I try to install it into /user/dtgtools/packages/boost. I use the following commands:...
5
by: etoile | last post by:
The code is on a SUN platform. From a detailed design point of view, what is needed to eliminate Rogue Wave from the C++ code. Just scanning for RW in the code, here is a list: RWCstring...
2
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW...
1
by: Steven Backus | last post by:
I inherited a Solaris c++ program that uses Rogue Wave and am trying to port it to linux. It seg faults in this code: for (int size = entries() - 1; size 1; --size) { RWOrderedIterator...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.