[protobuf] Segmentation fault when running unit test

2016-10-08 Thread khing blue
I'm trying to build PB in cygwin environment, but seeing following error:

$ make check
...
PASS: protobuf-lazy-descriptor-test.exe
PASS: protobuf-lite-test.exe
../test-driver: line 107: 572536 Segmentation fault  (core dumped) "$@" 
> $log_file 2>&1
FAIL: protobuf-test.exe
PASS: protobuf-lite-arena-test.exe
PASS: no-warning-test.exe
PASS: google/protobuf/compiler/zip_output_unittest.sh
...

See src/test-suite.log
Please report to protobuf@googlegroups.com



Is there anything I can do?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

   Protocol Buffers 3.0.2: src/test-suite.log


# TOTAL: 6
# PASS:  5
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: protobuf-test
===

Running main() from gmock_main.cc
[==] Running 1864 tests from 182 test cases.
[--] Global test environment set-up.
[--] 6 tests from DescriptorPoolTypeResolverTest
[ RUN  ] DescriptorPoolTypeResolverTest.TestAllTypes
[   OK ] DescriptorPoolTypeResolverTest.TestAllTypes (8 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestPackedField
[   OK ] DescriptorPoolTypeResolverTest.TestPackedField (0 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestOneof
[   OK ] DescriptorPoolTypeResolverTest.TestOneof (0 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestMap
[   OK ] DescriptorPoolTypeResolverTest.TestMap (2 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestEnum
[   OK ] DescriptorPoolTypeResolverTest.TestEnum (0 ms)
[ RUN  ] DescriptorPoolTypeResolverTest.TestJsonName
[   OK ] DescriptorPoolTypeResolverTest.TestJsonName (2 ms)
[--] 6 tests from DescriptorPoolTypeResolverTest (13 ms total)

[--] 8 tests from TimeUtilTest
[ RUN  ] TimeUtilTest.TimestampStringFormat
[   OK ] TimeUtilTest.TimestampStringFormat (0 ms)
[ RUN  ] TimeUtilTest.DurationStringFormat
[   OK ] TimeUtilTest.DurationStringFormat (1 ms)
[ RUN  ] TimeUtilTest.GetEpoch
[   OK ] TimeUtilTest.GetEpoch (0 ms)
[ RUN  ] TimeUtilTest.DurationIntegerConversion
[   OK ] TimeUtilTest.DurationIntegerConversion (0 ms)
[ RUN  ] TimeUtilTest.TimeTConversion
[   OK ] TimeUtilTest.TimeTConversion (0 ms)
[ RUN  ] TimeUtilTest.TimevalConversion
[   OK ] TimeUtilTest.TimevalConversion (0 ms)
[ RUN  ] TimeUtilTest.DurationOperators
[   OK ] TimeUtilTest.DurationOperators (1 ms)
[ RUN  ] TimeUtilTest.TimestampOperators
[   OK ] TimeUtilTest.TimestampOperators (0 ms)
[--] 8 tests from TimeUtilTest (2 ms total)

[--] 1 test from TestUtilTest
[ RUN  ] TestUtilTest.TimestampIntegerConversion
[   OK ] TestUtilTest.TimestampIntegerConversion (0 ms)
[--] 1 test from TestUtilTest (0 ms total)

[--] 73 tests from MessageDifferencerTest
[ RUN  ] MessageDifferencerTest.BasicEqualityTest
[   OK ] MessageDifferencerTest.BasicEqualityTest (4 ms)
[ RUN  ] MessageDifferencerTest.BasicInequalityTest
[   OK ] MessageDifferencerTest.BasicInequalityTest (0 ms)
[ RUN  ] MessageDifferencerTest.RepeatedFieldInequalityTest
[   OK ] MessageDifferencerTest.RepeatedFieldInequalityTest (0 ms)
[ RUN  ] MessageDifferencerTest.MapFieldEqualityTest
[   OK ] MessageDifferencerTest.MapFieldEqualityTest (9 ms)
[ RUN  ] MessageDifferencerTest.BasicPartialEqualityTest
[   OK ] MessageDifferencerTest.BasicPartialEqualityTest (0 ms)
[ RUN  ] MessageDifferencerTest.PartialEqualityTestExtraField
[   OK ] MessageDifferencerTest.PartialEqualityTestExtraField (0 ms)
[ RUN  ] MessageDifferencerTest.PartialEqualityTestSkipRequiredField
[   OK ] MessageDifferencerTest.PartialEqualityTestSkipRequiredField (0 ms)
[ RUN  ] MessageDifferencerTest.BasicPartialInequalityTest
[   OK ] MessageDifferencerTest.BasicPartialInequalityTest (0 ms)
[ RUN  ] MessageDifferencerTest.PartialInequalityMissingFieldTest
[   OK ] MessageDifferencerTest.PartialInequalityMissingFieldTest (0 ms)
[ RUN  ] MessageDifferencerTest.RepeatedFieldPartialInequalityTest
[   OK ] MessageDifferencerTest.RepeatedFieldPartialInequalityTest (0 ms)
[ RUN  ] MessageDifferencerTest.BasicEquivalencyTest
[   OK ] MessageDifferencerTest.BasicEquivalencyTest (0 ms)
[ RUN  ] MessageDifferencerTest.EquivalencyNotEqualTest
[   OK ] 

[protobuf] Re: Message with multiple strings problem

2016-10-08 Thread Chazix
Changing to use a repeated field for my strings seems to have fixed the 
problem.

message Connected {
>   sint32 xloc = 1; // x spawn world position
>   sint32 yloc = 2; // y spawn world position
>   sint32 zrot = 3; // z spawn rotation
>   // [0] => username
>   // [1] => userid
>   // [2] => shipcolor
>   // [3] => shipname
>   repeated string userinfo = 4;
> }
>

With this I am able to manually add the new strings to the repeated string 
list.

server::player::Connected connectMessage;
> connectMessage.set_xloc(stats.m_xPos);
> connectMessage.set_yloc(stats.m_yPos);
> connectMessage.set_zrot(stats.m_zRot);
> // [0] => username
> connectMessage.add_userinfo();
> connectMessage.set_userinfo(0, stats.m_clientName);
> // [1] => userid
> connectMessage.add_userinfo();
> connectMessage.set_userinfo(1, stats.m_clientId);
> // [2] => shipcolor
> connectMessage.add_userinfo();
> connectMessage.set_userinfo(2, stats.m_shipColor);
> // [3] => shipname
> connectMessage.add_userinfo();
> connectMessage.set_userinfo(3, stats.m_shipName);
>

It definitely allows for a cleaner .proto file, but it's strange that just 
using individual strings was causing a problem.

On Friday, October 7, 2016 at 2:56:14 PM UTC-7, Chazix wrote:
>
> Hello,
>
> I have a message that looks like:
>
> message Connected {
>>   sint32 xloc   = 1; // x spawn world position
>>   sint32 yloc   = 2; // y spawn world position
>>   sint32 zrot   = 3; // z spawn rotation
>>   string sector = 4; // sector name (unsure about this)
>>   string name   = 5; // player name
>>   string pid= 6; // player id
>>   string scolor = 7; // ship color
>>   string sname  = 8; // ship name
>> }
>
>
> I am attempting to initialize it within my c++ code like this:
>
>>
>> GameClientStats& stats = gameClient.GetGameClientStats();
>> server::player::Connected connectMessage; // send this to this joining 
>> client
>> connectMessage.set_name(stats.m_clientName);
>> connectMessage.set_pid(stats.m_clientId);
>> connectMessage.set_scolor(stats.m_shipColor);
>> connectMessage.set_sname(stats.m_shipName);
>> connectMessage.set_xloc(stats.m_xPos);
>> connectMessage.set_yloc(stats.m_yPos);
>> connectMessage.set_zrot(stats.m_zRot);
>
>
> For some reason as I set my string parameters, the prior strings before it 
> gets set to that string value. So, if I do the set_pid the name field will 
> also change to the pid. set_scolor the name & pid will be set to the 
> s_color. set_sname the name, pid & scolor will change to be the sname. It 
> seems like they are all sharing the same string pointer field location.
>
> Am I not initializing my message correctly? Or do I need to do something 
> differently here? When I Serialize my messages from a coded stream I get my 
> expected message, but manual creation doesn't seem to be working with what 
> I'm currently trying to do.
>
> Thank you very much for the information.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.