Compile it with reduced optimization under clang and see if that makes the problem go away? At least that's a starting point to track down the real problem.
Can you come up with a simple perl program that shows the issue?
EDIT: Maybe this is more a thing for bugs.perl.org than perlmonks? It's certainly an interpreter and/or compiler bug.
| [reply] |
> Compile it with reduced optimization under clang and see if that makes the problem go away? At least that's a starting point to track down the real problem.
ok thank you. i'll try.
> Can you come up with a simple perl program that shows the issue?
> EDIT: Maybe this is more a thing for bugs.perl.org than perlmonks? It's certainly an interpreter and/or compiler bug.
I don't have proof of concept code. I don't have proof, except this thread where me
and another user reproduced segfaults in two different scripts.
I tried, but cannot reduce to proof-of-concept. Things that if code looks like:
part1;
part2;
part3;
part4;
(partN - is a chunk of code or chunk of 'use' modules etc).
problem goes aways if if remove part1 OR part2 OR part3.
So I cannot reduce code.
More important. Here is the script which reproduce problem for me
(don't try to run it or understand how it works - it's undocummented internal script).
problem is that _it_ does almost _nothing_.
it:
1. reads a line from stdin
2. fork()
3. wait()
4. that's it
10 lines of code, maybe.
But all heavy processing happening in child process. Child process cannot modify state of parent. But if I remove processings in child (or reduce data size), issue gone. It just does not
make sense.
Maybe overall heavy load of system (swapping, etc) or big delay between fork and wait causes the issue... But I was unable to reproduce it with script which simulates similar conditions, yet
| [reply] [d/l] [select] |
I think I reproduced it. It's as simple as:
$ perl 4.pl
Segmentation fault (core dumped)
$ cat 4.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
unless (fork()) {
my $sz = 2048*1024*1024;
my $sc = "x" x $sz;
exit(0);
}
wait();
print Dumper { a => 42};
exit();
(note that $sz should be adjusted to take almost all free memory)
Now I need verify again which versions are affected and report to either FreeBSD team or Perl Porters. I'll update my post.
| [reply] [d/l] |