Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-05-2007
kwaclaw kwaclaw is offline
Registered User
 
Name: Karl Waclawek
Organization: Toronto Star Newspapers Ltd.
Project: Proof of concept
 
Join Date: Sep 2004
Location: Oshawa, Canada
Posts: 136
C#: callback (ice_response) problem

I am getting a null pointer exception in the C# generated code when ice_response is called in an async dispatch situation.

The relevant Slice is:

Code:
  struct Prop {
    int Index;
    Ice::ByteSeq Value;
  };
  
  sequence<Prop> PropSeq;

  interface Store {
     . . .
    ["ami", "amd"] idempotent
    PropSeq Get(Ice::ByteSeq key, Ice::IntSeq propIndexes) throws ServiceError;
     . . .
  };
The generated code for the call-back is as follows:
(I have marked the problem spot with a comment)

Code:
class _AMD_Store_Get : IceInternal.IncomingAsync, AMD_Store_Get
{
    public _AMD_Store_Get(IceInternal.Incoming inc) : base(inc)
    {
    }

    public void ice_response(Services.StorageServices.Prop[] ret__)
    {
        try
        {
            IceInternal.BasicStream os__ = this.os__();
            if(ret__ == null)
            {
                os__.writeSize(0);
            }
            else
            {
                os__.writeSize(ret__.Length);
                for(int ix__ = 0; ix__ < ret__.Length; ++ix__)
                {
                    ret__[ix__].write__(os__);  // issue here
                }
            }
        }
        catch(Ice.LocalException ex__)
        {
            ice_exception(ex__);
        }
        response__(true);
    }

    public void ice_exception(_System.Exception ex)
    {
        try
        {
            throw ex;
        }
        catch(Services.ServiceError ex__)
        {
            os__().writeUserException(ex__);
            response__(false);
        }
        catch(_System.Exception ex__)
        {
            exception__(ex__);
        }
    }
}
The problem occurs when the returned array contains nulls.

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
Reply With Quote
  #2 (permalink)  
Old 11-05-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 909
Thanks for the bug report. I'll post a patch ASAP.

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 11-12-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 909
Hi Karl,

I've posted a patch for the problem. Thanks for reporting this! You need to apply the patch to cpp/src/Slice/CsUtil.cpp, rebuild slice2cs, and recompile your Slice definitions.

Cheers,

Michi.
Reply With Quote
  #4 (permalink)  
Old 11-12-2007
kwaclaw kwaclaw is offline
Registered User
 
Name: Karl Waclawek
Organization: Toronto Star Newspapers Ltd.
Project: Proof of concept
 
Join Date: Sep 2004
Location: Oshawa, Canada
Posts: 136
Quote:
Originally Posted by michi View Post
Hi Karl,

I've posted a patch for the problem. Thanks for reporting this! You need to apply the patch to cpp/src/Slice/CsUtil.cpp, rebuild slice2cs, and recompile your Slice definitions.

Cheers,

Michi.
Thanks, the fix seems to work.
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Why ice_response for AMD block? soloman817 Help Center 9 11-05-2007 01:03 PM
Multiple ice_response to a single AMI callback kishore Help Center 3 06-05-2007 11:08 PM
demo/ice/callback problem Rerox Help Center 1 07-27-2005 05:54 PM
demo/glacier2/callback problem alienwolf Help Center 1 05-30-2005 12:52 AM
Callback sample problem zhangzq71 Help Center 3 05-08-2005 10:04 AM


All times are GMT -4. The time now is 08:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.