From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123078 invoked by alias); 3 Mar 2016 23:54:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 122899 invoked by uid 89); 3 Mar 2016 23:54:52 -0000 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 Received: from sub4.mail.dreamhost.com (HELO homiemail-a104.g.dreamhost.com) (69.163.253.135) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 03 Mar 2016 23:54:51 +0000 Received: from homiemail-a104.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a104.g.dreamhost.com (Postfix) with ESMTP id CBECE20082313 for ; Thu, 3 Mar 2016 15:54:49 -0800 (PST) Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dropbox@opencoder.net) by homiemail-a104.g.dreamhost.com (Postfix) with ESMTPSA id B9E542008230F for ; Thu, 3 Mar 2016 15:54:49 -0800 (PST) Received: by mail-ob0-f179.google.com with SMTP id xx9so35723986obc.2 for ; Thu, 03 Mar 2016 15:54:49 -0800 (PST) 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 Received: by 10.60.33.4 with HTTP; Thu, 3 Mar 2016 15:54:29 -0800 (PST) From: Wayne Davison Date: Thu, 03 Mar 2016 23:54:00 -0000 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 X-SW-Source: 2016-03/txt/msg00033.txt.bz2 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