Re: [protobuf] Problem : Serialized in protobuf-net, deserialize in C++ app

2010-03-11 Thread Marc Gravell
Hmm - the data field should be pretty trivial - in terms of the wire-format
it is just a field-header, a length-prefix, and then the raw data.

How big is the message when serialized? (or: how big is a short message that
reproduces this problem?) Could you possibly both the BLOB, either in hex or
base-64, so that I can see what the bytes are?

On 11 March 2010 14:24, Michael Poole  wrote:

> Roey writes:
>
> [snip]
> > The problem is, I get a memory access violation when I try to
> > deserialize it :(
> > Unhandled exception at 0x02f166d8 in wmplayer.exe: 0xC005: Access
> > violation writing location 0x.
> >
> > Are any of the things I'm doing here wrong , for what I'm trying to do
> > (serialize in C# .NET and deserialize in C++?)
>
> Most likely yes, but it's hard to suggest what that is without a brief
> code example that shows the crash.  The crash is obviously trying to
> write into a null pointer, but only you can find out what code is at
> address 0x02f166d8.
>
> Michael Poole
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>


-- 
Regards,

Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Problem : Serialized in protobuf-net, deserialize in C++ app

2010-03-11 Thread Michael Poole
Roey writes:

[snip]
> The problem is, I get a memory access violation when I try to
> deserialize it :(
> Unhandled exception at 0x02f166d8 in wmplayer.exe: 0xC005: Access
> violation writing location 0x.
>
> Are any of the things I'm doing here wrong , for what I'm trying to do
> (serialize in C# .NET and deserialize in C++?)

Most likely yes, but it's hard to suggest what that is without a brief
code example that shows the crash.  The crash is obviously trying to
write into a null pointer, but only you can find out what code is at
address 0x02f166d8.

Michael Poole

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Problem : Serialized in protobuf-net, deserialize in C++ app

2010-03-11 Thread Evan Jones

On Mar 11, 2010, at 8:39 , Roey wrote:
Unhandled exception at 0x02f166d8 in wmplayer.exe: 0xC005:  
Access violation writing location 0x.



I believe this means you are accessing a NULL pointer somewhere. You  
should attach a debugger to your process and look at the stack trace  
to figure out where this is happening. My unhelpful guess is that  
something is not initialized correctly. Good luck,


Evan

--
Evan Jones
http://evanjones.ca/

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Problem : Serialized in protobuf-net, deserialize in C++ app

2010-03-11 Thread Roey
Hi All.

I am using ProtoBuf-Net in my .NET application to serialize the
following : (in .proto format)

message ProtoScreenBuffer {
optional int32 MediaId = 1;
optional bytes Data = 2;
optional bool LastBuffer = 3;
optional int64 StartTime = 4;
optional int64 StopTime = 5;
optional int32 Flags = 6;
optional int32 BufferSubType = 7;
optional int32 BufferType = 8;
repeated int32 EncryptedDataStart = 9;
repeated int32 EncryptedDataLength = 10;
}

I serialize this into a byte array, using protobuf-net,
and pass it to the C++ app.
What goes out of the .NET and what comes into the C++ app is 100%
identical.

It then should be deserialized in the C++ app.

I try to do :

m_screenBuffer.ParseFromArray(serBuffer, dwInputDataLen);
(where m_screenBuffer is ProtoScreenBuffer object, serBuffer is the
raw byte array I got from the .NET app,  and dwInputDataLen is the
length of it.)

The problem is, I get a memory access violation when I try to
deserialize it :(
Unhandled exception at 0x02f166d8 in wmplayer.exe: 0xC005: Access
violation writing location 0x.

Are any of the things I'm doing here wrong , for what I'm trying to do
(serialize in C# .NET and deserialize in C++?)

Thanks alot.

Roey

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.