I will try and figure out where the segfault is happening and get back to 
you.

My compiler options included the following flag: -fsingle-precision-constant

Turning off this option got rid of all the precision errors. Every test now 
passes prior to the segfault. However I still segfault at the infinity test.

Now I am wondering if it has to do with the fact that I am compiling for 
softfp. Perhaps I need to try doing all floating point in software.

Best,
David

On Tuesday, November 15, 2016 at 4:18:05 PM UTC-6, Adam Cozzette wrote:
>
> Interestingly it kind of looks like your compiler is treating 
> floating-point literals as single-precision floats instead of doubles. 
> Judging from this snippet you posted for example:
>
> Expected: 1.234567890123456789
> Which is: 1.2345678806304932
>
> The first number is the original text from the source file, but the second 
> number is the compiler's interpretation of it and seems to be downgraded to 
> a 32-bit float.
>
> I'm not sure of the exact link between that and the segfault, but I 
> suspect they're related because the failing test (InfinityInputTest) 
> involves setting float and double fields to infinity. If you could figure 
> out which line in that test triggers the segfault that would be useful to 
> know, too.
>
> On Fri, Nov 11, 2016 at 2:53 PM, David Edge <edge...@gmail.com 
> <javascript:>> wrote:
>
>> I have been trying to compile protobuf for soft float ARMv7. I am 
>> compiling on board rather than cross compiling, and am failing some unit 
>> tests when I run "make check". Most of the tests seem to be failing due to 
>> rounding error, and the segmentation fault seems to have occurred during an 
>> infinity input test, so I'm thinking I could fix these by using less 
>> aggressive optimization flags and turning off fastmath.
>>
>> Any ideas?
>>
>> I can't seem to attach the whole logfile, as it is over 200MB. I attached 
>> one of the longer failed unit tests and a few more interesting pieces 
>> below. Here is my console output:
>>
>> ./test-driver: line 107:  2847 Segmentation fault      "$@" > $log_file 
>> 2>&1
>> FAIL: protobuf-test
>> PASS: protobuf-lazy-descriptor-test
>> PASS: protobuf-lite-test
>> PASS: google/protobuf/compiler/zip_output_unittest.sh
>> PASS: google/protobuf/io/gzip_stream_unittest.sh
>> PASS: protobuf-lite-arena-test
>> PASS: no-warning-test
>>
>> ============================================================================
>> Testsuite summary for Protocol Buffers 3.1.0
>>
>> ============================================================================
>> # TOTAL: 7
>> # PASS:  6
>> # SKIP:  0
>> # XFAIL: 0
>> # FAIL:  1
>> # XPASS: 0
>> # ERROR: 0
>>
>> ============================================================================
>> See src/test-suite.log
>> Please report to prot...@googlegroups.com <javascript:>
>>
>> ============================================================================
>> Makefile:7407: recipe for target 'test-suite.log' failed
>>
>> And here are some of the failures from the log:
>> ================================================
>>    Protocol Buffers 3.1.0: src/test-suite.log
>> ================================================
>>
>> # TOTAL: 7
>> # PASS:  6
>> # SKIP:  0
>> # XFAIL: 0
>> # FAIL:  1
>> # XPASS: 0
>> # ERROR: 0
>>
>> .. contents:: :depth: 2
>>
>> FAIL: protobuf-test
>> ===================
>>
>> google/protobuf/descriptor_unittest.cc:2312: Failure
>> Value of: message->field(5)->default_value_double()
>>   Actual: 1e+101
>> Expected: 10e100
>> Which is: inf
>> [  FAILED  ] MiscTest.DefaultValues (2 ms)
>>
>> google/protobuf/descriptor_unittest.cc:2786: Failure
>> Value of: options->GetExtension(protobuf_unittest::double_opt)
>>   Actual: 1.2345678901234567
>> Expected: 1.234567890123456789
>> Which is: 1.2345678806304932
>> [  FAILED  ] CustomOptions.OptionTypes (0 ms)
>>
>> [ RUN      ] TimeUtilTest.DurationOperators
>> google/protobuf/util/time_util_test.cc:276: Failure
>> Value of: TimeUtil::ToString(a * 0.5)
>>   Actual: "0s"
>> Expected: "0.999999999s"
>> google/protobuf/util/time_util_test.cc:277: Failure
>> Value of: TimeUtil::ToString(b * 0.5)
>>   Actual: "0s"
>> Expected: "-0.999999999s"
>> [  FAILED  ] TimeUtilTest.DurationOperators (1 ms)
>>
>> [ RUN      ] JsonStreamParserTest.ArrayComplexValues
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing 
>> split: ><[[22, -127, 45.3, -1056.4, 11779497823553162765], {'key': true}]
>> unknown file: Failure
>>
>> Unexpected mock function call - returning default value.
>>     Function call: RenderDouble({}, 45.3)
>>           Returns: NULL
>> Google Mock tried the following 2 expectations, but none matched:
>>
>> ./google/protobuf/util/internal/expecting_objectwriter.h:178: tried 
>> expectation #0: EXPECT_CALL(*mock_, RenderDouble(IsEmpty(), 
>> NanSensitiveDoubleEq(value)))...
>>   Expected arg #1: is approximately 45.299999237060547
>>            Actual: 45.3
>>          Expected: to be called once
>>            Actual: never called - unsatisfied and active
>> ./google/protobuf/util/internal/expecting_objectwriter.h:178: tried 
>> expectation #1: EXPECT_CALL(*mock_, RenderDouble(IsEmpty(), 
>> NanSensitiveDoubleEq(value)))...
>>   Expected arg #1: is approximately -1056.4000244140625
>>            Actual: 45.3
>>          Expected: to be called once
>>            Actual: never called - unsatisfied and active
>> unknown file: Failure
>>
>> Unexpected mock function call - returning default value.
>>     Function call: RenderDouble({}, -1056.4)
>>           Returns: NULL
>> Google Mock tried the following 2 expectations, but none matched:
>>
>> ./google/protobuf/util/internal/expecting_objectwriter.h:178: tried 
>> expectation #0: EXPECT_CALL(*mock_, RenderDouble(IsEmpty(), 
>> NanSensitiveDoubleEq(value)))...
>>   Expected arg #1: is approximately 45.299999237060547
>>            Actual: -1056.4
>>          Expected: to be called once
>>            Actual: never called - unsatisfied and active
>> ./google/protobuf/util/internal/expecting_objectwriter.h:178: tried 
>> expectation #1: EXPECT_CALL(*mock_, RenderDouble(IsEmpty(), 
>> NanSensitiveDoubleEq(value)))...
>>   Expected arg #1: is approximately -1056.4000244140625
>>            Actual: -1056.4
>>          Expected: to be called once
>>            Actual: never called - unsatisfied and active
>> unknown file: Failure
>>
>> Unexpected mock function call - returning default value.
>>     Function call: RenderUint64({}, 11779497823553162765)
>>           Returns: NULL
>> Google Mock tried the following 2 expectations, but none matched:
>>
>> ./google/protobuf/util/internal/expecting_objectwriter.h:167: tried 
>> expectation #0: EXPECT_CALL(*mock_, RenderUint64(IsEmpty(), 
>> TypedEq<uint64>(value)))...
>>          Expected: the expectation is active
>>            Actual: it is retired
>>          Expected: to be called once
>>            Actual: called once - saturated and retired
>> ./google/protobuf/util/internal/expecting_objectwriter.h:167: tried 
>> expectation #1: EXPECT_CALL(*mock_, RenderUint64(IsEmpty(), 
>> TypedEq<uint64>(value)))...
>>          Expected: all pre-requisites are satisfied
>>            Actual: the following immediate pre-requisites are not 
>> satisfied:
>> ./google/protobuf/util/internal/expecting_objectwriter.h:178: 
>> pre-requisite #0
>>                    (end of pre-requisites)
>>          Expected: to be called once
>>            Actual: never called - unsatisfied and active
>> unknown file: Failure
>>
>> ===
>> Snipped thousands of similar lines here.
>> ====
>>
>> ./google/protobuf/util/internal/expecting_objectwriter.h:95: Failure
>> Actual function call count doesn't match EXPECT_CALL(*mock_, 
>> StartObject(IsEmpty()))...
>>          Expected: to be called once
>>            Actual: never called - unsatisfied and active
>> ./google/protobuf/util/internal/expecting_objectwriter.h:96: Failure
>> Actual function call count doesn't match EXPECT_CALL(*mock_, 
>> StartObject(StrEq(name.ToString())))...
>>          Expected: to be called once
>>            Actual: never called - unsatisfied and active
>> [  FAILED  ] JsonStreamParserTest.ObjectValues (88792 ms)
>>
>> [ RUN      ] JsonStreamParserTest.RejectNonUtf8WhenNotCoerced
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing 
>> split: ><{"address":ÿ"חרושת 23, ×¨×¢× × ×”, ×™×©×¨× ×œ"}
>>
>> GMOCK WARNING:
>> Uninteresting mock function call - returning default value.
>>     Function call: StartObject({})
>>           Returns: NULL
>> Stack trace:
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing 
>> split: {><"address":ÿ"חרושת 23, ×¨×¢× × ×”, ×™×©×¨× ×œ"}
>>
>> GMOCK WARNING:
>> Uninteresting mock function call - returning default value.
>>     Function call: StartObject({})
>>           Returns: NULL
>> Stack trace:
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing 
>> split: {"><address":ÿ"חרושת 23, ×¨×¢× × ×”, ×™×©×¨× ×œ"}
>>
>> GMOCK WARNING:
>> Uninteresting mock function call - returning default value.
>>     Function call: StartObject({})
>>           Returns: NULL
>> Stack trace:
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing 
>> split: {"a><ddress":ÿ"חרושת 23, ×¨×¢× × ×”, ×™×©×¨× ×œ"}
>>
>> GMOCK WARNING:
>> Uninteresting mock function call - returning default value.
>>     Function call: StartObject({})
>>           Returns: NULL
>> Stack trace:
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing 
>> split: {"ad><dress":ÿ"חרושת 23, ×¨×¢× × ×”, ×™×©×¨× ×œ"}
>>
>> =====
>> snipped similar lines
>> =====
>>
>> GMOCK WARNING:
>> Uninteresting mock function call - returning default value.
>>     Function call: StartList({})
>>           Returns: NULL
>> Stack trace:
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing 
>> split: ["\ud83d\ud83d"><]
>>
>> GMOCK WARNING:
>> Uninteresting mock function call - returning default value.
>>     Function call: StartList({})
>>           Returns: NULL
>> Stack trace:
>> [libprotobuf INFO 
>> google/protobuf/util/internal/json_stream_parser_test.cc:97] Testing split 
>> every char: ["\ud83d\ud83d"]
>>
>> GMOCK WARNING:
>> Uninteresting mock function call - returning default value.
>>     Function call: StartList({})
>>           Returns: NULL
>> Stack trace:
>> [       OK ] 
>> JsonStreamParserTest.UnicodeEscapingMissingLowSurrogateWhenNotCoerced (7 ms)
>>
>> This seems to be where the segfault occurs:
>>
>> [----------] 45 tests from 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EmptyObject/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EmptyObject/0 (33 
>> ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.SimpleObject/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.SimpleObject/0 (1 
>> ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.SimpleMessage/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.SimpleMessage/0 (4 
>> ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.CustomJsonName/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.CustomJsonName/0 (0 
>> ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.IntEnumValuesAreAccepted/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.IntEnumValuesAreAccepted/0
>>  
>> (1 ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EnumValuesWithoutUnderscoreAreAccepted/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EnumValuesWithoutUnderscoreAreAccepted/0
>>  
>> (1 ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EnumValuesInCamelCaseAreAccepted/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EnumValuesInCamelCaseAreAccepted/0
>>  
>> (0 ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EnumValuesInCamelCaseWithNameNotUppercaseAreAccepted/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.EnumValuesInCamelCaseWithNameNotUppercaseAreAccepted/0
>>  
>> (1 ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.PrimitiveFromStringConversion/0
>> [       OK ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.PrimitiveFromStringConversion/0
>>  
>> (1 ms)
>> [ RUN      ] 
>> DifferentTypeInfoSourceTest/ProtoStreamObjectWriterTest.InfinityInputTest/0
>> FAIL protobuf-test (exit status: 139)
>>
>>
>> -- 
>> 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+u...@googlegroups.com <javascript:>.
>> To post to this group, send email to prot...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.

Reply via email to