Skip Menu |
Report information
Id: 124080
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors:
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: HasPatch
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



To: perlbug [...] perl.org
Subject: [PATCH] MARK -Ds debugging
From: rurban [...] cpanel.net
Date: Mon, 16 Mar 2015 11:39:13 +0100
Download (untitled) / with headers
text/plain 6.1k
This is a bug report for perl from rurban@cpanel.net, generated with the help of perlbug 1.40 running under perl 5.21.9. ----------------------------------------------------------------- Add DEBUGGING versions of the MARK macros to display the arity of op and functions calls. Also assert on markstack underflow. This might also be helpful on davem's signature op work, e.g. by using the stack directly and not copying @_. ----------------------------------------------------------------- --- Flags: category=core severity=medium Type=Patch PatchStatus=HasPatch --- Site configuration information for perl 5.21.9: Configured by rurban at Sun Feb 22 17:14:55 CET 2015. Summary of my perl5 (revision 5 version 21 subversion 9) configuration: Platform: osname=linux, osvers=3.16.0-4-amd64, archname=x86_64-linux-debug uname='linux reini 3.16.0-4-amd64 #1 smp debian 3.16.7-ckt2-1 (2014-12-08) x86_64 gnulinux ' config_args='-de -Dusedevel -Uversiononly -Dinstallman1dir=none -Dinstallman3dir=none -Dinstallsiteman1dir=none -Dinstallsiteman3dir=none -DEBUGGING -Doptimize='-g3' -Uuseithreads -D'cc=gcc-5.0' -Accflags=''-msse4.2'' -Accflags=''-march=corei7'' -Dcf_email=''rurban@cpanel.net'' -Dperladmin=''rurban@cpanel.net''' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc-5.0', ccflags ='-msse4.2 -march=corei7 -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g3', cppflags='-msse4.2 -march=corei7 -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='', gccversion='5.0.0 20150103 (experimental)', 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='gcc-5.0', ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/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 /lib64 /usr/lib64 /usr/local/lib64 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 -g3 -L/usr/local/lib -fstack-protector-strong' Locally applied patches: Devel::PatchPerl 1.30 --- @INC for perl 5.21.9: /usr/local/lib/perl5/site_perl/5.21.9/x86_64-linux-debug /usr/local/lib/perl5/site_perl/5.21.9 /usr/local/lib/perl5/5.21.9/x86_64-linux-debug /usr/local/lib/perl5/5.21.9 /usr/local/lib/perl5/site_perl/5.21.8 /usr/local/lib/perl5/site_perl/5.21.7 /usr/local/lib/perl5/site_perl/5.21.4 /usr/local/lib/perl5/site_perl/5.21.3 /usr/local/lib/perl5/site_perl/5.21.2 /usr/local/lib/perl5/site_perl/5.21.1 /usr/local/lib/perl5/site_perl/5.21.0 /usr/local/lib/perl5/site_perl/5.20.1 /usr/local/lib/perl5/site_perl/5.20.0 /usr/local/lib/perl5/site_perl/5.19.11 /usr/local/lib/perl5/site_perl/5.19.10 /usr/local/lib/perl5/site_perl/5.19.9 /usr/local/lib/perl5/site_perl/5.19.8 /usr/local/lib/perl5/site_perl/5.19.7 /usr/local/lib/perl5/site_perl/5.19.6 /usr/local/lib/perl5/site_perl/5.19.5 /usr/local/lib/perl5/site_perl/5.19.4 /usr/local/lib/perl5/site_perl/5.19.3 /usr/local/lib/perl5/site_perl/5.19.2 /usr/local/lib/perl5/site_perl/5.19.1 /usr/local/lib/perl5/site_perl/5.19.0 /usr/local/lib/perl5/site_perl/5.18.4 /usr/local/lib/perl5/site_perl/5.18.2 /usr/local/lib/perl5/site_perl/5.18.1 /usr/local/lib/perl5/site_perl/5.18.0 /usr/local/lib/perl5/site_perl/5.17.11 /usr/local/lib/perl5/site_perl/5.17.10 /usr/local/lib/perl5/site_perl/5.17.8 /usr/local/lib/perl5/site_perl/5.17.7 /usr/local/lib/perl5/site_perl/5.17.6 /usr/local/lib/perl5/site_perl/5.17.5 /usr/local/lib/perl5/site_perl/5.17.4 /usr/local/lib/perl5/site_perl/5.17.3 /usr/local/lib/perl5/site_perl/5.17.2 /usr/local/lib/perl5/site_perl/5.17.1 /usr/local/lib/perl5/site_perl/5.17.0 /usr/local/lib/perl5/site_perl/5.17 /usr/local/lib/perl5/site_perl/5.16.3 /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/site_perl/5.16.1 /usr/local/lib/perl5/site_perl/5.16.0 /usr/local/lib/perl5/site_perl/5.15.9 /usr/local/lib/perl5/site_perl/5.15.8 /usr/local/lib/perl5/site_perl/5.15.7 /usr/local/lib/perl5/site_perl/5.15.6 /usr/local/lib/perl5/site_perl/5.15.5 /usr/local/lib/perl5/site_perl/5.15.4 /usr/local/lib/perl5/site_perl/5.15.3 /usr/local/lib/perl5/site_perl/5.15.2 /usr/local/lib/perl5/site_perl/5.14.4 /usr/local/lib/perl5/site_perl/5.14.3 /usr/local/lib/perl5/site_perl/5.14.2 /usr/local/lib/perl5/site_perl/5.14.1 /usr/local/lib/perl5/site_perl/5.12.5 /usr/local/lib/perl5/site_perl/5.12.4 /usr/local/lib/perl5/site_perl/5.10.1 /usr/local/lib/perl5/site_perl/5.8.9 /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl/5.8.5 /usr/local/lib/perl5/site_perl/5.8.4 /usr/local/lib/perl5/site_perl/5.8.3 /usr/local/lib/perl5/site_perl/5.8.2 /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl/5.6.2 /usr/local/lib/perl5/site_perl . --- Environment for perl 5.21.9: HOME=/home/rurban LANG=en_US.utf8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/rurban/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games PERL_BADLANG (unset) PERL_DL_DEBUG= 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 994b
On Mon Mar 16 03:39:29 2015, rurban@cpanel.net wrote: Show quoted text
> This is a bug report for perl from rurban@cpanel.net, > generated with the help of perlbug 1.40 running under perl 5.21.9. > > > ----------------------------------------------------------------- > Add DEBUGGING versions of the MARK macros > to display the arity of op and functions calls. > Also assert on markstack underflow. > > This might also be helpful on davem's signature op work, e.g. > by using the stack directly and not copying @_.
This: +#define TOPMARK \ + ({ \ + DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK top %p %d\n", \ + PL_markstack_ptr, *PL_markstack_ptr)); \ + *PL_markstack_ptr; \ + }) is a gcc-ism and won't work on other compilers (except maybe clang.) Similarly for POPMARK and INCMARK. Tony
Subject: Re: [perl #124080] [PATCH] MARK -Ds debugging
To: perlbug-followup [...] perl.org
Date: Mon, 13 Apr 2015 17:04:21 +0200
From: Reini Urban <rurban [...] cpanel.net>
Download (untitled) / with headers
text/plain 1.1k
On 04/13/2015 02:02 AM, Tony Cook via RT wrote: Show quoted text
> On Mon Mar 16 03:39:29 2015, rurban@cpanel.net wrote:
>> This is a bug report for perl from rurban@cpanel.net, >> generated with the help of perlbug 1.40 running under perl 5.21.9. >> >> >> ----------------------------------------------------------------- >> Add DEBUGGING versions of the MARK macros >> to display the arity of op and functions calls. >> Also assert on markstack underflow. >> >> This might also be helpful on davem's signature op work, e.g. >> by using the stack directly and not copying @_.
> > This: > > +#define TOPMARK \ > + ({ \ > + DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK top %p %d\n", \ > + PL_markstack_ptr, *PL_markstack_ptr)); \ > + *PL_markstack_ptr; \ > + }) > > is a gcc-ism and won't work on other compilers (except maybe clang.) > > Similarly for POPMARK and INCMARK.
Right. Forgot checking for #ifdef PERL_USE_GCC_BRACE_GROUPS Attached patch should be better.

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 641b
On Mon Apr 13 08:05:15 2015, rurban@cpanel.net wrote: Show quoted text
> > Right. Forgot checking for #ifdef PERL_USE_GCC_BRACE_GROUPS > > Attached patch should be better.
Thanks, I was just looking at it to apply it, but noticed: + assert((PL_markstack_ptr > PL_markstack) || "MARK underflow");\ which is an assertion that can't fail. Should that be: assert(("MARK underflow", PL_markstack_ptr > PL_markstack));\ since I'm assuming the string is there to make an assertion failure more understandable. It's kind of a pity the DEBUG_x macros use if(), otherwise each of the MARK macros you're updating could just be comma-expressions. Tony
Date: Thu, 15 Oct 2015 09:57:04 +0200
Subject: Re: [perl #124080] [PATCH] MARK -Ds debugging
To: perlbug-followup [...] perl.org
From: Reini Urban <reini [...] cpanel.net>
Download (untitled) / with headers
text/plain 990b
Show quoted text
> On Oct 15, 2015, at 3:13 AM, Tony Cook via RT <perlbug-followup@perl.org> wrote: > > On Mon Apr 13 08:05:15 2015, rurban@cpanel.net wrote:
>> >> Right. Forgot checking for #ifdef PERL_USE_GCC_BRACE_GROUPS >> >> Attached patch should be better.
> > Thanks, I was just looking at it to apply it, but noticed: > > + assert((PL_markstack_ptr > PL_markstack) || "MARK underflow");\ > > which is an assertion that can't fail.
Uh, yes. Excellent catch. It should of course be: assert((PL_markstack_ptr > PL_markstack) || !"MARK underflow");\ Show quoted text
> Should that be: > > assert(("MARK underflow", PL_markstack_ptr > PL_markstack));\ > > since I'm assuming the string is there to make an assertion failure more understandable. > > It's kind of a pity the DEBUG_x macros use if(), otherwise each of the MARK macros you're updating could just be comma-expressions.
I’m not a friend of comma expressions if pure conditionals can do the same. Reini Urban rurban@cpanel.net
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 513b
On Thu Oct 15 00:57:36 2015, reini@cpanel.net wrote: Show quoted text
>
> > On Oct 15, 2015, at 3:13 AM, Tony Cook via RT <perlbug- > > Thanks, I was just looking at it to apply it, but noticed: > > > > + assert((PL_markstack_ptr > PL_markstack) || "MARK > > underflow");\ > > > > which is an assertion that can't fail.
> > Uh, yes. Excellent catch. It should of course be: > > assert((PL_markstack_ptr > PL_markstack) || !"MARK underflow");\
Applied with that changed as 6cae08a8be145bcb838b49a6de6051e08d4e25a5. Tony


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