Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.95k stars 554 forks source link

Possible problem with optimization of return at end of sub? #14911

Open p5pRT opened 9 years ago

p5pRT commented 9 years ago

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

Searchable as RT126070$

p5pRT commented 9 years ago

From @steve-m-hay

A problem has come to light in mod_perl relating to the following commit​:

http​://perl5.git.perl.org/perl.git/commit/437e3a7dac994ebace1195549170c8

It may be a mod_perl problem (or possibly TryCatch / Devel​::Declare related?) rather than a core perl problem\, but since the exact cause isn't yet known it's hard to guess whether some CPAN XS code has previously been getting away with something naughty or whether there is some fault lurking in this core perl optimization.

There are a couple of threads on the mod_perl users mailing list\, the second of which details how to reproduce the problem (with mod_perl\, of course)​:

http​://marc.info/?t=144131529800006&r=1&w=2

http​://marc.info/?t=144235552600001&r=1&w=2

More eyes on the problem may help to shed some light. Any clues where to look would be greatly appreciated.

p5pRT commented 9 years ago

From @iabyn

On Wed\, Sep 16\, 2015 at 10​:06​:13AM -0700\, Steve Hay wrote​:

# New Ticket Created by Steve Hay # Please include the string​: [perl #126070] # in the subject line of all future correspondence about this issue. # \<URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=126070 >

A problem has come to light in mod_perl relating to the following commit​:

http​://perl5.git.perl.org/perl.git/commit/437e3a7dac994ebace1195549170c8

It may be a mod_perl problem (or possibly TryCatch / Devel​::Declare related?) rather than a core perl problem\, but since the exact cause isn't yet known it's hard to guess whether some CPAN XS code has previously been getting away with something naughty or whether there is some fault lurking in this core perl optimization.

There are a couple of threads on the mod_perl users mailing list\, the second of which details how to reproduce the problem (with mod_perl\, of course)​:

http​://marc.info/?t=144131529800006&r=1&w=2

http​://marc.info/?t=144235552600001&r=1&w=2

More eyes on the problem may help to shed some light. Any clues where to look would be greatly appreciated.

Given that the bisected perl commit is about replacing a trailing pp_return with a pp_leavesub\, and given that (after a quick rummage through the source)\, TryCatch installs some sort of hook to "replace return with an unwird"\, I would strongly suspect some sort of interaction between the two. I haven't looked any closer.

-- Music lesson​: a symbiotic relationship whereby a pupil's embellishments concerning the amount of practice performed since the last lesson are rewarded with embellishments from the teacher concerning the pupil's progress over the corresponding period.

p5pRT commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 8 years ago

From @wolfsage

On Sat\, Sep 19\, 2015 at 6​:36 AM\, Dave Mitchell \davem@&#8203;iabyn\.com wrote​:

On Wed\, Sep 16\, 2015 at 10​:06​:13AM -0700\, Steve Hay wrote​:

# New Ticket Created by Steve Hay # Please include the string​: [perl #126070] # in the subject line of all future correspondence about this issue. # \<URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=126070 >

A problem has come to light in mod_perl relating to the following commit​:

http​://perl5.git.perl.org/perl.git/commit/437e3a7dac994ebace1195549170c8

It may be a mod_perl problem (or possibly TryCatch / Devel​::Declare related?) rather than a core perl problem\, but since the exact cause isn't yet known it's hard to guess whether some CPAN XS code has previously been getting away with something naughty or whether there is some fault lurking in this core perl optimization.

There are a couple of threads on the mod_perl users mailing list\, the second of which details how to reproduce the problem (with mod_perl\, of course)​:

Interestingly\, the example here​: https://github.com/mschout/modperl-trycatch-bug

Fails for me with 5.18.2 threaded when trying to start apache2 with​:

  [Sun Nov 01 11​:14​:32.056712 2015] [core​:notice] [pid 24140] AH00060​: seg fault or similar nasty error detected in the parent process

And​:

  mhorsfall@​tworivers​:\~$ sudo apache2ctl restart   AH00558​: apache2​: Could not reliably determine the server's fully qualified domain name\, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message   httpd not running\, trying to start   Bus error (core dumped)

Using​: [Sun Nov 01 11​:15​:06.290171 2015] [mpm_event​:notice] [pid 24360​:tid 139952190658432] AH00489​: Apache/2.4.7 (Ubuntu) mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations

If I comment out the try {} and 'use TryCatch' it never fails for me.

Also if I replace TryCatch with Try​::Tiny\, it never fails for me.

I think TryCatch might be doing something really heinous or interacting poorly with another module anyway...?

Or perhaps this is just a problem with threaded perl and TryCatch/Apache...?

-- Matthew Horsfall (alh)