-
Notifications
You must be signed in to change notification settings - Fork 559
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
[BUG] all perl5 versions: segfault on $# #198
Comments
From @jhiThe following strange piece of code *) seems to evoke the $c = [[]]; *) Yes, the snippet makes no sense: an array ref indexed by an Perl Info
|
From @jhiHere's the stack trace from the segfault (source code 5_58-to-be at signal Segmentation fault at [Perl_av_extend:143 +0x14,0x3ffbff6d4d4] ary[--tmp] = &PL_sv_undef; (dbx) list 135,145
(dbx) p tmp Hmmm. My bold guess is that the something is using an address as an (dbx) where
-- |
From [Unknown Contact. See original ticket]This changes the symptom from a segfault to "Out of memory!". I Inline Patch--- av.c.DIST Mon Mar 22 15:58:31 1999
+++ av.c Wed Jul 21 17:28:57 1999
@@ -90,7 +90,8 @@
else {
if (AvALLOC(av)) {
#ifndef STRANGE_MALLOC
- U32 bytes;
+ MEM_SIZE bytes;
+ IV itmp;
#endif
#if defined(MYMALLOC) && !defined(PURIFY) && !defined(LEAKTEST)
@@ -106,13 +107,14 @@
#else
bytes = (newmax + 1) * sizeof(SV*);
#define MALLOC_OVERHEAD 16
- tmp = MALLOC_OVERHEAD;
- while (tmp - MALLOC_OVERHEAD < bytes)
- tmp += tmp;
- tmp -= MALLOC_OVERHEAD;
- tmp /= sizeof(SV*);
- assert(tmp > newmax);
- newmax = tmp - 1;
+ itmp = MALLOC_OVERHEAD;
+ while (itmp - MALLOC_OVERHEAD < bytes)
+ itmp += itmp;
+ itmp -= MALLOC_OVERHEAD;
+ itmp /= sizeof(SV*);
+ assert(itmp > newmax);
+ newmax = itmp - 1;
+ assert(newmax > AvMAX(av));
New(2,ary, newmax+1, SV*);
Copy(AvALLOC(av), ary, AvMAX(av)+1, SV*);
if (AvMAX(av) > 64)
-- Spider Boardman (at home) spider@Orb.Nashua.NH.US |
Migrated from rt.perl.org#1004 (status was 'resolved')
Searchable as RT1004$
The text was updated successfully, but these errors were encountered: