Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-21-2004
kssreeram kssreeram is offline
Registered User
 
 
Join Date: Oct 2003
Posts: 11
Crash in IceUtil::Time caused by VC6 bug

Hi

There is a bug in VC6 which causes stack pointer corruption in try-catch blocks which create temporary objects containing __int64 members. The stack pointer corruption happens when an exception is thrown inside the try-catch block.

This problem affects Ice because IceUtil::Time has a __int64 member. Thus this can lead to unexpected crashes inside Ice where Time is used, and some error condition causes an exception to be thrown.

Here is simple program to reproduce the problem in VC6 :
Code:
class SomeClass {
public:
    static SomeClass StaticMethod() {
        return SomeClass();
    }

    ~SomeClass() {
    }

    __int64 _64bit;
};

int main(int argc, char **argv) {
    try {
        throw 0;

        SomeClass::StaticMethod();
    }
    catch( ... ) {
    }
    
    return 0;
}
As a workaround to this problem in our application, we've patched IceUtil::Time to not use a __int64 member. Instead it used two 32bit values, and emulates a 64-bit type.

Regards
Sreeram
Tachyon Technologies
Reply With Quote
  #2 (permalink)  
Old 04-22-2004
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Sreeram,

I was not able to reproduce this problem with your test case. I tried to compile with /GX /O2 and /GX /Zi, using Visual C++ 6 SP5:

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86

And purify did not show any problem.

What am I missing?

Thanks,
Bernard
Reply With Quote
  #3 (permalink)  
Old 04-22-2004
kssreeram kssreeram is offline
Registered User
 
 
Join Date: Oct 2003
Posts: 11
Looks like the bug is present only if VC6 SP5 ProcessorPack is installed. I just tested the program on two machines which have processor pack installed, and on two other machines which only have plain VC6 SP5. The crash didnt happen if the processor pack is not installed.

Also the OS doesnt report an access violation if i run the program outside the debugger.

Incidentally i also noticed a comment regarding this very same issue in Ice 1.2.0 source code. The comment has been removed in 1.3.0.

In Ice 1.2.0 look in src/Ice/Connection.cpp line 991.

Regards
Sreeram
Tachyon Technologies
Reply With Quote
  #4 (permalink)  
Old 04-22-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Right, we removed this, because exception handling is "officially broken" with the processor pack, so we don't support the processor pack for Ice. And according to Microsoft, they have no intention to fix this for VC++ 6.0.
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
Crash if running Ice::Service as daemon & ulimit -n > FD_SETSIZE svens Patches 0 01-05-2007 04:19 PM
smart pointer list crash problem! netfish Help Center 9 11-17-2006 08:24 AM
IceUtil::Time documentation n2503v Bug Reports 1 10-23-2005 06:03 PM
Zero value for IceUtil::Time catalin Help Center 1 10-05-2004 08:28 AM


All times are GMT -4. The time now is 09:52 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.