JsonStreamParserTest.ObjectValues test failure

80 views
Skip to first unread message

ravisa...@gmail.com

unread,
Nov 15, 2021, 11:40:35 AM11/15/21
to Protocol Buffers

Facing issue with test JsonStreamParserTest.ObjectValues on big-endian system,

Any idea on following error:
[ RUN      ] JsonStreamParserTest.ObjectValues
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: ><{t: true, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {><t: true, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t><: true, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t:>< true, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t: ><true, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t: t><rue, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t: tr><ue, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t: tru><e, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t: true><, f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
[libprotobuf INFO google/protobuf/util/internal/json_stream_parser_test.cc:111] Testing split: {t: true,>< f: false, n: null, s: 'a string', d: "another string", pi: 22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], o: {'key': true}}
...


Adam Cozzette

unread,
Nov 15, 2021, 3:58:52 PM11/15/21
to ravisa...@gmail.com, Protocol Buffers
I don't think we actively test on any big-endian machines, so it wouldn't be surprising if there are a few bugs that come up in that environment. We would welcome any pull requests with bug fixes.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/547a1ae9-8eab-4101-9c80-f4c3cef9dbcfn%40googlegroups.com.
Message has been deleted

ravisa...@gmail.com

unread,
Nov 23, 2021, 9:05:08 AM11/23/21
to Protocol Buffers
protobuf-test is failing with segmentation fault after execution of test sonStreamParserTest.ObjectValues.
Please find the log attached for the same.

I have observed that the if the string used in testcase is reduced to 149 characters the testcase observed passing.

Example: with change:
diff --git a/src/google/protobuf/util/internal/json_stream_parser_test.cc b/src/google/protobuf/util/internal/json_stream_parser_test.cc
index 4bb10251e..b8243468a 100644
--- a/src/google/protobuf/util/internal/json_stream_parser_test.cc
+++ b/src/google/protobuf/util/internal/json_stream_parser_test.cc
@@ -410,7 +410,7 @@ TEST_F(JsonStreamParserTest, ArrayComplexValues) {
 // - object containing array, object, value (true, false, null, num, string)
 TEST_F(JsonStreamParserTest, ObjectValues) {
   StringPiece str =
-      "{t: true, f: false, n: null, s: 'a string', d: \"another string\", pi: "
+      "{t: true, f: false, n: null, s: 'a string', d: \"anoth\", pi: "
       "22, ni: -127, pd: 45.3, nd: -1056.4, pl: 11779497823553162765, l: [[]], "
       "o: {'key': true}}";
   for (int i = 0; i <= str.length(); ++i) {
@@ -419,7 +419,7 @@ TEST_F(JsonStreamParserTest, ObjectValues) {
         ->RenderBool("f", false)
         ->RenderNull("n")
         ->RenderString("s", "a string")
-        ->RenderString("d", "another string")
+        ->RenderString("d", "anoth")
         ->RenderUint64("pi", 22)
         ->RenderInt64("ni", -127)
         ->RenderDouble("pd", 45.3)

Any comments to debug on this would be useful and wanted to know the importance of this test.
protobuf-test.log

ravisa...@gmail.com

unread,
Dec 10, 2021, 1:20:04 AM12/10/21
to Protocol Buffers
Any input on this will be very helpful.
Reply all
Reply to author
Forward
0 new messages