[#41916] Proposal: Bitmap Marking GC — Narihiro Nakamura <authornari@...>

Hi.

18 messages 2012/01/05

[#41941] [ruby-trunk - Bug #5851][Open] make check fails when compiling with GCC 4.7 - *** longjmp causes uninitialized stack frame *** — Vit Ondruch <v.ondruch@...>

12 messages 2012/01/06

[#41979] [ruby-trunk - Bug #5865][Open] Exception#== should return false if the classes differ — Hiro Asari <asari.ruby@...>

10 messages 2012/01/08

[#42003] [ruby-trunk - Bug #5871][Open] regexp \W matches some word characters when inside a case-insensitive character class — Gareth Adams <gareth@...>

14 messages 2012/01/09

[#42016] [ruby-trunk - Feature #5873][Open] Adopt FFI over DL — Heesob Park <phasis@...>

15 messages 2012/01/10

[#42149] [ruby-trunk - Feature #5899][Open] chaining comparsions. — Ondrej Bilka <neleai@...>

12 messages 2012/01/16

[#42164] [ruby-trunk - Feature #5903][Open] Optimize st_table (take 2) — Yura Sokolov <funny.falcon@...>

18 messages 2012/01/17

[ruby-core:42131] [ruby-trunk - Bug #5888][Assigned] JSON unittest fails

From: Yui NARUSE <naruse@...>
Date: 2012-01-15 01:29:39 UTC
List: ruby-core #42131
Issue #5888 has been updated by Yui NARUSE.

Status changed from Open to Assigned
Assignee set to Yui NARUSE

filed it to GCC's tracker.

For JSON, following is simple patch:

diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
index d1d14c7..1773616 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -1293,6 +1293,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
 {
     char *p = string, *pe = string, *unescape;
     int unescape_len;
+    char buf[4];

     while (pe < stringEnd) {
         if (*pe == '\\') {
@@ -1325,7 +1326,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
                     if (pe > stringEnd - 4) {
                         return Qnil;
                     } else {
-                        char buf[4];
                         UTF32 ch = unescape_unicode((unsigned char *) ++pe);
                         pe += 3;
                         if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
----------------------------------------
Bug #5888: JSON unittest fails
https://bugs.ruby-lang.org/issues/5888

Author: Vit Ondruch
Status: Assigned
Priority: Normal
Assignee: Yui NARUSE
Category: 
Target version: 
ruby -v: ruby 1.9.3p0 (2011-10-30) [x86_64-linux]


Hello,

When building Ruby 1.9.3 (as well as 2.0.0), the make check spits following errors:

  1) Failure:
test_parse_values(TC_JSON) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json.rb:174]:
<["\"\b\n\r\t\u0000\u001F"]> expected but was
<["\"\b\n\r\t\xA8\xA8"]>.
  2) Failure:
test_parser_reset(TC_JSON) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json.rb:291]:
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\u0000\u001F",
 "h"=>1000.0,
 "i"=>0.001}> expected but was
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\xA0\xA0",
 "h"=>1000.0,
 "i"=>0.001}>.
  3) Failure:
test_fast_generate(TC_JSONGenerate) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json_generate.rb:78]:
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\u0000\u001F",
 "h"=>1000.0,
 "i"=>0.001}> expected but was
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\xA0\xA0",
 "h"=>1000.0,
 "i"=>0.001}>.
  4) Failure:
test_generate(TC_JSONGenerate) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json_generate.rb:47]:
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\u0000\u001F",
 "h"=>1000.0,
 "i"=>0.001}> expected but was
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\xA0\xA0",
 "h"=>1000.0,
 "i"=>0.001}>.
  5) Failure:
test_generate_pretty(TC_JSONGenerate) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json_generate.rb:61]:
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\u0000\u001F",
 "h"=>1000.0,
 "i"=>0.001}> expected but was
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\xA0\xA0",
 "h"=>1000.0,
 "i"=>0.001}>.
  6) Failure:
test_own_state(TC_JSONGenerate) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json_generate.rb:92]:
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\u0000\u001F",
 "h"=>1000.0,
 "i"=>0.001}> expected but was
<{"a"=>2,
 "b"=>3.141,
 "c"=>"c",
 "d"=>[1, "b", 3.14],
 "e"=>{"foo"=>"bar"},
 "g"=>"\"\xA0\xA0",
 "h"=>1000.0,
 "i"=>0.001}>.
  7) Failure:
test_chars(TC_JSONUnicode) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json_unicode.rb:57]:
<"\x00"> expected but was
<"\xA0">.
  8) Failure:
test_unicode(TC_JSONUnicode) [/builddir/build/BUILD/ruby-1.9.3-p0/test/json/test_json_unicode.rb:20]:
<["\u00A9 \u2260 \u20AC! \u0001"]> expected but was
<["\u00A9 \u2260 \u20AC! \xD8"]>.


Please note that I am building Ruby using GCC 4.7 on Fedora Rawhide. I have not seen this errors before with GCC 4.6


-- 
http://bugs.ruby-lang.org/

In This Thread