Closed p5pRT closed 20 years ago
This is a bug report for perl from efifer@sanwaint.com\, generated with the help of perlbug 1.27 running under perl v5.5.650.
This is a simple example of an embedded perl interpreter:
#include \<EXTERN.h> #include \<perl.h> #include "XSUB.h"
static PerlInterpreter *my_perl;
int main(int argc\, char **argv\, char **env) { SV *sv;
my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl\, NULL\, argc\, argv\, (char **)NULL); perl_run(my_perl);
perl_call_pv("xxx"\, G_DISCARD);
perl_destruct(my_perl); perl_free(my_perl); }
Sometime since perl5.005_03 "inhibit_exit" in the debugger stopped working. With perl5.005_03 using this xxx.pl script\,
print "hello\n";
sub xxx { print "xxx\n"; }
I have a debugging session like:
% ./interp -I../perl5.005_03/lib -d xxx.pl
Loading DB routines from perl5db.pl version 1.0402 Emacs support available.
Enter h or `h h' for help.
main::(xxx.pl:1): print "hello\n";
DB\<1> b xxx
DB\<2> c
hello
Debugged program terminated. Use q to quit or R to restart\,
use O inhibit_exit to avoid stopping after program termination\,
h q\, h R or h O to get additional info.
DB\<2> O inhibit_exit
inhibit_exit = '1'
DB\<3> q
main::xxx(xxx.pl:4): print "xxx\n";
DB\<3> $DB::finished = 0
DB\<4> c xxx
However\, with perl5.5.650 the call to perl_run exits without ever returning (so perl_call_pv never occurs):
% ./interp -I../perl5.5.650/lib -d xxx.pl
Loading DB routines from perl5db.pl version 1.05 Emacs support available.
Enter h or `h h' for help\, run `perldoc perldebug' for more help.
main::(xxx.pl:1): print "hello\n";
DB\<1> b xxx
DB\<2> c
hello
Debugged program terminated. Use q to quit or R to restart\,
use O inhibit_exit to avoid stopping after program termination\,
h q\, h R or h O to get additional info.
DB\<2> O inhibit_exit
inhibit_exit = '1'
DB\<3> q
Am I doing something wrong or is something broken?
Thanks.
Eric Fifer
Site configuration information for perl v5.5.650:
Configured by fifere at Tue Feb 15 08:57:11 GMT 2000.
Summary of my perl5 (revision 5.0 version 5 subversion 650) configuration: Platform: osname=solaris\, osvers=2.6\, archname=sun4-solaris uname='sunos ecd1 5.6 generic_105181-14 sun4u sparc sunw\,ultra-4 ' config_args='' hint=recommended\, useposix=true\, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usesocks=undef useperlio=undef d_sfio=undef use64bits=undef uselargefiles=define usemultiplicity=undef Compiler: cc='gcc'\, optimize='-g'\, gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release) cppflags='-DDEBUGGING -fno-strict-aliasing' ccflags ='-DDEBUGGING -fno-strict-aliasing -DUSE_LONG_LONG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='unsigned char'\, d_stdstdio=define\, usevfork=false intsize=4\, longsize=4\, ptrsize=4\, doublesize=8 d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16 alignbytes=8\, usemymalloc=y\, prototype=define Linker and Libraries: ld='gcc'\, ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec libc=/lib/libc.so\, so=so\, useshrplib=false\, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' ' cccdlflags='-fPIC'\, lddlflags='-G -L/usr/local/lib'
Locally applied patches:
@INC for perl v5.5.650: ./lib /usr/local/lib/perl5/5.5.650/sun4-solaris /usr/local/lib/perl5/5.5.650 /usr/local/lib/perl5/site_perl .
Environment for perl v5.5.650: HOME=/home/localhost/users/fifere LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/opt/convertibles/lib LOGDIR (unset)
PATH=/usr/share/local/bin:/usr/local/bin:/opt/sybase/bin:/opt/perl/share/bin :/opt/perl/sparc-SunOS-5/bin:/opt/enscript/sparc-SunOS-5/bin:/opt/convertibl es:/opt/top/sparc-SunOS-5/bin:/opt/screen/sparc-SunOS-5/bin:/opt/egcs/sparc- SunOS-5/bin:/opt/make/sparc-SunOS-5/bin:/opt/FSFgzip/bin:/usr/ccs/bin:/usr/o pt/SUNWmd/sbin:/usr/openwin/bin:/usr/sbin:/usr/bin PERL_BADLANG (unset) SHELL=/bin/csh
On Tue\, 15 Feb 2000 11:30:14 GMT\, "Fifer\, Eric" wrote:
This is a bug report for perl from efifer@sanwaint.com\, generated with the help of perlbug 1.27 running under perl v5.5.650. [...] However\, with perl5.5.650 the call to perl_run exits without ever returning (so perl_call_pv never occurs):
This is a known bug\, that I mentioned in the 640 announcement. It was introduce by change#3386:
[ 3386] By: gsar on 1999/05/11 02:49:07 Log: gutsupport for C++ exceptions From: Chip Salzenberg \chip@​perlsupport\.com Date: Tue\, 9 Mar 1999 11:51:57 -0500 Message-ID: \19990309115157\.E7911@​perlsupport\.com Subject: [PATCH 5.005] Flexible Exceptions Branch: perl ! embed.h global.sym objXSUB.h perl.c perl.h pp_ctl.c proto.h ! scope.c scope.h thrdvar.h util.c
The problem is that some of the code in perl_run() can now execute outside the setjmp() block (such as END{} blocks) and any exceptions that happen there will basically longjmp() out of perl_run() rather than making it return as it used to.
We basically need to make the C++ exception support a build-time option and go back to setting up the setjmp() at the perl_run() level. Patches welcome.
Sarathy gsar@ActiveState.com
On Tue\, 15 Feb 2000 07:05:43 PST\, I wrote:
We basically need to make the C++ exception support a build-time option and go back to setting up the setjmp() at the perl_run() level. Patches welcome.
You may want to try this fix.
Sarathy gsar@ActiveState.com
Migrated from rt.perl.org#2149 (status was 'resolved')
Searchable as RT2149$