Skip Menu |

This queue is for tickets about the JSON-XS CPAN distribution.

Report information
The Basics
Id: 69081
Status: resolved
Priority: 0/
Queue: JSON-XS

People
Owner: Nobody in particular
Requestors: iank [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.3
Fixed in: (no value)



Subject: Unexpected behaviour after assigning undef to a scalar which had previously been passed to json_decode
$ perl -v This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi $ perl -MJSON::XS -le 'print $JSON::XS::VERSION' 2.3 I really don't know what's going on here. This might not be a bug for JSON::XS, but it's a bug for -something- and I'd appreciate any help in tracking down the right something. When I decode_json some $var, then set $var to an undefined value, then decode_json the same $var, I get the first results back, as if $var hasn't changed (it has. I checked. I promise). Note that if I 'undef $var;' first, instead of '$var = <something returning an undefined value>', I get correct results (decode_json throws an exception). Test cases: This isn't right: perl -MJSON=decode_json -MData::Dumper -le 'sub blah { my $c; } my $h = "{\"a\":1}"; my $one = decode_json($h); print \$h; $a = blah(); print \$h; $two = decode_json($h); print Dumper($one); print Dumper($two);' SCALAR(0x125a948) SCALAR(0x125a948) $VAR1 = { 'a' => 1 }; $VAR1 = { 'a' => 1 }; This is just fine: $ perl -MJSON=decode_json -MData::Dumper -le 'my $h = "{\"a\":1}"; my $one = decode_json($h); print \$h; undef $h; print \$h; $two = decode_json($h); print Dumper($one); print Dumper($two);' SCALAR(0x11ecf10) SCALAR(0x11ecf10) malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "\x{0}\x{0}\x{0}\x{0}...") at -e line 1. I'm told: "I can reproduce it with perl-5.12.3 on Mandriva Linux Cooker." "unable to reproduce on perl v5.12.3 with JSON 2.53 [...] though i'm on OS X" (perl-5.14.1) "yes, I can reproduce the bug after I installed JSON::XS"
Subject: Re: [rt.cpan.org #69081] Unexpected behaviour after assigning undef to a scalar which had previously been passed to json_decode
Date: Fri, 24 Jun 2011 23:02:25 +0200
To: Ian Kilgore via RT <bug-JSON-XS [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
Hi! You sent a possible bug report on or via rt.cpan.org. Please read this mail carefully if you want to be heard. Most likely, your report here will be ignored. Please close the ticket again and sent it to the official contact address for the module in question (or send it to rt.cpan.org@schmorp.de). Why is this necessary? rt.cpan.org has many deficiencies which makes it tedious and hard to use, increasing the workload on the people who provide all the perl modules you probably appreciate (and that is really to be avoided - module authors should be able to invest all their time into improving their modules and not fighting with rt.cpan.org's bugs). Still, for some people, rt.cpan.org is useful to have, and some people even like it and really want to use it. That is fine, too. Unfortunately, the designers of rt.cpan.org didn't make their "service" optional - you can neither opt-in nor opt-out of rt.cpan.org as a module author. Just like a spammer, rt.cpan.org forces its "service" (whether wanted or unwanted) on everybody. Just like a spammer, they don't care for the people they actively hurt. Just like a spammer, they don't don't care to fix these issues and make their "service" ethically acceptable. You cannot even configure it to redirect tickets to somewhere else. Unfortunately, ignoring rt.cpan.org is not an option either: for people reporting possible bugs there is no indication that their report will be ignored, and for module authors it means they miss potentially vital bug reports such as yours (and of course it's a great impression if rt.cpan.org has lots of bug reports that are unanswered, making a module look unmaintained when in fact the opposite might be true). I am sorry that this wasted a bit of your time, but please understand that I am just as much a victim as you are - the problem is the unethical stance of the rt.cpan.org providers who force their "service" on everybody. Please redirect your bug report as stated in the beginning of this mail, and please consider petitioning the rt.cpan.org providers to stop their unethical behaviour and allow opt-in, opt-out, or some redirect option. Thanks a lot, Marc Lehmann <rt.cpan.org@schmorp.de>
ahahaha. sent to rt.cpan.org@schmorp.de.