Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core dump in Perl_regexec_flags #4997

Closed
p5pRT opened this issue Feb 9, 2002 · 5 comments
Closed

core dump in Perl_regexec_flags #4997

p5pRT opened this issue Feb 9, 2002 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 9, 2002

Migrated from rt.perl.org#8476 (status was 'open')

Searchable as RT8476$

@p5pRT
Copy link
Author

p5pRT commented Feb 9, 2002

From @eserte

This is a bug report for perl from eserte@​vran.herceg.de,
generated with the help of perlbug 1.33 running under perl v5.7.2.


I'm not sure whether this is a Perl/Tk or perl problem​:

In Perl/Tk there is a call to pregexec with a NULL as 6th argument​:

return pregexec(re,string,string+strlen(string),start,0,NULL,1);

(this is in file tkGlue.c).

In perl's Perl_regexec_flags function, a core will be dumped at line
1427​:

  bool do_utf8 = DO_UTF8(sv);

The problem is fixed if I change the line to​:

  bool do_utf8 = sv && DO_UTF8(sv);

Regards,
  Slaven



Flags​:
  category=core
  severity=medium


Site configuration information for perl v5.7.2​:

Configured by eserte at Sat Feb 9 22​:33​:02 CET 2002.

Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 14574) configuration​:
  Platform​:
  osname=freebsd, osvers=4.3-stable, archname=i386-freebsd-64int
  uname='freebsd vran.herceg.de 4.3-stable freebsd 4.3-stable #6​: mon jul 9 11​:49​:47 cest 2001 root@​vran.herceg.de​:vranhomesrcfreebsd-4srcsyscompilevran i386 '
  config_args='-Doptimize=-g -DPERL_DEBUGGING_MSTATS -Dusemymalloc=y -Dprefix=/usr/perl5.7.2d -D usedevel=define -de -D hintfile=myfreebsd'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=define use64bitall=undef uselongdouble=undef
  usemymalloc=y, bincompat5005=define
  Compiler​:
  cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -I/usr/local/include',
  optimize='-g -DPERL_DEBUGGING_MSTATS',
  cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
  ccversion='', gccversion='2.95.3 [FreeBSD] 20010315 (release)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=4, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags ='-Wl,-E -L/usr/local/lib'
  libpth=/usr/lib /usr/local/lib
  libs=-lbind -lgdbm -ldb -lm -lc -lcrypt -lutil
  perllibs=-lbind -lm -lc -lcrypt -lutil
  libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-DPIC -fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches​:
  DEVEL14574


@​INC for perl v5.7.2​:
  lib
  /usr/perl5.7.2d/lib/5.7.2/i386-freebsd-64int
  /usr/perl5.7.2d/lib/5.7.2
  /usr/perl5.7.2d/lib/site_perl/5.7.2/i386-freebsd-64int
  /usr/perl5.7.2d/lib/site_perl/5.7.2
  /usr/perl5.7.2d/lib/site_perl
  .


Environment for perl v5.7.2​:
  HOME=/home/e/eserte
  LANG (unset)
  LANGUAGE (unset)
  LC_ALL=de_DE.ISO_8859-1
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/X11R6/bin​:/usr/X11/bin​:/usr/local/bin​:/usr/bin​:/bin​:/usr/gnu/bin​:/usr/TeX/bin​:/usr/local/sbin​:/usr/sbin​:/sbin​:/usr/local/pilot/bin​:/home/e/eserte/bin/FreeBSD​:/home/e/eserte/bin/sh​:/home/e/eserte/bin​:/usr/X386/bin​:/usr/games​:/home/e/eserte/devel
  PERL_BADLANG (unset)
  SHELL=/usr/local/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Feb 10, 2002

From @vanstyn

Slaven Rezic <eserte@​vran.herceg.de> wrote​:
:I'm not sure whether this is a Perl/Tk or perl problem​:
[...]
:
:In perl's Perl_regexec_flags function, a core will be dumped at line
:1427​:
: bool do_utf8 = DO_UTF8(sv);

That's a problem with the regexp engine.

:The problem is fixed if I change the line to​:
:
: bool do_utf8 = sv && DO_UTF8(sv);

That's fine as a starting point, but I suspect we need the ability to
match on an SV-less UTF8 string as well. Perhaps we should add a flag
for the purpose? Then the above could be​:
  bool do_utf8 = sv ? DO_UTF8(sv) : flags & REXEC_UTF8;

Note also that this would require some fixup for the debugging (which
assumes an sv if utf8) and for screaminstr() calls (which assume an sv
if REXEC_SCREAM).

Hugo

@p5pRT
Copy link
Author

p5pRT commented Feb 10, 2002

From [Unknown Contact. See original ticket]

Hugo Van Der Sanden <hv@​crypt0.demon.co.uk> writes​:

Slaven Rezic <eserte@​vran.herceg.de> wrote​:
​:I'm not sure whether this is a Perl/Tk or perl problem​:
[...]
​:
​:In perl's Perl_regexec_flags function, a core will be dumped at line
​:1427​:
​: bool do_utf8 = DO_UTF8(sv);

That's a problem with the regexp engine.

And Tk ;-)

​:The problem is fixed if I change the line to​:
​:
​: bool do_utf8 = sv && DO_UTF8(sv);

That's fine as a starting point,

There are other references to sv further down - some guarded, some not
(in my quick scan).

but I suspect we need the ability to
match on an SV-less UTF8 string as well.

I have no real problem requiring an SV for this.
I just patched Tk to construct one.
What mislead me was that SV * parameter used to be called 'screamer'
and was something to do with 'study'. I never understood that and did
not known that SV * _was_ the string.

When Unicode-aware Tk gets out it will only ever use this on UTF-8 strings.

Perhaps we should add a flag
for the purpose? Then the above could be​:
bool do_utf8 = sv ? DO_UTF8(sv) : flags & REXEC_UTF8;

Note also that this would require some fixup for the debugging (which
assumes an sv if utf8) and for screaminstr() calls (which assume an sv
if REXEC_SCREAM).

Hugo
--
Nick Ing-Simmons
http​://www.ni-s.u-net.com/

@p5pRT
Copy link
Author

p5pRT commented Dec 13, 2017

From @khwilliamson

Is this still an issue?
--
Karl Williamson

@khwilliamson
Copy link
Contributor

I'm closing this. I asked two years ago if this is still an issue, without response. Further investigation reveals that this parameter may no longer be NULL, since
commit 4373e32
Author: Andy Lester andy@petdance.com
Date: Wed May 4 23:55:00 2005 +0000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants