Skip Menu |
Report information
Id: 131666
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: Vladimir.Marek [at] oracle.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Vladimir Marek <Vladimir.Marek [...] oracle.com>
Date: Tue, 27 Jun 2017 12:44:22 +0200
Subject: NativeCall MoarVM panic
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 1.8k
I took the NativeCall sample from here: https://perl6advent.wordpress.com/2015/12/21/day-21-nativecall-backs-and-beyond-c/ -------------------------------------------------------------------------------- use NativeCall; sub XML_SetElementHandler(OpaquePointer $parser, &start (OpaquePointer, Str, CArray[Str]), &end (OpaquePointer, Str)) is native('expat') { ... } sub XML_ParserCreate(Str --> OpaquePointer) is native('expat') { ... } sub XML_ParserFree(OpaquePointer) is native('expat') { ... } sub XML_Parse(OpaquePointer, Buf, int32, int32 --> int32) is native('expat') { ... } my $xml = q:to/XML/; <calendar> <advent day="21"> <topic title="NativeCall Bits and Pieces"/> </advent> </calendar> XML my $depth = 0; sub start-element($, $elem, $attr) { say "open $elem".indent($depth * 4); ++$depth; } sub end-element($, $elem) { --$depth; say "close $elem".indent($depth * 4); } my $parser = XML_ParserCreate('UTF-8'); XML_SetElementHandler($parser, &start-element, &end-element); my $buf = $xml.encode('UTF-8'); XML_Parse($parser, $buf, $buf.elems, 1); XML_ParserFree($parser); -------------------------------------------------------------------------------- All works fine, unless I try to use the $attr in start-element sub start-element($, $elem, $attr) { say "open $elem".indent($depth * 4); say $attr.elems; ++$depth; } The program then terminates with: MoarVM panic: Internal error: Unwound entire stack and missed handler I have seen that on Solaris, but Linux has the same issue. In both cases custom build perl6 using 'rakudobrew build moar' so I suppose latest git revision. Thank you -- Vlad


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org