X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=nuU8NCMLm1CJq6lbgAapSMYp2ZGbS CCmoDkB517KjGt76xVWEdS6jussBsrZra1ic1+JQeTggtOapiFWHbBjkyxw+AwrF FuX50tk76l9xXA6bwoEpP09B/cXazEjv66E0kJ4bXOCVDusojzXQMheBeNbP1Qtf oV4YHC+/+MLS0E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=TPr/W8R0uTEyjBg8K9iT+a2cclI=; b=aKt 9miDln/2ihvHZmtVERgkp+K80GaFIQPDuCFm5C4+8qTqFMXqos2wDa844uydEtVz ThhgYVyyjCOhwSCoU3+tshOys2t0gqSZLdi6SKVPS0DvTLtsKqitMNh7p16CKPkC RYDbfTjXHUkwthob8sIgCsAudmvgM8SmHszS2tqg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=launched, forcefully, OK, decode X-HELO: homiemail-a104.g.dreamhost.com X-Gm-Message-State: AD7BkJIRkxkjG5luy/RhBaT05bXUjX8mJLXjK4LgVEyszY6Bm7wpeIK1lZkA2HZU42uZzEd7Eq+xBdTS5/giiQ== X-Received: by 10.182.111.137 with SMTP id ii9mr3896536obb.77.1457049288956; Thu, 03 Mar 2016 15:54:48 -0800 (PST) MIME-Version: 1.0 From: Wayne Davison Date: Thu, 3 Mar 2016 15:54:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Latest perl JSON::XS failing when threaded To: cygwin Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes I updated cygwin today, and now perl JSON::XS fails to be able to decode json data if it is run in a multi-threaded script. I tested both x86_64 and x86 32-bit versions of cygwin, and they both have the issue: once I launch a new thread, JSON::XS refuses to parse anything, even in the primary thread and even if the launched thread didn't do any json work. The error is similar to this for a decode_json() call: Thread 1 terminated abnormally: JSON text must be an object or array [...] Note that it is complaining about the arg not being an object when decoding takes a string. If I pass it an object, it accepts the wrong-typed var and fails with a parsing error. I forcefully uninstalled JSON::XS and the bug goes away. I'll append a simple test script that tries to do a decrypt_json() in a thread. ..wayne.. -------------------------------------------------------------------------------- #!/usr/bin/perl use strict; use warnings; use threads; use JSON::XS; print "Normal:\n"; # This works: test_json_xs(); print "Threaded:\n"; # This throws an error: my $t = threads->create(\&test_json_xs); $t->detach(); exit; sub test_json_xs { my $test = <{testing} eq 'ARRAY') { print "OK!\n"; } else { print "FAIL!\n"; } } -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple