Archived

This forum has been archived. Please start a new discussion on GitHub.

Exceptions cannot be unmarshalled on client

When implementing an ICE service I ran inon an odd bug. It seems that ICE is not able to transfer errors correctly over the boundary of a library, at least under certain circumstances.

Appending you will find a ZIP file with a simple test scenario. It contains a precompiled server.exe which does nothing than throwing a bug. Furthermore there is a client_ok.exe which catches the bug correctly and a client_ko.exe which throws an Ice::UnmarshalOutOfBoundsException.

The only difference between client_ok.exe and client_ko.exe is that for client_ok.exe I removed the line
#define SHOW_ICE_EXCEPTION_BUG
from exceptions.ice. This made the exception appear in test.ice instead of exceptions.ice e voila - it works! I.M.H.O. it shouldn't matter in which .ice file an exception is defined as long as the generated .h / .cpp files are included correctly.

Another way to "solve" the problem was to compile all the objects directly into the executables rather than using an intermedate library (interface.lib, see the included Makefile).

This is really a weird bug and I hope you won't have too many problems to finally track it down. Though I have a workaround now it would be really nice if the bug could be removed in the next ICE version, so that I can tidy up my .ice files and more important, to safe others from this confusing phenomenon.

I used ICE 1.5.1 on Windows XP with Microsoft Visual Studio .NET 7.0. I verified the bug with ICE 1.3.0 as well. It occurred with standalone servers and IceBox servers, with or without debug libraries alike.

Comments

  • bernard
    bernard Jupiter, FL
    Hi Robert,

    I don't see any Makefile or project file in the attached zip file.
    By library, I assume you mean DLL (a problem with static libraries would be really odd!). On Windows, it is critical to export symbols when using DLLs, with the slice2cpp --dll-export <SYMBOL> option; this could be the problem.

    Cheers,
    Bernard
  • Insert an ordered list into your message

    Hello Bernard,

    I'm really sorry, I appended the wrong test scenario. Hereby I send the correct one. I do indeed use static libraries and yes, it's very odd. Hope bug hunting means fun to you :-).

    Best Regards

    Robert.
  • bernard
    bernard Jupiter, FL
    Hi Robert

    I confirm this is a bug with Ice exception-factory registration. We'll try to fix it before the next release (1.6)! Thanks for the bug report and test case.

    Bernard
  • I've posted a patch at http://www.zeroc.com/vbulletin/showthread.php?s=&threadid=880. Thanks for reporting this bug!

    Cheers,

    Michi.