MessageToJsonString crash

156 views
Skip to first unread message

Terry Fryar

unread,
Jan 11, 2021, 12:11:55 PM1/11/21
to Protocol Buffers
Using 3.6.1 on an ARM platform.  Trying this sample code:

PROTO
syntax = "proto3";
package Test;
message MyTest {
    int32 f1 = 1;
    string f2 = 2;
    bool f3 = 3;
}

C++
Test::MyTest mt;
mt.set_f1(1234);
mt.set_f2("hello");
mt.set_f3(true);
string s;
google::protobuf::util::JsonOptions opts;
google::protobuf::util::MessageToJsonString(mt,&s,opts);

and I get this crash on the MessageToJsonString function call:

*** Error in `./MyApp': munmap_chunk(): invalid pointer: 0xb6fb1214 ***
Aborted

All the serialization functions work fine.  Why am I getting this error?  Thanks!

Terry Fryar

unread,
Jan 11, 2021, 12:50:48 PM1/11/21
to Protocol Buffers
Well, I have been using this ARM cross compiled protobuf for over a year with no problems.  But just today I tried using the ARM compiled protoc to compile a test file on the target device...I get the same " munmap_chunk()" error!  I normally do the proto compile using the host protoc, and it seems to be fine.  All my protobuf stuff is 3.6.1.  My cross compile was pretty simple:

./autogen.sh                  
./configure --prefix=/usr/local/protobuf-3.6.1-arm --host=arm-linux-gnueabihf
make
make install

And I copy the installed folder to my target board (beaglebone) and protobuf works just fine.  I can serialize/deserialize with no problems.  I am using 4.9.3 of the linaro toolchain to do the build.  Why would my xcompiled protoc compiler fail to compile a simple test on the target device with this "munmap_chunk" error?

Thanks!
Reply all
Reply to author
Forward
0 new messages