Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16

Thread: UnmarshallOutOfBoundsException - why?

  1. #1
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105

    UnmarshallOutOfBoundsException - why?

    hi

    i get UnmarshallOutOfBoundsException in the case multiple threads
    access the same proxy object.

    is this observation right?

    is there a clone methode?

    thx for your help

    tom

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    A proxy can be used by multiple threads. There is no need to clone the proxy. Typically you get UnmarshalOutOfBoundsException if the Slice code used by the client and the server do not match.

  3. #3
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105
    hi marc,

    do i need to take care about syncronization of the proxy?
    you see the exception occurrs randomly by chance.

    it looks like the exception is thrown because multiple threads write to the
    same incoming stream - producing invalid content

    thx

  4. #4
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    No, you do not need to take care of proxy synchronization. It is not possible that calls write into the same stream if they use the same proxy, as each call uses its own stream.

    Is this a regular call or an AMI call? If it is an AMI call, please make sure that you do not share the AMI callback object between threads. An AMI callback object cannot be used for multiple simultaneous calls, regardless of whether these are done in the same or different threads. However, the proxy can be shared, also for AMI calls.

    How do you determine that two calls write into the same stream?

  5. #5
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105
    im using regular calls.

    it was a suspicion with the stream.

    im building a smal sample project to demo the behaviour.

    im back in a few minutes

  6. #6
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105
    i cannot reproduce the problem in a seperate project. :-(

    you said:
    Typically you get UnmarshalOutOfBoundsException if the Slice code used by the client and the server do not match.
    how can this happen?

    client and server code is generated from the same file.
    both are recompiled at the same time.
    in occurs randomly


    as far i could debug into the problem: it happens on unmarshaling of sequences ( strings or structs )

    thx

  7. #7
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Originally posted by DeepDiver
    i cannot reproduce the problem in a seperate project. :-(

    you said:


    how can this happen?

    client and server code is generated from the same file.
    both are recompiled at the same time.
    in occurs randomly


    as far i could debug into the problem: it happens on unmarshaling of sequences ( strings or structs )

    thx
    It could only happen if your client and server do not use code generated from the same Slice files. If this is not the case, then I'm afraid I don't know what the problem is. I would need to see an example that demonstrates the problem.

  8. #8
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105

    Demo Project !!!!

    hi,

    finally i was successfull to reproduce the problem in a seperate project!
    look like a problem in unmarshalling sequences of structs.

    start the server in console.
    start client in debugger and set break points in
    _CallbackDisp::___Notify01 and
    _CallbackDisp::___Notify02

    exception will be thrown in a call to startSeq

    have fun

    tom
    Attached Files Attached Files

  9. #9
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Thansk you, we will investigate.

  10. #10
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    I tried reproducing this, but couldn't.

    In order to get your code to run, I had to comment out the call to _server.AddCallback(cb) in the server because _server was null, so this line caused the server to crash. After fixing this, the client ran OK.

    Are you sure that you have compiled client and server from consistent Slice definitions? (The most likely cause of an UnmarshalOutOfBoundsException is a mismatch in the Slice definitions used by client and server.)

    Michi.

  11. #11
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105
    hi,

    you are right:
    _server is null and the call AddServer will cause a crash.

    the problem:
    when i run it -> an exception is thrown in the line above:
    cb.Notify01( dates, n0, n1 );

    slice defintion:
    as you can see in the projects there is one .ice file. the projects run generate.exe
    you know i'm a lazy developer - i just copied one of your demo projects and
    modified it!

    compiler and .net version:
    Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
    for Microsoft (R) .NET Framework version 1.1.4322
    printout on client:

    client.exe: warning: dispatch exception:
    identity: 8a174c65-0f81-438a-8ecf-42549fc7e8b8
    facet:
    operation: Notify01
    Ice.UnmarshalOutOfBoundsException: UnmarshalOutOfBoundsException
    at IceInternal.BasicStream.checkSeq(Int32 bytesLeft)
    at IceInternal.BasicStream.startSeq(Int32 numElements, Int32 minSize)
    at _CallbackDisp.___Notify01(Callback __obj, Incoming __in, Current __current) in c:\ice-1.5.1\democs\ice\multidemo\generated\demo.cs:line 1172
    at _CallbackDisp.__dispatch(Incoming __in, Current __current) in c:\ice-1.5.1\democs\ice\multidemo\generated\demo.cs:line 1285
    at IceInternal.Incoming.invoke(ServantManager servantManager)

    any traces you'd like to have? Some version numbers?


    let me know!


    thx alot


    tom

  12. #12
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105
    i cleaned the project.

    executables included this time as well
    maybe you can get some inof from that.


    thx

    tom
    Attached Files Attached Files

  13. #13
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    I just tried reproducing this with the latest build of Ice for C#. It works fine with that build. Seeing that we will be releasing Ice 2.0 within the next day, could you wait and try again with the new release? Most likely, you will find that the problem will have disappeared with that.

    Thanks,

    Michi.

  14. #14
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105
    hi michi,

    not a problem!
    i'll wait for 2.0!

    thanks a lot up to now!


    CU Tom

  15. #15
    DeepDiver's Avatar
    DeepDiver is offline Registered User
    Name: Thomas Mueller
    Organization: Freelance Software Developer
    Project: Project depend on Customers
    Join Date
    Nov 2004
    Location
    Munich, Bavaria, Germany
    Posts
    105

    2.0 fixed the problem!

    thanks alot for your help.

    with 2.0 the problem disapeared.

    the reason was a missing call of __is.endSeq(szx);
    in the generated code with the compiler of 1.5.1


    thx alot


    tom

Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

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

Posting Permissions

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