Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-19-2004
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Assertion failure in GCShared in 1.3?

Hello Again,

I just made the Ice 1.3 installation, non-optimized, and got this failure when my Ice::Application object destructs.

Assertion failed: num == 1, GCShared.cpp, line 69

I did not make 1.2 non-optimized so I did not get this assertion, but it was core dumping upon exit, so maybe this problem is in 1.2 as well.

Anybody know what I might be doing wrong? I noticed there was a bug fix for 1.3 mentioned in the CHANGES file for interrupts on an Ice::Application, but I am not sending any signals nor interrupting, I just allow the application to run to the end of my run() method.

Any ideas?

Brian
Reply With Quote
  #2 (permalink)  
Old 03-19-2004
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Hi Brian,

The quickest way for us to help you is for you to provide a small but complete example that demonstrates the problem, as well as a description of your platform and compiler versions.

Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 03-19-2004
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
I was afraid of that response. Before we take the time to provide an example, I assume that this is not some known issue or that some general explanation cannot be provided given the assertion that we can use to try to fix the problem on our end?

Brian
Reply With Quote
  #4 (permalink)  
Old 03-19-2004
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
No, it's not a known problem (but it could be an unknown one ).

Can you provide a stack trace?

- Mark
Reply With Quote
  #5 (permalink)  
Old 03-22-2004
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Okay Mark, here you go. Attatched is output from dbx running on a Solaris box.

Brian
Attached Files
File Type: txt dbx.txt (7.4 KB, 94 views)
Reply With Quote
  #6 (permalink)  
Old 03-22-2004
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
I looked at the stack trace, and it appears that there is a reference-counting problem with a servant. It's difficult for me to be more specific without seeing the code in question. If you'd like, you can email the code to me rather than posting it on the forum.

- Mark
Reply With Quote
  #7 (permalink)  
Old 03-22-2004
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Mark,

The code is voluminous and it is not practical at this point to send to you.
What is your gut feeling -- is this a problem on our end or a bug in Ice? When you say a reference counting problem, is there ANYTHING we can try to detect, fix, and workaround the problem?

Thanks,

Brian
Reply With Quote
  #8 (permalink)  
Old 03-22-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 912
For now, simply comment out the assertion. That will get you off the hook.

What would help me is if you could send me the state of all threads. I suspect that another thread is also destroying (or has just recently destroyed) something that derives from Ice::Object. Also, if you have this happening reliably (that is, on every run, not just occasionally), I'd really like to see your code because that's probably the only way to work out what is going wrong. If you could put together a test case that shows the failure, this would help enormously.

I'm not sure whether this is due to a bug in your code or in our code but, either way, it would be good to know why this is happening, so we can come up with a way to prevent this problem in future.

Cheers,

Michi.
Reply With Quote
  #9 (permalink)  
Old 03-23-2004
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Michi,

After extensive investigation I think I know what I was doing wrong. I was creating a servant, adding it to an adapter, and then explicitly calling the delete function on the servant. When I commented the delete out, the assert went away and I noticed that the destructor of the servant was still being called when Ice::Application exits -- I guess when it calls deactivate on all its adapters. (I did not glom this functionality from the manual.) So I guess the reference count of the servant was being decremented too much.

I've attached the stack trace from where the destructor of our servant, ItsOmsProxyFacade, is called.

Does this all make sense to you?

Brian
Attached Files
File Type: txt dbx.txt (4.6 KB, 93 views)
Reply With Quote
  #10 (permalink)  
Old 03-24-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 912
Quote:
Originally posted by brian
Michi,

After extensive investigation I think I know what I was doing wrong. I was creating a servant, adding it to an adapter, and then explicitly calling the delete function on the servant.
Right. Never call delete on a servant. It's guaranteed to mess up the reference counts. (The whole point of using reference counts is so you don't have to bother with remembering to call delete.)

Quote:
When I commented the delete out, the assert went away and I noticed that the destructor of the servant was still being called when Ice::Application exits -- I guess when it calls deactivate on all its adapters. (I did not glom this functionality from the manual.) So I guess the reference count of the servant was being decremented too much.
Right. The relevant explanations are on page 256 of the Ice manual. A general explanation of smart pointers starts on page 176.

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
IceGrid assertion failure borax00 Bug Reports 7 07-24-2006 09:46 AM
assertion failure bravekillla Help Center 1 12-27-2005 05:34 PM
A Question about Shared and GCShared OrNot Help Center 3 06-23-2005 12:03 AM
IceInternal::ThreadPool::destroy assertion failure rhochmuth Help Center 14 06-15-2005 02:18 PM
STL assertion failure make test fails sylvain Bug Reports 2 03-02-2003 08:24 AM


All times are GMT -4. The time now is 11:01 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.