Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Devel-PPPort CPAN distribution.

Report information
The Basics
Id: 29302
Status: resolved
Priority: 0/
Queue: Devel-PPPort

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

Bug Information
Severity: Normal
Broken in: 3.11_05
Fixed in: 3.11_06



Subject: Perl_croak_nocontext doesn't need aTHX_
'perl ppport.h' erroneously reports that Perl_croak_nocontext needs aTHX_: === Analyzing ./shared.xs === *** Doesn't pass interpreter argument aTHX to Perl_croak_nocontext When I modify ppport.h to remove the 'v' for croak_nocontext, I get: === Analyzing ./shared.xs === *** Uses Perl_croak_nocontext instead of croak_nocontext If I then make this change, it won't compile: shared.o:shared.c:(.text+0xc39): undefined reference to `_croak_nocontext' shared.o:shared.c:(.text+0x4c9d): undefined reference to `_croak_nocontext' collect2: ld returned 1 exit status The following change to ppport.h seems to fix all this: --- ppport.h +++ ppport.h @@ -703,6 +703,7 @@ PerlIO_tell||5.007003| PerlIO_unread||5.007003| PerlIO_write||5.007003| +Perl_croak_nocontext|||n Perl_signbit||5.009005|n Perl_warner_nocontext|5.006000||p Perl_warner|5.006000||p @@ -1096,7 +1097,6 @@ cop_free||| cr_textfilter||| create_eval_scope||| -croak_nocontext|||vn croak|||v csighandler||5.009003|n curmad||| Sorry, but I don't now what to patch in Devel::PPPort to fix this.
Subject: Re: [rt.cpan.org #29302] Perl_croak_nocontext doesn't need aTHX_
Date: Tue, 11 Sep 2007 23:15:35 +0200
To: bug-Devel-PPPort [...] rt.cpan.org
From: Marcus Holland-Moritz <mhx-perl [...] gmx.net>
Hi Jerry, On 2007-09-11, at 14:34:30 -0400, Jerry D. Hedden via RT wrote: Show quoted text
> 'perl ppport.h' erroneously reports that Perl_croak_nocontext needs aTHX_: > > === Analyzing ./shared.xs === > *** Doesn't pass interpreter argument aTHX to Perl_croak_nocontext > > When I modify ppport.h to remove the 'v' for croak_nocontext, I get: > > === Analyzing ./shared.xs === > *** Uses Perl_croak_nocontext instead of croak_nocontext > > If I then make this change, it won't compile: > > shared.o:shared.c:(.text+0xc39): undefined reference to `_croak_nocontext' > shared.o:shared.c:(.text+0x4c9d): undefined reference to `_croak_nocontext' > collect2: ld returned 1 exit status > > The following change to ppport.h seems to fix all this: > > --- ppport.h > +++ ppport.h > @@ -703,6 +703,7 @@ > PerlIO_tell||5.007003| > PerlIO_unread||5.007003| > PerlIO_write||5.007003| > +Perl_croak_nocontext|||n > Perl_signbit||5.009005|n > Perl_warner_nocontext|5.006000||p > Perl_warner|5.006000||p > @@ -1096,7 +1097,6 @@ > cop_free||| > cr_textfilter||| > create_eval_scope||| > -croak_nocontext|||vn > croak|||v > csighandler||5.009003|n > curmad||| > > Sorry, but I don't now what to patch in Devel::PPPort to fix this.
Thanks for your report! Indeed, this is clearly a bug in Devel::PPPort. However, it's not in the API specification. The problem is that while the "n" flag (meaning: this function doesn't take an aTHX) is obviously present for croak_nocontext() and all other _nocontext() functions, that information is never used within ppport.h. My best guess is that I wanted to implement it (hence the presence of the "n" flag), but just didn't do it. The fix is actually pretty trivial: mhx@r2d2 ~/src/perl/Devel-PPPort/Current $ wdiff -bu parts/inc/ppphbin ========================================================================== /parts/inc/ppphbin[/Devel-PPPort/Current(44)] < > parts/inc/ppphbin --- ppphbin[/Devel-PPPort/Current(44)] +++ ppphbin (local file) @@ -387,4 +387,5 @@ for $func (sort keys %{$file{uses_Perl}}) { if ($API{$func}{varargs}) { + unless ($API{$func}{nothxarg}) { my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); @@ -392,4 +393,5 @@ warning("Doesn't pass interpreter argument aTHX to Perl_$func"); $file{changes} += $changes; + } } } I've also added a test case. Besides, this uncovered another buglet: There were redundant specs for Perl_warner() and Perl_warner_nocontext() in ppport.h. This will also be fixed in the next release. Thanks, Marcus
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #29302] Perl_croak_nocontext doesn't need aTHX_
Date: Tue, 11 Sep 2007 23:46:09 +0200
To: bug-Devel-PPPort [...] rt.cpan.org
From: Marcus Holland-Moritz <mhx-perl [...] gmx.net>
On 2007-09-11, at 17:16:09 -0400, mhx-perl@gmx.net via RT wrote: Show quoted text
> The fix is actually pretty trivial:
Fixed in Devel::PPPort 3.11_06, which I just uploaded. Also added to bleadperl with change #31848. Marcus
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.