Ice 3.4.1 and C++ Builder XE bug

JuLJuL Jukka LanttoOrganization: Outokumpu Tornio WorksProject: Hot material process controlling; Corba => IceMember
Ice 3.4.1
Embarcadero C++ Builder XE (= C++ Builder 2010)
Windows XP Service Pack 3

Hi,

There's an annoying bug in Embarcadero C++ Builder XE.
(QualityCentral)

It causes Ice client program crash in certain situations.
Workarounds do fix the the problem, but the real problem is that crash takes place in the code generated by Ice.
In my case, the program crashes if generated code is in a library (.lib).
If code is linked directly to the program, it doesn't crash.

How to fix this?

This is my (ugly shortened) slice file:

module ouMExceptions {
exception MsgException2 {
long Excno;
string Text ; } ; } ;

module MUdi {
interface IUdiUser {
string doOperation( string strOperationName, string strParamerBag )
throws ouMExceptions::MsgException2 ; } ; } ;


This code crashes:
try
{
__og.throwUserException(); // This throws ...
}
catch(const ::ouMExceptions::MsgException2& e)
{
throw; // This crashes
}


-Jukka

P.S.
Sorry about my possibly poor english (finglish :o)

Comments

  • bernardbernard Jupiter, FLBernard NormierOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi Jukka,

    Welcome to our forums!

    It looks like you already found a work-around for this issue--linking the generated code directly to your program. Doing so is unfortunately not always practical; for example, you may want to write an IceBox service.

    From the discussion on the Embarcadero forums, it looks like various changes to the generated code could make this issue disappear, like (possibly) adding an empty destructor to some generated classes. It would help if you could provide a small but complete test case that reproduces this issue (with makefiles or project files), as we could then tweak the generated code and hopefully find a better work-around.

    Thanks,
    Bernard
  • JuLJuL Jukka LanttoOrganization: Outokumpu Tornio WorksProject: Hot material process controlling; Corba => IceMember
    Hi Bernard,

    Thank you for your quick reply.
    Unfortunately my reply took a little longer.
    Finally today I had a change to make such an example you asked for.
    Unfortunatelly I can't repeat the error: the program doesn't crash even though the generated code is linked from a library. By debugging it's easy to see that the program goes exactly the same path as in the case it crashes:
    ...
    try
    {
    __og.throwUserException(); // This throws ...
    }
    catch(const :uMExceptions::MsgException2& e)
    {
    throw; // But this DOES NOT CRASH any more !!
    }

    Of course the test library as well as the client program are much more simple than the project in which I faced this problem. These are nasty this kind of bugs.

    I attach the example anyway.
    Include paths may be wrong of course.

    Regards
    -Jukka
  • bernardbernard Jupiter, FLBernard NormierOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi Jukka,

    These bugs are often very difficult to isolate.

    Without a good test-case, unfortunately, I don't see how we could find a meaningful work-around.

    Do you have to use C++Builder for this project? Visual Studio could be a safer alternative.

    Best regards,
    Bernard
Sign In or Register to comment.