From owner-freebsd-current Mon Jan 24 16:18:55 2000 Delivered-To: freebsd-current@freebsd.org Received: from tmtowtdi.perl.org (tmtowtdi.perl.org [209.85.3.25]) by hub.freebsd.org (Postfix) with SMTP id DD6AC14EBC for ; Mon, 24 Jan 2000 16:18:49 -0800 (PST) (envelope-from richard@tmtowtdi.perl.org) Received: (qmail 23328 invoked by uid 511); 25 Jan 2000 00:11:30 -0000 Subject: [ID 20000124.004] "perl in malloc(): warning: recursive call" on array write + signals To: perl5-porters@perl.org From: Lars Eggert Delivered-To: perlmail-perlbug@perl.org Cc: current@freebsd.org Date: Mon, 24 Jan 2000 16:06:09 -0800 (PST) Message-Id: <200001250006.QAA13204@sub.isi.edu> Received: (qmail 23320 invoked by uid 508); 25 Jan 2000 00:11:29 -0000 X-loop: perlbug@perl.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a bug report for perl from larse@ISI.EDU, generated with the help of perlbug 1.26 running under perl 5.00503. ----------------------------------------------------------------- [Please enter your report here] Running the following test script causes perl to crash. You may need to run the script several times before seeing the problem. (The script spawns a child process that does nothing but write to an array. The parent signals the child periodically.) #!/usr/local/bin/perl -w use strict; use constant CHUNK_SIZE => 128; use constant ARRAY_SIZE => 1_000_000; $| = 1; if(my $pid = fork) { # parent signals periodically while(1) { select undef, undef, undef, 0.1; kill(ALRM => $pid) == 1 or die "cannot signal: $!"; print "."; } } else { # is kid up? unless(defined $pid) { die "cannot fork: $!"; } # initialize array (by using last element) my @data; $data[ARRAY_SIZE] = 1; # state of the process (number of alarms received) my $state = 0; $SIG{ALRM} = sub { $state++ }; # run the test while(1) { # calculate new position for this iteration my $pos = int rand ARRAY_SIZE; # write a chunk to a random position @data[$pos..$pos+CHUNK_SIZE] = (1) x CHUNK_SIZE; } } Execution of this script results in the following output: [sub: ~/thesis/bin] short ......................perl in malloc(): warning: recursive call. Out of memory! ....perl in malloc(): warning: recursive call. Out of memory! perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl in free(): warning: recursive call. perl.perl in malloc(): warning: recursive call. Out of memory! perl in free(): warning: recursive call. cannot signal: No such process at short line 14. Exit 3 Please let me know if I can provide any other information to help track this bug down. [Please do not change anything below this line] ----------------------------------------------------------------- --- Site configuration information for perl 5.00503: Configured by markm at $Date: 1999/05/05 19:42:40 $. Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=freebsd, osvers=4.0-current, archname=i386-freebsd uname='freebsd freefall.freebsd.org 4.0-current freebsd 4.0-current #0: $Date: 1999/05/05 19:42:40 $' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='undef', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release) cppflags='' ccflags ='' stdchar='char', d_stdstdio=undef, usevfork=true intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='-Wl,-E' libpth=/usr/lib libs=-lm -lc -lcrypt libc=/usr/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so.3 Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-DPIC -fpic', lddlflags='-shared' Locally applied patches: --- @INC for perl 5.00503: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 . --- Environment for perl 5.00503: HOME=/nfs/ruby/larse LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=.:/home/d7unsupp/FreeBSD.ELF/bin:/usr/local/v6/bin:/usr/local/v6/sbin:/usr/inet6/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/tmp/scotty/bin:/stand PERL_BADLANG (unset) SHELL=/bin/ntcsh To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message