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

Report information
The Basics
Id:
134692
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
svo [...] otobo.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
  • 4.02
  • 4.03
Fixed in:
(no value)



Subject: decode() runs into "-e: semi-panic: attempt to dup freed string"
Date: Wed, 10 Mar 2021 04:39:07 -0500
From: svo@otobo.org
To: bug-JSON-XS@rt.cpan.org
Hi, this is initially a plea to help me to analyze my problem further, as at the moment I cannot systematically reproduce this behaviour. The code, which in my case runs into this problem from time to time is in condensed form: ``` use LWP::Simple; use JSON; my $WellKnown = get('https://login.microsoftonline.com/common/.well-known/openid-configuration'); if ( $WellKnown ) { my $JSONObject = JSON->new(); $JSONObject->allow_nonref(1); my $Result; eval { $Result = $JSONObject->decode( $WellKnown ) }; } ``` This is in reality spread over two modules (I programmed a module for OTRS, which has a wrapper around the JSON library) and runs on an Ubuntu 20.04 with apache and mod_perl. For this reason initially the version 2.94 of JSON was used, together with JSON::XS 4.02. Trying whether it helps I first installed JSON::XS 4.03, and then additionally the current versions of JSON and JSON::PP (4.03 and 4.06 - the latter might be unimportant, but I saw that some Boolean stuff is handled differently). The program does not always run into this error (I would say between 10% and 50% of the time), but I have the feeling that it happens in phases. Some kind of state of the server or the loaded libraries might be involved. Interestingly so far executing this via a simple shell script hadn't had this outcome - this can at most be taken as indication of something, though, I only tried a couple of times. At the moment I'm trying a downgrade to JSON::XS 3.04 (and JSON 2.94), as it ran in this combination on Ubuntu 18.04 for roughly a year now, without any error. I will update this issue when it either occured, or didn't occur for a day. I would be grateful for any hint on what I could try to tackle this down. Searching for "-e: semi-panic: attempt to dup freed string" didn't result in much helpful information for me, only that newSVsv() tried to duplicate a freed string on https://www.linux.org/docs/man1/perldiag.html - this does not help me much, though, unfortunately. Thanks, Sven P.S.: The JSON string in $WellKnown is the same, for when it works, and when it doesn't work, btw. Currently it's: ``` {"token_endpoint":"https://login.microsoftonline.com/common/oauth2/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/common/discove ry/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","token id_token"," token"],"scopes_supported":["openid"],"issuer":"https://sts.windows.net/{tenantid}/","microsoft_multi_refresh_token":true,"authorization_endpoint":"https://login.microsoftonline.com/common/oauth2/authorize","device_authorization_endpoint" :"https://login.microsoftonline.com/common/oauth2/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/common/oauth2/logout","claims_supported":["sub","iss ","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","amr","nonce","email","given_name","family_name","nickname"],"check_session_iframe":"https://login.microsoftonli ne.com/common/oauth2/checksession","userinfo_endpoint":"https://login.microsoftonline.com/common/openid/userinfo","tenant_region_scope":null,"cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_ host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"} ```
Am Mi 10. Mär 04:39:08 2021, svo@otobo.org schrieb:
Show quoted text
> At the moment I'm trying a downgrade to JSON::XS 3.04 (and JSON 2.94) [...]
The error did not occur for a little more than a day now, which makes me confident to assume that it was fixed by the downgrade. I will keep an eye on this over the next days and update this issue, if it should occur at a later time point.
Show quoted text
> P.S.: The JSON string in $WellKnown [...]
...has some linebreaks in the OP, which came from copying. They are not actually present.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.