develooper Front page | perl.perl5.porters | Postings from December 2018

Re: 5.28.1 with -Duseshrplib issues

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
December 9, 2018 15:21
Subject:
Re: 5.28.1 with -Duseshrplib issues
Message ID:
20181209162123.1ea741b6@pc09.procura.nl
On Wed, 5 Dec 2018 10:02:07 +0100, "H.Merijn Brand"
<h.m.brand@xs4all.nl> wrote:

> indirect-0.38-0 ===========================================================
> 
> t/40-threads.t ............. # Using threads 2.22
> # Using threads::shared 1.58
> perl5.28.1: indirect.xs:264: indirect_map_store: Assertion `((void*)(oi->buf)) != 0' failed.
> t/40-threads.t ............. No subtests run
> 
> t/42-threads-global.t ...... # Using threads 2.22
> # Using threads::shared 1.58
> perl5.28.1: indirect.xs:264: indirect_map_store: Assertion `((void*)(oi->buf)) != 0' failed.
> t/42-threads-global.t ...... No subtests run

If I do not install any module (start from a plain 5.28.1),
test and installation for indirect passes

When I try to install indirect after a whole truckload of other
modules, these tests fail

indirect-0.38-0 542 > perl -Mblib -d:TraceLoad t/40-threads.t
[  0.0000] blib
[  0.0002] Cwd
[  0.0039] File::Spec
[  0.0041] File::Spec::Unix
[  0.0047] constant
[  0.0049] warnings::register
[  0.0084] lib
[  0.0086] Config
[  0.0361] POSIX
[  0.0365] Fcntl
[  0.0414] Tie::Hash
[  0.0416] Carp
[  0.0430] overloading
[  0.0482] threads
[  0.0491] overload
[  0.0508] Test::More
[  0.0510] Test::Builder::Module
[  0.0511] Test::Builder
[  0.0514] Scalar::Util
[  0.0518] List::Util
[  0.0527] Test2::Util
[  0.0530] PerlIO
[  0.0545] Config_heavy.pl
[  0.0564] Config_git.pl
[  0.0572] Test2::API
[  0.0575] Test2::API::Instance
[  0.0578] Test2::EventFacet::Trace
[  0.0580] Test2::EventFacet
[  0.0581] Test2::Util::HashBase
[  0.0585] mro
[  0.0608] Test2::API::Stack
[  0.0610] Test2::Hub
[  0.0614] Test2::Util::ExternalMeta
[  0.0701] Test2::Util::Trace
[  0.0703] Test2::Hub::Subtest
[  0.0711] Test2::Hub::Interceptor
[  0.0713] Test2::Hub::Interceptor::Terminator
[  0.0718] Test2::Event::Ok
[  0.0721] Test2::Event
[  0.0726] Test2::EventFacet::About
[  0.0730] Test2::EventFacet::Amnesty
[  0.0734] Test2::EventFacet::Assert
[  0.0737] Test2::EventFacet::Control
[  0.0741] Test2::EventFacet::Error
[  0.0744] Test2::EventFacet::Info
[  0.0747] Test2::EventFacet::Meta
[  0.0750] vars
[  0.0758] Test2::EventFacet::Parent
[  0.0762] Test2::EventFacet::Plan
[  0.0766] Test2::EventFacet::Hub
[  0.0790] Test2::Event::Diag
[  0.0794] Test2::Event::Note
[  0.0799] Test2::Event::Plan
[  0.0808] Test2::Event::Bail
[  0.0812] Test2::Event::Exception
[  0.0817] Test2::Event::Waiting
[  0.0821] Test2::Event::Skip
[  0.0826] Test2::Event::Subtest
[  0.0870] Test2::API::Context
[  0.0900] Test2::Event::Pass
[  0.0907] Test2::Event::Fail
[  0.0913] Test2::Event::V2
[  0.0917] Test2::Util::Facets2Legacy
[  0.0919] base
[  0.0949] Test2::IPC
[  0.0958] Test2::IPC::Driver::Files
[  0.0960] Test2::IPC::Driver
[  0.0969] File::Temp
[  0.0972] File::Path
[  0.0975] File::Basename
[  0.1026] IO::Seekable
[  0.1029] IO::Handle
[  0.1032] Symbol
[  0.1041] SelectSaver
[  0.1044] IO
[  0.1074] Errno
[  0.1087] parent
[  0.1148] Carp::Heavy
[  0.1153] Storable
[  0.1157] Log::Agent
[  0.1181] Storable::Limit
[  0.1211] IPC::SysV
[  0.1217] DynaLoader
[  0.1238] Test::Builder::Formatter
[  0.1240] Test2::Formatter::TAP
[  0.1243] Test2::Formatter
[  0.1275] Test::Builder::TodoDiag
# Using threads 2.22
[  0.1426] threads::shared
# Using threads::shared 1.58
[  0.1443] Test::Leaner
[  0.1489] indirect
perl: indirect.xs:264: indirect_map_store: Assertion `((void*)(oi->buf)) != 0' failed.
Abort (core dumped)

The fix is this:

--- indirect.xs.org     2018-12-09 16:18:19.342479799 +0100
+++ indirect.xs 2018-12-09 16:18:21.362533538 +0100
@@ -261,7 +261,7 @@ static void indirect_map_store(pTHX_ con
   XSH_LOCAL_REALLOC(oi->buf, oi->size, len, char);
   oi->size = len;
  }
- Copy(s, oi->buf, len, char);
+ if (oi->buf) Copy(s, oi->buf, len, char);

  oi->len  = len;
  oi->pos  = pos;

And all tests pass

This is *way* beyond my competence area, so please speak up if you
understand


FWIW I used this to check:
---8<--- Devel/TraceLoad.pm
package Devel::TraceLoad;

use 5.14.1;
use warnings;

use Time::HiRes qw( gettimeofday tv_interval );

# Based on http://www.perladvent.org/2018/2018-12-06.html

# BEGIN blocks and @INC dealing honestly stolen from Devel::TraceUse
# created and maintained by BooK
# Devel::TraceUse prints at the end, which won't happen on a core dump

# detect being loaded via -d:TraceLoad and disable the debugger features we
# don't need. better names for evals (0x100) and anon subs (0x200).
BEGIN {
    !defined &DB::DB && $^P & 0x02 and $^P = 0x100 | 0x200;
    unshift @INC, \&trace_load unless grep { "$_" eq \&trace_use."" } @INC;
    };

my $time = [ gettimeofday ];
my %seen;

sub trace_load {
    my ($code, $filename) = @_;

    # ensure our hook remains first in @INC
    $INC[0] eq $code or @INC = ($code, grep { $_ ne $code } @INC);

    my $module = $filename =~ s{/}{::}gr =~ s{\.pm$}{}r;
    $seen{$module}++ and return;

    printf STDERR "[%8.4f] %s\n", tv_interval ($time), $module;
    return;
    } # trace_load

1;
-->8---

/me now continues to find the other fails

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.29   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About