Skip Menu |
Report information
Id: 131975
Status: pending release
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: tonyc <tony [at] develop-help.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.27.4
Fixed In: (no value)

Attachments
0001-add-a-stack-extend-check-to-pp_entersub-for-XS-subs.patch



To: perlbug [...] perl.org
Date: Mon, 28 Aug 2017 13:58:38 +1000
From: Tony Cook <tony [...] develop-help.com>
Subject: duplicate stack extend reporting for xsubs
Download (untitled) / with headers
text/plain 3.7k
This is a bug report for perl from tony@develop-help.com, generated with the help of perlbug 1.40 running under perl 5.27.4. ----------------------------------------------------------------- [Please describe your issue here] This is just an RFC for the attached patch, which I'll apply on no negative comments. Dave's patches to Perl_runops_debug() have been great for reporting XS code that doesn't properly extend the stack. Unfortunately tracking down the location of the fault in complex code can be difficult with the message reported by the run loop. The attacked patch adds a similar check to pp_entersub when calling XSUBs and reports the name of the XSUB to make it simpler to track down the fault. [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl 5.27.4: Configured by tony at Mon Aug 28 11:55:58 AEST 2017. Summary of my perl5 (revision 5 version 27 subversion 4) configuration: Derived from: 43272d222fe12f33c708d42b2a71af36cc92e4bd Platform: osname=linux osvers=3.16.0-4-amd64 archname=x86_64-linux uname='linux mars 3.16.0-4-amd64 #1 smp debian 3.16.43-2+deb8u1 (2017-06-18) x86_64 gnulinux ' config_args='-des -Dusedevel -DDEBUGGING -Doptimize=-O0 -g -Dprefix=/home/tony/perl/blead' hint=recommended useposix=true d_sigaction=define useithreads=undef usemultiplicity=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cc' ccflags ='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' optimize='-O0 -g' cppflags='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='' gccversion='4.9.2' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='cc' ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so so=so useshrplib=false libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -O0 -g -L/usr/local/lib -fstack-protector-strong' Locally applied patches: uncommitted-changes --- @INC for perl 5.27.4: /home/tony/perl/blead/lib/site_perl/5.27.4/x86_64-linux /home/tony/perl/blead/lib/site_perl/5.27.4 /home/tony/perl/blead/lib/5.27.4/x86_64-linux /home/tony/perl/blead/lib/5.27.4 --- Environment for perl 5.27.4: HOME=/home/tony LANG=en_AU.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/tony/perl5/perlbrew/bin:/home/tony/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games PERLBREW_BASHRC_VERSION=0.43 PERLBREW_HOME=/home/tony/.perlbrew PERLBREW_MANPATH= PERLBREW_PATH=/home/tony/perl5/perlbrew/bin PERLBREW_ROOT=/home/tony/perl5/perlbrew PERLBREW_VERSION=0.67 PERL_BADLANG (unset) SHELL=/bin/bash

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 399b
On Sun, 27 Aug 2017 20:58:48 -0700, tonyc wrote: Show quoted text
> The attacked patch
I think that patch needs help! Show quoted text
> adds a similar check to pp_entersub when calling > XSUBs and reports the name of the XSUB to make it simpler to track > down the fault.
Show quoted text
> +#if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
I think DEBUGGING_RE_ONLY only applies to headers. It’s redundant here. -- Father Chrysostomos
Download (untitled) / with headers
text/plain 732b
On Mon, 28 Aug 2017 13:19:26 -0700, sprout wrote: Show quoted text
> On Sun, 27 Aug 2017 20:58:48 -0700, tonyc wrote:
> > adds a similar check to pp_entersub when calling > > XSUBs and reports the name of the XSUB to make it simpler to track > > down the fault.
>
> > +#if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
> > I think DEBUGGING_RE_ONLY only applies to headers. It’s redundant here.
It's based on Dave's changes which use the same condition. Especially: #if defined DEBUGGING && !defined DEBUGGING_RE_ONLY /* high water mark: for checking if the stack was correctly extended / * tested for extension by each pp function */ SSize_t si_stack_hwm; #endif Perhaps they all should only be checking DEBUGGING. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 627b
On Sun, 27 Aug 2017 20:58:48 -0700, tonyc wrote: Show quoted text
> This is just an RFC for the attached patch, which I'll apply on no > negative comments. > > Dave's patches to Perl_runops_debug() have been great for reporting XS > code that doesn't properly extend the stack. > > Unfortunately tracking down the location of the fault in complex code > can be difficult with the message reported by the run loop. > > The attacked patch adds a similar check to pp_entersub when calling > XSUBs and reports the name of the XSUB to make it simpler to track > down the fault.
This was applied as cfbdacd3fe159abe693ef1eb6fd7460850ef9312. Tony
Subject: Re: [perl #131975] duplicate stack extend reporting for xsubs
From: Dave Mitchell <davem [...] iabyn.com>
CC: perl5-porters [...] perl.org
To: Tony Cook via RT <perlbug-followup [...] perl.org>
Date: Mon, 4 Sep 2017 09:36:24 +0100
Download (untitled) / with headers
text/plain 836b
On Sun, Sep 03, 2017 at 06:32:12PM -0700, Tony Cook via RT wrote: Show quoted text
> On Sun, 27 Aug 2017 20:58:48 -0700, tonyc wrote:
> > This is just an RFC for the attached patch, which I'll apply on no > > negative comments. > > > > Dave's patches to Perl_runops_debug() have been great for reporting XS > > code that doesn't properly extend the stack. > > > > Unfortunately tracking down the location of the fault in complex code > > can be difficult with the message reported by the run loop. > > > > The attacked patch adds a similar check to pp_entersub when calling > > XSUBs and reports the name of the XSUB to make it simpler to track > > down the fault.
> > This was applied as cfbdacd3fe159abe693ef1eb6fd7460850ef9312.
Thanks for this! -- Diplomacy is telling someone to go to hell in such a way that they'll look forward to the trip


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org