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

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

Open
p5pRT opened this issue Sep 16, 2015 · 4 comments
Open

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

p5pRT opened this issue Sep 16, 2015 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 16, 2015

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

Searchable as RT126070$

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2015

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
Copy link
Author

p5pRT commented Sep 19, 2015

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
Copy link
Author

p5pRT commented Sep 19, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2015

From @wolfsage

On Sat, Sep 19, 2015 at 6​:36 AM, Dave Mitchell <davem@​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)

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

No branches or pull requests

2 participants