Ticket #1707 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

attempt to mmap 2325622477335777280 bytes when printing utf8 in perl6

Reported by: mikegrb Owned by: jkeenan
Priority: normal Milestone:
Component: none Version: 2.5.0
Severity: low Keywords:
Cc: Language: perl6
Patch status: Platform: darwin

Description (last modified by coke) (diff)

My apologies if this is a perl6 issue and not parrot but parrot told me to run parrotbug and I always do what a parrot tells me ;)

Attatched is the file generated by parrotbug, the description I've copied here for convenience.

Source of my script is:

#!/usr/bin/env perl6

use v6;

say "\c[DEGREE FAHRENHEIT]";

output from running the script:

perl6(75422) malloc: *** mmap(size=2325622477335777280) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Failed allocation of 2325622477335773507 bytes
Parrot VM: PANIC: Out of mem!
C file src/gc/alloc_memory.c, line 92
Parrot file (not available), line (not available)

We highly suggest you notify the Parrot team if you have not been working on
Parrot.  Use parrotbug (located in parrot's root directory) or send an
e-mail to parrot-dev@lists.parrot.org.
Include the entire text of this error message and the text of the script that
generated the error.  If you've made any modifications to Parrot, please
describe them as well.

Version     : 2.5.0-devel
Configured  : Mon Jul 19 03:30:05 2010 GMT
Architecture: i386-darwin
JIT Capable : No
Interp Flags: (no interpreter)
Exceptions  : (missing from core)

Dumping Core...

Unfortunately, I'm not sure where that core ended up, cant seem to find it.

Mike

Attachments

report.txt Download (3.1 KB) - added by mikegrb 4 years ago.
parrotbug output

Change History

Changed 4 years ago by mikegrb

parrotbug output

Changed 4 years ago by coke

  • description modified (diff)

reformat report with tracwikistyle.

Changed 4 years ago by coke

A stack trace would be helpful in tracking this down. Assuming this is a local build of rakudo, you could do (from memory:)

$ gdb ./parrot-install/parrot

gdb> run perl6.pbc yourscript.p6
gdb> bt

Thanks.

Changed 4 years ago by mikegrb

Tried about 20 runs, unfurtunately I just get the following, without the giant malloc or core dump:

(gdb) run perl6.pbc ~/bin/amb_temp.p6 
Starting program: /Users/mgreb/proj/rakudo/parrot_install/bin/parrot perl6.pbc ~/bin/amb_temp.p6
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
===SORRY!===
attempt to access code outside of current code segment

Program exited with code 01.

I did find where OS X stashed a 'DiagnosticReport' for the dump... (~/Library/Logs/DiagnosticReports/ for others in the future).

Process:         perl6 [77264]
Path:            /Users/mgreb/proj/rakudo/parrot_install/bin/perl6
Identifier:      perl6
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  zsh [18779]

Date/Time:       2010-07-20 14:35:10.077 -0400
OS Version:      Mac OS X 10.6.2 (10C540)
Report Version:  6

Exception Type:  EXC_CRASH (SIGQUIT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib                   0x00007fff82bfbfe6 __kill + 10
1   libparrot.dylib                     0x0000000101a2e96d do_panic + 397 (exceptions.c:728)
2   libparrot.dylib                     0x0000000101a3383d failed_allocation + 61 (alloc_memory.c:31)
3   libparrot.dylib                     0x0000000101a33903 mem__internal_allocate + 35 (alloc_memory.c:94)
4   libparrot.dylib                     0x0000000101a03a7e string_to_cstring_nullable + 62 (api.c:2211)
5   libparrot.dylib                     0x0000000101a281a2 Parrot_get_datatype_enum + 18 (datatypes.c:44)
6   libparrot.dylib                     0x0000000101a18453 Parrot_new_p_sc + 147 (core_ops.c:19573)
7   libparrot.dylib                     0x0000000101a61ead runops_fast_core + 45 (cores.c:514)
8   libparrot.dylib                     0x0000000101a6190a runops_int + 106 (main.c:242)
9   libparrot.dylib                     0x0000000101a3c6f7 runops + 487 (ops.c:129)
10  libparrot.dylib                     0x0000000101a388bd Parrot_pcc_invoke_from_sig_object + 237 (pcc.c:367)
11  libparrot.dylib                     0x0000000101a38a01 Parrot_pcc_invoke_sub_from_c_args + 257 (pcc.c:89)
12  perl6                               0x0000000100001693 main + 298 (perl6.c:850884)
13  perl6                               0x0000000100001554 start + 52

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000101b1c850  rcx: 0x00007fff5fbfebe8  rdx: 0x0000000000000000
  rdi: 0x0000000000012dd0  rsi: 0x0000000000000003  rbp: 0x00007fff5fbfec10  rsp: 0x00007fff5fbfebe8
   r8: 0x0000000000000002   r9: 0x0000000000000000  r10: 0x00007fff5fbfeba0  r11: 0x0000000000000206
  r12: 0x000000000000005c  r13: 0x00007fff7067d298  r14: 0x0000000000000000  r15: 0x0000000109c8c620
  rip: 0x00007fff82bfbfe6  rfl: 0x0000000000000206  cr2: 0x0000000102dfe000

Binary Images:
       0x100000000 -        0x1019fefe7 +perl6 ??? (???) <730FB733-F467-47CB-2556-7CF917BEF174> /Users/mgreb/proj/rakudo/parrot_install/bin/perl6
       0x101a01000 -        0x101b87fef +libparrot.dylib ??? (???) <AB581F2F-9BA9-FEC3-EF42-D9BDA7343436> /Users/mgreb/proj/rakudo/parrot/blib/lib/libparrot.dylib
       0x101c9d000 -        0x101ca1fff  libutil.dylib ??? (???) <59C14CE0-3608-D246-542A-283E9065261D> /usr/lib/libutil.dylib
       0x101ca6000 -        0x101cc2ff7  libedit.2.dylib ??? (???) <F9D005F8-74B8-CC05-2697-24C49E0CC1EF> /usr/lib/libedit.2.dylib
       0x101cf0000 -        0x101cf2ff7 +math_ops.bundle ??? (???) <EB194193-3D4D-C1F7-422D-58591D29345D> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/math_ops.bundle
       0x101cf7000 -        0x101cf8ff7 +obscure_ops.bundle ??? (???) <7982EB70-FF88-0FB0-AEC4-603E71416E75> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/obscure_ops.bundle
       0x101e8d000 -        0x101eaafff +perl6_group.bundle ??? (???) <7690E462-6FBE-0E28-2001-D38310D30315> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/perl6_group.bundle
       0x101ebb000 -        0x101ecefff +perl6_ops.bundle ??? (???) <C887347C-68A4-B88A-0FD3-F319D207B0E8> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/perl6_ops.bundle
       0x101ed8000 -        0x101edcff7 +bit_ops.bundle ??? (???) <DFAFE26C-A690-C959-0A7D-D4EA148431B7> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/bit_ops.bundle
       0x101ee5000 -        0x101ee8fff +io_ops.bundle ??? (???) <D26A0507-C868-C2C7-E475-1405A284024F> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/io_ops.bundle
       0x101eef000 -        0x101ef0ff7 +sys_ops.bundle ??? (???) <4696CD16-F981-7F62-A9CA-55C28528A48A> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/sys_ops.bundle
       0x101ef3000 -        0x101ef4ff7 +os.bundle ??? (???) <9AB3BA3C-6575-253C-689B-C2170C323D36> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/os.bundle
       0x101ef8000 -        0x101ef9ff7 +file.bundle ??? (???) <15EA2A71-395C-42C2-C5C3-07474A6F4427> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/file.bundle
       0x101f0c000 -        0x101f0fff7 +trans_ops.bundle ??? (???) <F26503AC-AEED-D824-C663-B4B635D47BB7> /Users/mgreb/proj/rakudo/parrot_install/lib/2.5.0-devel/dynext/trans_ops.bundle
    0x7fff5fc00000 -     0x7fff5fc3bdef  dyld 132.1 (???) <B633F790-4DDB-53CD-7ACF-2A3682BCEA9F> /usr/lib/dyld
    0x7fff80f3d000 -     0x7fff80fbafef  libstdc++.6.dylib ??? (???) <35ECA411-2C08-FD7D-11B1-1B7A04921A5C> /usr/lib/libstdc++.6.dylib
    0x7fff81682000 -     0x7fff81686ff7  libmathCommon.A.dylib ??? (???) <95718673-FEEE-B6ED-B127-BCDBDB60D4E5> /usr/lib/system/libmathCommon.A.dylib
    0x7fff82bad000 -     0x7fff82d6bff7  libSystem.B.dylib ??? (???) <526DD3E5-2A8B-4512-ED97-01B832369959> /usr/lib/libSystem.B.dylib
    0x7fff83de2000 -     0x7fff83e21fef  libncurses.5.4.dylib ??? (???) <E0A07C12-D912-DF26-9E38-C50484D96EB0> /usr/lib/libncurses.5.4.dylib
    0x7fffffe00000 -     0x7fffffe01fff  libSystem.B.dylib ??? (???) <526DD3E5-2A8B-4512-ED97-01B832369959> /usr/lib/libSystem.B.dylib

Changed 4 years ago by chromatic

On Tuesday 20 July 2010 at 11:40, Parrot  wrote:

> #1707: attempt to mmap 2325622477335777280 bytes when printing utf8 in perl6


>  Exception Type:  EXC_CRASH (SIGQUIT)
>  Exception Codes: 0x0000000000000000, 0x0000000000000000
>  Crashed Thread:  0  Dispatch queue: com.apple.main-thread
> 
>  Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
>  0   libSystem.B.dylib                   0x00007fff82bfbfe6 __kill + 10
>  1   libparrot.dylib                     0x0000000101a2e96d do_panic + 397
>  (exceptions.c:728)
>  2   libparrot.dylib                     0x0000000101a3383d
>  failed_allocation + 61 (alloc_memory.c:31)
>  3   libparrot.dylib                     0x0000000101a33903
>  mem__internal_allocate + 35 (alloc_memory.c:94)
>  4   libparrot.dylib                     0x0000000101a03a7e
>  string_to_cstring_nullable + 62 (api.c:2211)
>  5   libparrot.dylib                     0x0000000101a281a2
>  Parrot_get_datatype_enum + 18 (datatypes.c:44)
>  6   libparrot.dylib                     0x0000000101a18453 Parrot_new_p_sc
>  + 147 (core_ops.c:19573)

Here's the problem; whatever STRING gets passed to Parrot_get_datatype_enum() 
is invalid.  If you can print *type_name from this call frame (and if we can 
figure out where it came from), we can fix the error.

-- c

Changed 4 years ago by mikegrb

After judicious use of ack (Thanks Andy) and a Parrot_io_eprintf later, type_name is set to 'Exp' in the last call to Parrot_get_datatype_enum before the dump.

Mike

Changed 4 years ago by mikegrb

Oh, and that is the c string 'Exp' not a parrot string, perhaps that's the problem.

Mike

Changed 4 years ago by chromatic

On Wednesday 21 July 2010 at 06:30, Parrot  wrote:

>  Oh, and that is the c string 'Exp' not a parrot string, perhaps that's the
>  problem.

Yes, that would do it:

	 Parrot_get_datatype_enum(PARROT_INTERP, ARGIN(const STRING *type_name));

-- c

Changed 4 years ago by coke

I am not able to reproduce this with a recent vintage rakudo on parrot:

$ perl6 --version

This is Rakudo Perl 6, version 2010.08 built on parrot 2.7.0 r48655

Copyright 2008-2010, The Perl Foundation

 $ cat foo.p6
#!/usr/bin/env perl6
use v6;
say "\c[DEGREE FAHRENHEIT]";
 $ perl6 foo.p6 
℉

mikegrb - can you please verify if this is still an issue for you?

Changed 4 years ago by jkeenan

  • status changed from new to assigned
  • owner set to jkeenan

I'm going to take this ticket for the purpose of scheduling its closing. I will close the ticket in 7 days unless mikegrb indicates it's still an issue for him.

Thank you very much.

kid51

Changed 4 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

mikegrb indicated on #parrot that we're okay to close. Doing so.

Note: See TracTickets for help on using tickets.