Results 1 to 4 of 4

Thread: slice2cpp streaming API bug with nested modules

  1. #1
    PrzemekD is offline Registered User
    Name: Przemek Dlugosz
    Organization: INVENTWARE
    Project: Mainstream Project
    Join Date
    May 2010
    Posts
    7

    slice2cpp streaming API bug with nested modules

    Hello Ice Team,

    I came across into following problem: if nesting level of modules is larger than 2 (or 3, I'm not sure how it is calculated) then streaming API generated by slice2cpp is not correct (it fails during runtime). Here is an example based on cpp/demo/Ice/invoke:

    //modified part of Printer.ice
    module Demo{
    ...
    module x {
    module dto
    {

    struct Structure
    {
    string name;
    Color value;
    };

    sequence<Structure> StructureSeq;

    class C
    {
    Structure s;
    };
    };
    };
    ...
    //interface methods changed to use nested module names for Structure, StructureSeq and C
    };

    //Client.cpp and PrinterI.cpp modified to use nested module names for Structure, StructureSeq and C

    Everything compiles well except that client generates runtime error when serializing Structure, StructureSeq or C:
    client: ../../../include/Ice/Stream.h:202: static void Ice::StreamWriter<st>::write(const Ice::OutputStreamPtr&, const T&) [with T = Demo::x::dto::Structure, Ice::StreamTraitType st = (Ice::StreamTraitType)10u]: Assertion `false' failed.
    Aborted

    There is no error when there is only one more nesting level, I mean using only "x" module (without "dto") will give no error. Tested with: "c++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1".

    Please confirm it's a bug, I could not find such limits in Ice manual.

    Edit:
    forgot to mention that Ice version is 3.4.0 (current) and 3 patches for slice2cpp (posted on "Patches" forum) were applied.

    Best regards
    Przemek
    Last edited by PrzemekD; 05-25-2010 at 09:46 AM.

  2. #2
    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
    1,441
    Hi,

    Thanks for bringing this to our attention, it does indeed look like a bug in the generated code.

    Regards,
    Mark

  3. #3
    PrzemekD is offline Registered User
    Name: Przemek Dlugosz
    Organization: INVENTWARE
    Project: Mainstream Project
    Join Date
    May 2010
    Posts
    7
    Hello,

    Thanks for quick reply. After any error correction it might be not so safe to leave it as it is now. Is it possible to refactorize this piece of code (I mean "assert(false)" in Stream.h) in order to throw errors during compile time instead of aborting application? This step may prevent similar cases in the future.

    I also hope that simple remote calls does not use the streaming API in some circumstances because it would be a disaster for exisitng systems.

    Best regards
    Przemek

  4. #4
    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
    1,441
    Hi,

    Quote Originally Posted by PrzemekD View Post
    I also hope that simple remote calls does not use the streaming API in some circumstances because it would be a disaster for exisitng systems.
    This bug only affects the code generated for our portable streaming API. Regular Ice invocations do not use this code.

    Regards,
    Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. template error in nested slice modules
    By n2503v in forum Bug Reports
    Replies: 2
    Last Post: 03-10-2010, 06:38 PM
  2. Nested Modules
    By Ryuga in forum Help Center
    Replies: 1
    Last Post: 02-25-2009, 05:18 AM
  3. slice2html creates broken links for nested modules
    By mefoster in forum Bug Reports
    Replies: 1
    Last Post: 05-01-2007, 06:25 PM
  4. Replies: 1
    Last Post: 04-02-2007, 05:41 PM
  5. New streaming API comments
    By annekat in forum Comments
    Replies: 5
    Last Post: 03-06-2005, 03:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •