[protobuf] Re: Issue 351 in protobuf: Make protobuf_lite proto files not create any static initializers
Issue 351: Make protobuf_lite proto files not create any static initializers http://code.google.com/p/protobuf/issues/detail?id=351 This issue is now blocking issue chromium:94925. See http://code.google.com/p/chromium/issues/detail?id=94925 -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Re: Issue 351 in protobuf: Make protobuf_lite proto files not create any static initializers
Comment #4 on issue 351 by e...@chromium.org: Make protobuf_lite proto files not create any static initializers http://code.google.com/p/protobuf/issues/detail?id=351 It looks like on the Windows code path once.h still calls the ProtobufOnceType() ctor as a static initializer. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Error: Byte size calculation and serialization were inconsistent
Hello, I have been using protobuf successfully for my project for a number of months now when I compile my project in gcc. Recently I went to compile my project in gcc with the -O optimization flag, but when running the project, I soon get an error when attempting to call SerializeAsString(): libprotobuf FATAL google/protobuf/message_lite.cc:65] CHECK failed: (bytes_produced_by_serialization) == (byte_size_before_serialization): Byte size calculation and serialization were inconsistent. This may indicate a bug in protocol buffers or it may be caused by concurrent modification of the message. terminate called after throwing an instance of 'google::protobuf::FatalException' what(): CHECK failed: (bytes_produced_by_serialization) == (byte_size_before_serialization): Byte size calculation and serialization were inconsistent. This may indicate a bug in protocol buffers or it may be caused by concurrent modification of the message. Please note the project is single-threaded, so I am unsure how concurrent modification would be possible. Does anyone know how I might resolve this? I'm kinda lost on this error, so any help would be much appreciated. Thank you, Robby --- Details: Protobuf version: getting this in both 2.4.0 and 2.4.1 GCC version: htmud@archive:~/testsvn$ gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs -- enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program- suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build- id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 -- libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx- debug --enable-objc-gc --with-arch-32=i586 --with-tune=generic -- enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux- gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.5 (Debian 4.4.5-8) Core dump: Core was generated by `./HTMudServ'. Program terminated with signal 6, Aborted. #0 0x2b5698bfb1b5 in raise () from /lib/libc.so.6 (gdb) bt #0 0x2b5698bfb1b5 in raise () from /lib/libc.so.6 #1 0x2b5698bfdfc0 in abort () from /lib/libc.so.6 #2 0x2b56984e8dc5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6 #3 0x2b56984e7166 in ?? () from /usr/lib/libstdc++.so.6 #4 0x2b56984e7193 in std::terminate() () from /usr/lib/libstdc+ +.so.6 #5 0x2b56984e728e in __cxa_throw () from /usr/lib/libstdc++.so.6 #6 0x2b569817d9db in google::protobuf::internal::LogMessage::Finish (this=0x7fff7434ae10) at google/protobuf/stubs/common.cc:195 #7 0x2b5698185d73 in ByteSizeConsistencyError (byte_size_before_serialization=value optimized out, byte_size_after_serialization=value optimized out, bytes_produced_by_serialization=46) at google/protobuf/message_lite.cc:68 #8 0x2b5698186098 in google::protobuf::MessageLite::AppendPartialToString (this=0x7fff7434aee0, output=value optimized out) at google/protobuf/ message_lite.cc:284 #9 0x2b56981865f1 in google::protobuf::MessageLite::SerializeAsString (this=0x430f) at google/protobuf/message_lite.cc:321 #10 0x00426ce4 in CObject::sendItemToPlayer(int, CPlayer*) () #11 0x0042145b in CPlayer::sendItemToPlayer(int, CPlayer*) () #12 0x00421a90 in CPlayer::teleportToLocation(int, WorldPos) () #13 0x0041002f in HandleIncomingMessage(char*, int, int, int) () #14 0x0040bfbf in main () And here is my code from frame #10 HTMud::EnvAdd item; item.set_id(ID); item.set_idtype(typeID); item.set_x(X); item.set_y(Y); item.set_z(Z); item.set_lockdown(lockdown); item.set_mapid(map); item.set_tilesetno(tilesetNo); item.set_tilesetx(tilesetX); item.set_regionx(regionX); item.set_regiony(regionZ); if (volume == VOL_SELF) objects-SendPlrPacket(toWhom, volume, item.SerializeAsString(), 10); -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Generate Descriptor from C/C++ Struct/Class
Hi, I was wondering if there is a tool that can generate the Protocol Buffers descriptor file from an existing C or C++ struct or class declaration. Also, I am looking for a tool that can generate C/C++ source code that automatically populate data bi-directionally. For example, given the C struct: struct my_struct_t { int a; double b; ... }; ... my_struct_t raw_data; MyStruct pb_data = ... // Generated code begins... if (!pb_data.has_a()) raw_data.a = pb_data.a(); if (!pb_data.has_b()) raw_data.b = pb_data.b(); ... // End of generated code Thanks. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] ParseFromArray() failing
the function ParseFromArray() returns only a bool value - is there a way to get more details about the error? thanks, --peter -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] AIX build fails
I am trying to build protocol buffers on several platforms and I'm having a problem with building on AIX. I run configure with only the --prefix option, and have defined these variables: export CFLAGS=-maix64 export CPPFLAGS=-maix64 export LDFLAGS=-maix64 export OBJECT_MODE=64 Configure runs well, but make fails when linking. Here I have all but the last few lines: libtool: link: g++ -D_THREAD_SAFE -Wall -Wwrite-strings -Woverloaded- virtual -Wno-sign-compare -O2 -g -DNDEBUG -D_THREAD_SAFE -maix64 - o .libs/protoc main.o -L/home/pwall/pbe/third-party/src/protobuf/ protobuf-2.4.1/src/.libs -L./.libs -L/opt/freeware/src/packages/BUILD/ gcc-build/powerpc-ibm-aix5.3.0.0/ppc64/libstdc++-v3/src -L/opt/ freeware/src/packages/BUILD/gcc-build/powerpc-ibm-aix5.3.0.0/ppc64/ libstdc++-v3/src/.libs -L/opt/freeware/src/packages/BUILD/gcc-build/./ gcc/ppc64 -L/opt/freeware/src/packages/BUILD/gcc-build/./gcc -L/opt/ freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/../.. -lprotoc -lprotobuf - lpthreads -L/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.4/ppc64 - lstdc++ -Wl,-blibpath:/home/pwall/protobuf/aix/lib:/opt/freeware/lib/ gcc/powerpc-ibm-aix5.3.0.0/4.2.4/ppc64:/opt/freeware/lib/gcc/powerpc- ibm-aix5.3.0.0/4.2.4/ppc64:/opt/freeware/lib/gcc/powerpc-ibm- aix5.3.0.0/4.2.4:/opt/freeware/lib/gcc/powerpc-ibm- aix5.3.0.0/4.2.4/../../..:/usr/lib:/lib ld: 0711-317 ERROR: Undefined symbol: .std::basic_stringchar, std::char_traitschar, std::allocatorchar ::basic_string(char const*, std::allocatorchar const) ld: 0711-317 ERROR: Undefined symbol: std::basic_stringchar, std::char_traitschar, std::allocatorchar ::_Rep::_S_empty_rep_storage ld: 0711-317 ERROR: Undefined symbol: .std::basic_stringchar, std::char_traitschar, std::allocatorchar ::_Rep::_M_destroy(std::allocatorchar const) ld: 0711-317 ERROR: Undefined symbol: ._Unwind_Resume ld: 0711-317 ERROR: Undefined symbol: __gxx_personality_v0 ld: 0711-317 ERROR: Undefined symbol: .__register_frame_info_table ld: 0711-317 ERROR: Undefined symbol: .__deregister_frame_info ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 2. Stop. Can anybody help here? Thanks, -Pete -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] PB on the ISeries
We are trying to access some c++ programs on our ISeries boxes from our Java Web Services (Linuc, JBoss). If I write a server (for RPC) on the ISeries, can I use PB for the messages. Has anyone got PB working successfully on the ISeries? Thanks, Srini -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] C# implementation probuff
Hi, i coded a C# implementation called probuff. It's stable and working fine. Some features are not implemented yet, but will follow. A feature list can be found on the project page. Please take a look and try it. http://code.google.com/p/probuff/ Regards, Nabil -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Android
Hi every one, I am new at android and really need a sample about calling ProtoBuff.net webservices from android ( using eclipse). I need it in my project and really I could not find any sample about it. many appreciate if you show me the way. thanks -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Encoding question, datatypes packed repeated fields
I have some questions regarding packed fields, and storing/serializing data. What i want to do essentially, is to store 4MB of data to a file. The data i have comes as uint8_t (a byte) and i want to store these as efficiently as possible. I have been testing a variety of protobuf setups (four); repeated uint32_t datastruct = 1; repeated uint32_t datastruct = 1 [packed = true] with both variants assigned 1-to-1 and both variants bitshifted 4 values into a uint32_t. To my surprise the stored files are much larger than the original data. The best result i could achieve was 5.2MB for the 4MB data, which really isnt that good. Have i misunderstood something vital here? I do realize that protobuf adds information to the packets, but 25% increase is too much imho. Thanks for your time. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] protobuf is now now in fink for mac osx 10.7
Hi all, I've copied the fink package for the c and c++ interfaces from fink on Mac OSX 10.6 to 10.7. I also added a protobuf-py27 package for the python API. The new packages should show up here the next time the database is repopulated: http://pdb.finkproject.org/pdb/browse.php?name=protobuf Cheers, -kurt -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] GeneratedMessageTest.MergeFromSelf CHECK failed: (from) != (this)
Windows 7 64-bit, VS2010 Protobuf is from protobuf-2.4.1.zip. gtest is replaced with gtest-1.6.0, because native isn't compiled. tests.exe in Debug mode reports 11 failures (in release mode in reports 4 failures): [ FAILED ] 11 tests, listed below: [ FAILED ] GeneratedMessageTest.MergeFromSelf [ FAILED ] ExtensionSetTest.InvalidEnumDeath [ FAILED ] GeneratedMessageReflectionTest.UsageErrors [ FAILED ] MessageTest.SerializeFailsIfNotInitialized [ FAILED ] MessageTest.CheckInitialized [ FAILED ] Printer.Death [ FAILED ] ReflectionOpsTest.MergeFromSelf [ FAILED ] RepeatedField.Truncate [ FAILED ] TokenizerTest.ParseInteger [ FAILED ] TokenizerTest.ParseFloat [ FAILED ] TokenizerTest.ParseString First of them: libprotobuf FATAL d:\protobuf\protobuf-2.4.1\vsprojects\google\protobuf\ unittest.pb.cc:5538] CHECK failed: (from) != (this): d:\protobuf\protobuf-2.4.1\src\google\protobuf\compiler\cpp\cpp_unittest.cc(500):: Caught std::exception-derived exception escaping the death test statement. Exception message: CHECK failed: (from) != (this): Please advise. Artyom -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Open generic types Serialization/ Deserialization
Hi, I have a Type : CommandTData : Base where TData : ISomething. TData are POCOs (DataContracts). Im using ProtoBuf.net V2, and I'm registering the types to the Modal on run time. I'm having 2 issues: 1) on MetaType.Add(properties names) i get ObjectReference exception when the Type includes Generic Type property. Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at ProtoBuf.Meta.TypeModel.ResolveProxies(Type type) in C:\Dev \protobuf-net\protobuf-net\Meta\TypeModel.cs:line 952 at ProtoBuf.Meta.RuntimeTypeModel.FindWithoutAdd(Type type) in C: \Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:line 118 at ProtoBuf.Meta.ValueMember..ctor(RuntimeTypeModel model, Type parentType, Int32 fieldNumber, MemberInfo member, Type memberType, Type itemType, Type defaul tType, DataFormat dataFormat, Object defaultValue) in C:\Dev\protobuf- net\protobuf-net\Meta\ValueMember.cs:line 75 at ProtoBuf.Meta.MetaType.AddField(Int32 fieldNumber, String memberName, Type itemType, Type defaultType, Object defaultValue) in C: \Dev\protobuf-net\protobu f-net\Meta\MetaType.cs:line 1165 at ProtoBuf.Meta.MetaType.Add(String[] memberNames) in C:\Dev \protobuf-net\protobuf-net\Meta\MetaType.cs:line 1046 2) If I'm skipping the Open generic types and im trying to register them at serialization : if (this._modal.CanSerializeContractType(objectType) == false) { this._modal.Add(objectType, false); this._modal.CompileInPlace(); } I get true in CanSerializeContractType, the type is serialized/ deserialized but only the base class (default values to all others). What is the practice to do so without adding all permutations at design time ? Thanks, Eyan. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Re: Issue 351 in protobuf: Make protobuf_lite proto files not create any static initializers
Comment #6 on issue 351 by e...@chromium.org: Make protobuf_lite proto files not create any static initializers http://code.google.com/p/protobuf/issues/detail?id=351 http://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/stubs/once.h #define GOOGLE_PROTOBUF_DECLARE_ONCE(NAME)\ ::google::protobuf::ProtobufOnceType NAME and struct LIBPROTOBUF_EXPORT ProtobufOnceType { ProtobufOnceType(); -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Error: Byte size calculation and serialization were inconsistent
This is weird. I don't see any clear potential cause, so I have a few questions: HTMud::EnvAdd item; item.set_id(ID); item.set_idtype(typeID); item.set_x(X); item.set_y(Y); item.set_z(Z); item.set_lockdown(lockdown); item.set_mapid(map); item.set_tilesetno(tilesetNo); item.set_tilesetx(tilesetX); item.set_regionx(regionX); item.set_regiony(regionZ); Are all these values primitives? Are any of them protocol buffers? Have you tried dumping the values that are being set when it dies, and trying a standalone program that sets the values and calls SerializeToString to see if it has the same problem? Have you made any changes to the protocol buffers library? I'm assuming you are using the released version of 2.4.1? Have you tried running this under valgrind? I'm wondering if there could be other weird memory corruption that is happening? That seems to be a frequent cause of this shouldn't be happening type errors, particularly things that appear/disappear occur with optimization enabled/disabled. Evan -- 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 protobuf@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] protobuf TextFormat question: Parsing TextFormat into message [fixed]
...previous message didn't have example code sanitized and probably doesn't make sense. Please delete/ignore previous and use this one. :) Hard to find much high-level documentation on using TextFormat, but for some Python protobuf work I'm doing, the text format is much easier to read (and easier to organize into test vector files) in the protobuf text format, rather than manipulating the python objects manually. (I've changed message types/contents to generalize, please forgive any typos, this isn't the real code) my_envelope.proto (this file gets sent through protoc to generate Python code): message MyEnvelope { optional InnerMessage innerMessage = 1; } and I have a test message that I'd like to take from TextFormat and put into a protobuf message structure: innerMessage { value1: 100 value2: 200 } I have found that I can get it to work in python using from google.protobuf import text_format import my_envelope_pb2 my_msg = my_envelope_pb2.MyEnvelope() text_format.Merge( innerMessage { value1: 100 value2: 200 } , my_msg) But I guess my question is this- is there a preferred way to do this? I had originally expected that ParseFromString would figure out that this was an ASCII representation and call Merge appropriately. i.e. I had expected the following would work import my_envelope_pb2 my_msg = my_envelope_pb2.MyEnvelope() my_msg.ParseFromString( inner { value1: 100 value2: 200 } ) but from the errors it appeared that ParseFromString only deals with string containers for binary format. Is this the case? Just trying to make sure I'm not calling Merge at an innapropriate/strange layer when some high-level call exists. As I mentioned, documentation on text format is somewhat thin, so this is the best I could piece together from API info. Thanks! -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@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] Error: Byte size calculation and serialization were inconsistent
Ah, thank you very much Evan. It turned out to be an uninitialized boolean. Properly setting the value in question seems to allow things to proceed normally. Thanks again, Robby On Mon, Feb 6, 2012 at 11:09 AM, Evan Jones ev...@csail.mit.edu wrote: This is weird. I don't see any clear potential cause, so I have a few questions: HTMud::EnvAdd item; item.set_id(ID); item.set_idtype(typeID); item.set_x(X); item.set_y(Y); item.set_z(Z); item.set_lockdown(lockdown); item.set_mapid(map); item.set_tilesetno(tilesetNo); item.set_tilesetx(tilesetX); item.set_regionx(regionX); item.set_regiony(regionZ); Are all these values primitives? Are any of them protocol buffers? Have you tried dumping the values that are being set when it dies, and trying a standalone program that sets the values and calls SerializeToString to see if it has the same problem? Have you made any changes to the protocol buffers library? I'm assuming you are using the released version of 2.4.1? Have you tried running this under valgrind? I'm wondering if there could be other weird memory corruption that is happening? That seems to be a frequent cause of this shouldn't be happening type errors, particularly things that appear/disappear occur with optimization enabled/disabled. Evan -- 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 protobuf@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] Re: Open generic types Serialization/ Deserialization
Marc replied on SO: http://stackoverflow.com/questions/915/protobuf-net-open-generic-types-serialization-deserialization#comment11515282_915 Thanks. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/865sJp2m8mwJ. To post to this group, send email to protobuf@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.