Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-22-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#: Nested struct unmarshalling problem

I am passing a class by value, which has as a member a struct.
On the other end, the struct arrives initialized to its default values, losing its member values. The method call works OK when I redefine the struct as a class, without changing anything else.

These are the Slice definitions (the struct in question is 'Date'):

Code:
module IServices2ICE {
  . . .

  struct Date {
    byte Day;
    byte Month;
    short Year;
  };

  ["clr:property"]
  class PubDate {
    string Id;
    string PubKey;
    string ComboKey;
    ::IServices2ICE::Date Date;
    bool Cancelled;
    bool Produced;
  };

  sequence<PubDate> PubDateSeq;
  . . .
}
The class is actually passed in the form of a sequence (PubDateSeq).
The Date member always arrives with its members set to 0.

I can't see what I am doing wrong, so there is a chance of a bug.
I hope though that this is my fault, as it would be a serious issue.

The Ice version is 3.2.1.

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
Reply With Quote
  #2 (permalink)  
Old 09-23-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 have a look at what's wrong there.

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 09-24-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
I've posted a patch for this. Thanks for reporting the problem!

Cheers,

Michi.
Reply With Quote
  #4 (permalink)  
Old 09-24-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
I've posted a patch for this. Thanks for reporting the problem!

Cheers,

Michi.
Thanks for the quick turnaround. it works now.
Build question: The generated binaries are much larger than the original ones,
using VS 2005 and your build instructions. I assume the default is a debug
build. How do i configure your make file for a release build?

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
Reply With Quote
  #5 (permalink)  
Old 09-24-2007
dwayne's Avatar
dwayne dwayne is offline
ZeroC Staff
 
Name: Dwayne Boone
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Jan 2005
Location: St. John's, Newfoundland
Posts: 209
Edit config/Make.rules.mak.cs and comment out the DEBUG line and uncomment the OPTIMIZE line.
Reply With Quote
  #6 (permalink)  
Old 09-24-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
In terms of performance, an optimized build will basically make no difference. (At least, that's what I found last time I ran benchmarks and compared debug and optimized builds.)

I have to admit that I never paid much attention to the difference in size. How much of a difference do you see?

Whatever difference there is would be due mainly to the additional symbol information for debug builds. But I would hope that the symbol table would reside in a separate section in the assembly, so it wouldn't have to mapped into memory when the assembly is loaded. But I'm guessing here--anyone know for sure?

Cheers,

Michi.
Reply With Quote
  #7 (permalink)  
Old 09-24-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
In terms of performance, an optimized build will basically make no difference. (At least, that's what I found last time I ran benchmarks and compared debug and optimized builds.)

I have to admit that I never paid much attention to the difference in size. How much of a difference do you see?

Whatever difference there is would be due mainly to the additional symbol information for debug builds. But I would hope that the symbol table would reside in a separate section in the assembly, so it wouldn't have to mapped into memory when the assembly is loaded. But I'm guessing here--anyone know for sure?

Cheers,

Michi.
Actually, I am not talking about Ice for C#, but Ice for C++, as this is what I need to rebuild for your patches to slice2cs. The file size differences for slice2cs are: 308 KB for release, 764 KB for debug builds.

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
Reply With Quote
  #8 (permalink)  
Old 09-24-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
Ah, OK, misunderstanding then. I thought you meant the size of the icecs.dll assembly.

For C++, the executable size really doesn't matter, unless you care about disk space. The debug section in the executable is not loaded into memory at run time, so there is no additional overhead. Without optimization, slice2cs will run a tad slower, but not so that you would notice.

Cheers,

Michi.
Reply With Quote
  #9 (permalink)  
Old 09-24-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
Ah, OK, misunderstanding then. I thought you meant the size of the icecs.dll assembly.

For C++, the executable size really doesn't matter, unless you care about disk space. The debug section in the executable is not loaded into memory at run time, so there is no additional overhead. Without optimization, slice2cs will run a tad slower, but not so that you would notice.

Cheers,

Michi.
The problem I actually had was that the debug builds would not run on the other developer's machines (they use slice2java), as they were missing the debug runtime libraries, msvcp80d.dll and msvcr80d.dll. On my machine there was no problem as I have VS 2005 installed.

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
Reply With Quote
  #10 (permalink)  
Old 09-24-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
Ah, OK, that makes sense, yes.

Cheers,

Michi.
Reply With Quote
  #11 (permalink)  
Old 09-25-2007
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 813
Note that the debug Microsoft runtime DLLs are not redistributable ... that's why we don't include them in the Ice distribution. You should only distribute "release" binaries (built with /MD, not /MDd).

Best regards,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #12 (permalink)  
Old 09-27-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 bernard View Post
Note that the debug Microsoft runtime DLLs are not redistributable ... that's why we don't include them in the Ice distribution. You should only distribute "release" binaries (built with /MD, not /MDd).

Best regards,
Bernard
Yes, I know, but the default configuration of your build is for debug.

Karl
__________________
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
deadlock while nested invoking hlnpro Help Center 2 03-07-2007 11:38 AM
A problem about struct of multi-items klsmlzm Help Center 4 10-24-2006 03:38 AM
Blocked by nested callback roger jin Help Center 10 07-14-2006 02:16 PM
Problem with classes in struct kovacm Help Center 9 10-06-2005 02:49 AM
forgot me, but I can't declare a recursion nested struct... damingyipai Help Center 3 03-25-2004 01:56 AM


All times are GMT -4. The time now is 07:31 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.