472,796 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,796 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 2927
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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.