Skip Menu |

This queue is for tickets about the indirect CPAN distribution.

Report information
The Basics
Id: 127118
Status: resolved
Priority: 0/
Queue: indirect

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

Bug Information
Severity: Unimportant
Broken in: 0.38
Fixed in: 0.39



Subject: Fails on perl >= v5.28.0 with -Duseithreads -DDEBUGGING
As per subject. Sample fail report: http://www.cpantesters.org/cpan/report/95315667 The first such fail report in the 5.27 cycle: http://www.cpantesters.org/cpan/report/88862316
On Sun Sep 16 04:09:36 2018, ANDK wrote: Show quoted text
> As per subject. Sample fail report: > http://www.cpantesters.org/cpan/report/95315667 > > The first such fail report in the 5.27 cycle: > http://www.cpantesters.org/cpan/report/88862316
Manually bisected to a commit in Perl 5 core distribution: https://rt.perl.org/Ticket/Display.html?id=133938#txn-1619305
On Sun Sep 16 04:09:36 2018, ANDK wrote: Show quoted text
> As per subject. Sample fail report: > http://www.cpantesters.org/cpan/report/95315667 > > The first such fail report in the 5.27 cycle: > http://www.cpantesters.org/cpan/report/88862316
The Copy() call causing the assertion is being passed a NULL pointer, which produces undefined behavior in memcpy() even when the number of bytes copied is 0. I could have made Copy() (and the other macros) conditional on length, but that would have left XS modules broken against older perls. Tony
I've created and attached a patch that fixes the passing of NULL to Copy(). This makes it pass all tests and not trigger any assertions for -DDEBUGGING.
Subject: 0001-Add-NULL-check-to-fix-things-with-threaded-perls.patch
From 147d4b079a1aa0e364223171aff9a1ebd151866f Mon Sep 17 00:00:00 2001 From: Ryan Voots <simcop2387@simcop2387.info> Date: Sun, 26 May 2019 21:31:58 -0400 Subject: [PATCH] Add NULL check to fix things with threaded perls --- indirect.xs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indirect.xs b/indirect.xs index ee702c6..79045a5 100644 --- a/indirect.xs +++ b/indirect.xs @@ -261,7 +261,9 @@ static void indirect_map_store(pTHX_ const OP *o, STRLEN pos, SV *sv, line_t lin XSH_LOCAL_REALLOC(oi->buf, oi->size, len, char); oi->size = len; } - Copy(s, oi->buf, len, char); + + if (oi->buf != NULL) + Copy(s, oi->buf, len, char); oi->len = len; oi->pos = pos; -- 2.20.1
Fixed in indirect 0.39 released eons ago, thanks.