Results 1 to 5 of 5

Thread: BufferOverflowException when using callbacks

  1. #1
    iwagner is offline Registered User
    Name: Isaac Wagner
    Organization: Raytheon
    Project: Product Evaluation
    Join Date
    May 2011
    Posts
    12

    BufferOverflowException when using callbacks

    I added the ["amd"] tag on some of my methods so I can use the auto-generated callback objects. This seems to work for a while, then I start getting java.nio.BufferOverflowException when I call ice_response() on the callback object. Any ideas? Am I pounding the server too hard and have too many active callbacks? At this point I'm lost. Thanks.

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Isaac,

    Could you post the full stack trace, and platform/version information?

    Thanks,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    iwagner is offline Registered User
    Name: Isaac Wagner
    Organization: Raytheon
    Project: Product Evaluation
    Join Date
    May 2011
    Posts
    12
    Quote Originally Posted by bernard View Post
    Hi Isaac,

    Could you post the full stack trace, and platform/version information?

    Thanks,
    Bernard
    I'm using Ice 3.4.2 for Java on Linux. Here's the stack trace:

    Code:
    java.nio.BufferOverflowException
            at java.nio.Buffer.nextPutIndex(Buffer.java:495)
            at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:250)
            at IceInternal.BasicStream.writeBool(Unknown Source)
            at testproject.parser.types.ParserData.__write(ParserData.java:142)
            at testproject.parser.interfaces._AMD_ParserProcessor_unpackData.ice_response(_AMD_ParserProcessor_unpackData.java:39)
            at com.testproject.DataListener.notifySender(DataListener.java:83)
            at com.testproject.DataListener.onMessage(DataListener.java:47)
            at com.tibco.tibjms.TibjmsxSessionImp._submit(TibjmsxSessionImp.java:3821)
            at com.tibco.tibjms.TibjmsxSessionImp._dispatchAsyncMessage(TibjmsxSessionImp.java:2088)
            at com.tibco.tibjms.TibjmsxSessionImp$Dispatcher.run(TibjmsxSessionImp.java:3347)

  4. #4
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Isaac,

    This does not look like a memory exhaustion issue.

    Is there any possibility that your code is calling ice_response on the same callback object from two different threads? (Such a race condition is a possible explanation).

    AMD callbacks are not thread safe, and you should not use an AMD callback after calling ice_response on it.

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  5. #5
    iwagner is offline Registered User
    Name: Isaac Wagner
    Organization: Raytheon
    Project: Product Evaluation
    Join Date
    May 2011
    Posts
    12
    Quote Originally Posted by bernard View Post
    Is there any possibility that your code is calling ice_response on the same callback object from two different threads? (Such a race condition is a possible explanation).
    I've been through the code several times and can't see any threading issues. But, I will look again and get some of my colleagues involved to see if they can spot a threading issue. Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Callbacks
    By marksnelling in forum Help Center
    Replies: 2
    Last Post: 05-28-2009, 03:58 AM
  2. Callbacks in Glacier2
    By davidcr1983 in forum Help Center
    Replies: 4
    Last Post: 08-14-2006, 09:49 AM
  3. Glacier2+Callbacks
    By KE5CRP in forum Help Center
    Replies: 6
    Last Post: 04-13-2005, 06:55 PM
  4. The use of context for callbacks
    By catalin in forum Help Center
    Replies: 1
    Last Post: 08-29-2004, 12:42 PM
  5. Repeating callbacks
    By Lance in forum Help Center
    Replies: 3
    Last Post: 08-12-2003, 09:49 AM

Posting Permissions

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