FreeBSD Bugzilla – Attachment 147596 Details for
Bug 193870
Large data-set perl script which forks child processes will coredump near exit()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
script_to_core_dump
mem_fork_coredump (text/plain), 1.71 KB, created by
lsim4242
on 2014-09-23 12:49:41 UTC
(
hide
)
Description:
script_to_core_dump
Filename:
MIME Type:
Creator:
lsim4242
Created:
2014-09-23 12:49:41 UTC
Size:
1.71 KB
patch
obsolete
>#!/usr/local/bin/perl -w > >use strict; >## ----------------------------------------------------------------------------- >sub run >{ > my ($ncpu, $cnt) = @_; > my($i, $pid); > ## ------------------------------------------------------------- > ## Generate Mobile Info > ## -------------------- > my %tmp = (); > for ($i=0; $i<$cnt; $i++) { > $tmp{$i} = $i; > } > ## --------------------------------------------------------------------- > print "D> Parent - start\n"; > for ($i=0; $i<$ncpu; $i++) { > $pid = fork(); > if (!defined($pid)) { > my $err = "E> fork(): Failure, $?"; > print $err, "\n"; > Log::die($err); > } > if ($pid == 0) { > print "D> Child Pid $$\n"; > > ## Just to ensure that child uses VM > ## Not essential. > my($j); > for ($j=0; $j<$cnt; $j++) { > $_ = $tmp{$j}; > } > sleep 5; > ## ----------------------------------------------------- > ## exit() here will cause core-dump. > exit(0); > } > } > for ($i=0; $i<$ncpu; $i++) { > if (wait() < 0) { > my $err = "E> Wait() Failure, $?"; > print $err, "\n"; > Log::die($err); > } > } > print "D> Parent - end\n"; >} >## ============================================================================= > >## Causes coredump with 1G mem, (10.0-RELEASE-p3 amd64) perl v5.16.3 >## Causes coredump with 1G mem, (10.0-RELEASE-p3 amd64) perl v5.20.0 >run(2, 2000000); > >## NO coredump! with 1G mem, (10.0-RELEASE-p3 amd64) perl v5.14.4 >#run(2, 2000000); >## Causes coredump with 1G mem, (10.0-RELEASE-p3 amd64) perl v5.14.4 >#run(2, 2500000); > >## NO coredump! with 2G mem, ( 6.2-RELEASE-p7 i386 ) perl v5.8.8 >#run(4, 4000000); > >## NO coredump! with 1G mem, (10.0-RELEASE-p9 i386 ) perl v5.16.3 >#run(4, 4500000); > >## ----------------------------------------------------------------------------- >exit 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 193870
: 147596