Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 737 lines (575 sloc) 19.6 KB
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>#54444: [rakudo] &#39;No such caller depth&#39; with pure perl mod_perl6</title>
<link rel="shortcut icon" href="/rt3/NoAuth/images//favicon.png" type="image/png" />
<link rel="stylesheet" href="/rt3/NoAuth/css/rt.perl.org/main.css" type="text/css" media="all" />
<link rel="stylesheet" href="/rt3/NoAuth/css/print.css" type="text/css" media="print" />
<script type="text/javascript" src="/rt3/NoAuth/js/util.js"></script>
<script type="text/javascript" src="/rt3/NoAuth/js/titlebox-state.js"></script>
<script type="text/javascript"><!--
onLoadHook("loadTitleBoxStates()");
--></script>
</head>
<body id="comp-Public-Bug-Display">
<div id="logo">
<a href="http://rt.perl.org/rt3/"><img src="/rt3/NoAuth/images//local/pblogo.gif" alt="PerlBug" width="230" height="50"></a>
</div>
<div id="quickbar">
<div id="quick-personal">
<span class="hide"><a href="#skipnav">Skip Menu</a> | </span>
You are currently an anonymous guest.
|
<a href="/rt3/NoAuth/Logout.html?URL=/rt3/index.html?goto=%252FPublic%252FBug%252FDisplay.html%253Fid%253D54444">Login</a>
|
<a href="/rt3/NoAuth/Logout.html">Return to Main</a>
| <a href="/rt3/User/Prefs.html">Preferences</a>
</div>
<div id="topactions">
<span class="topaction">
<form action="/rt3/Public/Search/Simple.html">
<input size="12" name="q" autocomplete="off" accesskey="0" class="field" />
<input type="submit" class="button" value="Search" />
</form>
</span>
</div>
</div>
<div id="nav">
<ul id="system-menu">
<div><div class="wrapper">
</div></div>
</ul>
</div>
<div id="header">
<h1>#54444: [rakudo] &#39;No such caller depth&#39; with pure perl mod_perl6</h1>
<ul id="page-menu">
<div><div><div>
&nbsp;
</div></div></div>
</ul>
</div>
<div id="body">
<a name="skipnav" id="skipnav" accesskey="8"></a>
<div class="">
<div class="titlebox " id="">
<div class="titlebox-title">
<span class="widget"><a href="#" onclick="return rollup('TitleBox--_Public_Bug_Display.html------Report information---0');" onfocus="this.blur(); return false;" title="Toggle visibility">X</a></span>
<span class="left">Report information</span>
<span class="right"></span>
</div>
<div class="titlebox-content " id="TitleBox--_Public_Bug_Display.html------Report information---0">
<table width="100%" class="ticket-summary">
<tr>
<td valign="top" width="50%" class="boxcontainer">
<div class="ticket-info-basics">
<div class="titlebox ticket-info-basics" id="">
<div class="titlebox-title">
<span class="widget"><a href="#" onclick="return rollup('TitleBox--_Public_Bug_Display.html--ticket-info-basics----The Basics---0');" onfocus="this.blur(); return false;" title="Toggle visibility">X</a></span>
<span class="left"><a href="/rt3/Ticket/Modify.html?id=54444">The Basics</a></span>
<span class="right"></span>
</div>
<div class="titlebox-content " id="TitleBox--_Public_Bug_Display.html--ticket-info-basics----The Basics---0">
<table>
<tr>
<td class="label id">Id:</td>
<td class="value id">54444</td>
</tr>
<tr>
<td class="label status">Status:</td>
<td class="value status">resolved</td>
</tr>
<tr>
<td class="label time left">Left:</td>
<td class="value time left">0 min
</td>
</tr>
<tr>
<td class="label priority">Priority:</td>
<td class="value priority">0/0</td>
</tr>
<tr>
<td class="label queue">Queue:</td>
<td class="value queue">perl6
</td>
</tr>
</table>
<hr class="clear" />
</div>
</div>
</div>
<div class="ticket-info-people">
<div class="titlebox ticket-info-people" id="">
<div class="titlebox-title">
<span class="widget"><a href="#" onclick="return rollup('TitleBox--_Public_Bug_Display.html--ticket-info-people----People---0');" onfocus="this.blur(); return false;" title="Toggle visibility">X</a></span>
<span class="left"><a href="/rt3/Ticket/ModifyPeople.html?id=54444">People</a></span>
<span class="right"></span>
</div>
<div class="titlebox-content " id="TitleBox--_Public_Bug_Display.html--ticket-info-people----People---0">
<table>
<tr>
<td class="label">Owner:</td>
<td class="value">
pmichaud
&lt;pmichaud [at] pobox.com&gt;
</td>
</tr>
<tr>
<td class="labeltop">Requestors:</td>
<td class="value">
jhorwitz
&lt;jeff [at] smashing.org&gt;
<br />
</td>
</tr>
<tr>
<td class="labeltop">Cc:</td>
<td class="value">
</td>
</tr>
<tr>
<td class="labeltop">AdminCc:</td>
<td class="value">
</td>
</tr>
</table>
<hr class="clear" />
</div>
</div>
</div>
</td>
<td valign="top" width="50%" class="boxcontainer">
<div class="ticket-info-cfs">
<div class="titlebox ticket-info-cfs" id="">
<div class="titlebox-title">
<span class="widget"><a href="#" onclick="return rollup('TitleBox--_Public_Bug_Display.html--ticket-info-cfs----Bug Information---0');" onfocus="this.blur(); return false;" title="Toggle visibility">X</a></span>
<span class="left"><a href="/rt3/Ticket/Modify.html?id=54444">Bug Information</a></span>
<span class="right"></span>
</div>
<div class="titlebox-content " id="TitleBox--_Public_Bug_Display.html--ticket-info-cfs----Bug Information---0">
<table>
<tr id="CF-18-ShowRow">
<td class="label">Severity:</td>
<td class="value">
<i>(no value)</i>
</td>
</tr>
<tr id="CF-19-ShowRow">
<td class="label">Tag:</td>
<td class="value">
<i>(no value)</i>
</td>
</tr>
<tr id="CF-20-ShowRow">
<td class="label">Platform:</td>
<td class="value">
<i>(no value)</i>
</td>
</tr>
<tr id="CF-21-ShowRow">
<td class="label">Patch Status:</td>
<td class="value">
<i>(no value)</i>
</td>
</tr>
</table>
<hr class="clear" />
</div>
</div>
</div>
<div class="ticket-info-links">
<div class="titlebox ticket-info-links" id="">
<div class="titlebox-title">
<span class="widget"><a href="#" onclick="return rollup('TitleBox--_Public_Bug_Display.html--ticket-info-links----Links---0');" onfocus="this.blur(); return false;" title="Toggle visibility">X</a></span>
<span class="left"><a href="/rt3/Ticket/ModifyLinks.html?id=54444">Links</a></span>
<span class="right"></span>
</div>
<div class="titlebox-content " id="TitleBox--_Public_Bug_Display.html--ticket-info-links----Links---0">
<table>
<tr>
<td class="labeltop">Depends on:</td>
<td class="value">
<ul>
</ul>
</td>
</tr>
<tr>
<td class="labeltop">Depended on by:</td>
<td class="value">
<ul>
</ul>
</td>
</tr>
<tr>
<td class="labeltop">Parents:</td>
<td class="value">
<ul>
</ul>
</td>
</tr>
<tr>
<td class="labeltop">Children:</td>
<td class="value"></td>
</tr>
<tr>
<td class="labeltop">Refers to:</td>
<td class="value">
<ul>
</ul>
</td>
</tr>
<tr>
<td class="labeltop">Referred to by:</td>
<td class="value">
<ul>
</ul>
</td>
</tr>
</table>
<hr class="clear" />
</div>
</div>
</div>
</td>
</tr>
</table>
<hr class="clear" />
</div>
</div>
</div>
<br />
<div class="titlebox " id="">
<div class="titlebox-title">
<span class="widget"><a href="#" onclick="return rollup('TitleBox--_Public_Bug_Display.html------History---0');" onfocus="this.blur(); return false;" title="Toggle visibility">X</a></span>
<span class="left">History</span>
<span class="right"><span style="color: black">Display mode:</span> <span class="selected">Brief headers</span> &mdash; <a href="/rt3/Ticket/Display.html?ShowHeaders=1;id=54444">Full headers</a></span>
</div>
<div class="titlebox-content " id="TitleBox--_Public_Bug_Display.html------History---0">
<div id="ticket-history">
<div class="ticket-transaction message odd">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td rowspan="2" valign="top" class="type">
<a name="txn-408128" href="/rt3/Ticket/Display.html?id=54444#txn-408128">#</a>
&nbsp;
</td>
<td class="date">Mon&nbsp;May&nbsp;19&nbsp;07:55:23&nbsp;2008</td>
<td class="description">
jhorwitz - Ticket created
</td>
<td class="time-taken"></td>
<td class="actions">&nbsp;</td>
</tr>
<tr>
<td colspan="4" class="content">
<table>
<tr>
<td align="right" class="message-header-key">Subject:</td>
<td class="message-header-value">[rakudo] &#39;No such caller depth&#39; with pure perl mod_perl6</td>
</tr>
<tr>
<td align="right" class="message-header-key">Date:</td>
<td class="message-header-value">Mon, 19 May 2008 09:51:00 -0400 &#40;EDT&#41;</td>
</tr>
<tr>
<td align="right" class="message-header-key">To:</td>
<td class="message-header-value">parrotbug <!-- x --> at parrotcode.org</td>
</tr>
<tr>
<td align="right" class="message-header-key">From:</td>
<td class="message-header-value">Jeff Horwitz &lt;jeff <!-- x --> at smashing.org&gt;</td>
</tr>
</table>
<div class="downloadattachment">
<a href="/rt3/Ticket/Attachment/408128/185270/">Download &#40;untitled&#41;</a>
<span class="downloadcontenttype">
[text/plain 1.5k]
</span>
</div>
<div class="messagebody">
<div class="message-stanza-depth-0">
while converting mod_perl6 from PIR to pure perl6, i encountered the <br />
following error when running a handler:<br />
<br />
No such caller depth<br />
current instr.: &#39;parrot;ModParrot;HLL;perl6;handler&#39; pc 62 &#40;EVAL_13:46&#41;<br />
<br />
i tracked down the error to this block in perl6&#39;s actions.pm:<br />
<br />
unless $?BLOCK.symbol&#40;&#39;$/&#39;&#41; {<br />
$init.push&#40; PAST::Var.new&#40; :name&#40;&#39;$/&#39;&#41;, :isdecl&#40;1&#41; &#41; &#41;;<br />
$?BLOCK.symbol&#40; &#39;$/&#39;, :scope&#40;&#39;lexical&#39;&#41; &#41;;<br />
$init.push&#40;<br />
PAST::Op.new&#40;<br />
:inline&#40;<br />
&#34; %r = getinterp\n&#34;<br />
~ &#34; %r = %r[&#39;lexpad&#39;;1]\n&#34;<br />
~ &#34; if null %r goto no_match_to_copy\n&#34;<br />
~ &#34; %r = %r[&#39;$/&#39;]\n&#34;<br />
~ &#34; store_lex &#39;$/&#39;, %r\n&#34;<br />
~ &#34; no_match_to_copy:\n&#34;<br />
&#41;<br />
&#41;<br />
&#41;;<br />
}<br />
<br />
this code assumes there is a previous call frame which might contain a <br />
lexpad, which is always true when called from PIR or the PCT command line. <br />
however, in a pure perl mod_perl6, a perl6 sub is called directly from C, <br />
and therefore lives in the top level call frame. any reference to the <br />
nonexistent previous frame using the interpreter object bombs out.<br />
<br />
you can reproduce this problem in pure PIR with this:<br />
<br />
.sub main :main<br />
$P0 = getinterp<br />
$P1 = $P0[&#39;lexpad&#39;;1]<br />
.end<br />
<br />
if we want perl6 subs to be directly invokable from an embedded <br />
environemnt, we either need to teach perl6 to be smarter about this or <br />
change how parrot handles this kind of exception.<br />
<br />
-jeff<br />
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="ticket-transaction people even">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td rowspan="2" valign="top" class="type">
<a name="txn-408142" href="/rt3/Ticket/Display.html?id=54444#txn-408142">#</a>
&nbsp;
</td>
<td class="date">Mon&nbsp;May&nbsp;19&nbsp;09:00:51&nbsp;2008</td>
<td class="description">
pmichaud - Taken
</td>
<td class="time-taken"></td>
<td class="actions">&nbsp;</td>
</tr>
<tr>
<td colspan="4" class="content">
</td>
</tr>
</table>
</div>
<div class="ticket-transaction basics odd">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td rowspan="2" valign="top" class="type">
<a name="txn-408328" href="/rt3/Ticket/Display.html?id=54444#txn-408328">#</a>
&nbsp;
</td>
<td class="date">Mon&nbsp;May&nbsp;19&nbsp;12:36:23&nbsp;2008</td>
<td class="description">
pmichaud - Queue changed from parrot to perl6
</td>
<td class="time-taken"></td>
<td class="actions">&nbsp;</td>
</tr>
<tr>
<td colspan="4" class="content">
</td>
</tr>
</table>
</div>
<div class="ticket-transaction message even">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td rowspan="2" valign="top" class="type">
<a name="txn-408484" href="/rt3/Ticket/Display.html?id=54444#txn-408484">#</a>
&nbsp;
</td>
<td class="date">Mon&nbsp;May&nbsp;19&nbsp;14:43:10&nbsp;2008</td>
<td class="description">
jhorwitz - Correspondence added
</td>
<td class="time-taken"></td>
<td class="actions">&nbsp;</td>
</tr>
<tr>
<td colspan="4" class="content">
<table>
<tr>
<td align="right" class="message-header-key">Subject:</td>
<td class="message-header-value">Re: [perl #54444] AutoReply: [rakudo] &#39;No such caller depth&#39; with pure perl mod_perl6 </td>
</tr>
<tr>
<td align="right" class="message-header-key">Date:</td>
<td class="message-header-value">Mon, 19 May 2008 17:42:37 -0400 &#40;EDT&#41;</td>
</tr>
<tr>
<td align="right" class="message-header-key">To:</td>
<td class="message-header-value">Parrot via RT &lt;parrotbug-followup <!-- x --> at parrotcode.org&gt;</td>
</tr>
<tr>
<td align="right" class="message-header-key">From:</td>
<td class="message-header-value">Jeff Horwitz &lt;jeff <!-- x --> at smashing.org&gt;</td>
</tr>
</table>
<div class="downloadattachment">
<a href="/rt3/Ticket/Attachment/408484/185424/">Download &#40;untitled&#41;</a>
<span class="downloadcontenttype">
[text/plain 2.2k]
</span>
</div>
<div class="messagebody">
<div class="message-stanza-depth-0">
On Mon, 19 May 2008, Parrot via RT wrote:<br />
<br />
<div class="message-stanza-depth-1">
&gt; while converting mod_perl6 from PIR to pure perl6, i encountered the<br />
&gt; following error when running a handler:<br />
&gt;<br />
&gt; No such caller depth<br />
&gt; current instr.: &#39;parrot;ModParrot;HLL;perl6;handler&#39; pc 62 &#40;EVAL_13:46&#41;<br />
&gt;<br />
&gt; i tracked down the error to this block in perl6&#39;s actions.pm:<br />
&gt;<br />
&gt; unless $?BLOCK.symbol&#40;&#39;$/&#39;&#41; {<br />
&gt; $init.push&#40; PAST::Var.new&#40; :name&#40;&#39;$/&#39;&#41;, :isdecl&#40;1&#41; &#41; &#41;;<br />
&gt; $?BLOCK.symbol&#40; &#39;$/&#39;, :scope&#40;&#39;lexical&#39;&#41; &#41;;<br />
&gt; $init.push&#40;<br />
&gt; PAST::Op.new&#40;<br />
&gt; :inline&#40;<br />
&gt; &#34; %r = getinterp\n&#34;<br />
&gt; ~ &#34; %r = %r[&#39;lexpad&#39;;1]\n&#34;<br />
&gt; ~ &#34; if null %r goto no_match_to_copy\n&#34;<br />
&gt; ~ &#34; %r = %r[&#39;$/&#39;]\n&#34;<br />
&gt; ~ &#34; store_lex &#39;$/&#39;, %r\n&#34;<br />
&gt; ~ &#34; no_match_to_copy:\n&#34;<br />
&gt; &#41;<br />
&gt; &#41;<br />
&gt; &#41;;<br />
&gt; }<br />
&gt;<br />
&gt; this code assumes there is a previous call frame which might contain a<br />
&gt; lexpad, which is always true when called from PIR or the PCT command line.<br />
&gt; however, in a pure perl mod_perl6, a perl6 sub is called directly from C,<br />
&gt; and therefore lives in the top level call frame. any reference to the<br />
&gt; nonexistent previous frame using the interpreter object bombs out.<br />
&gt;<br />
&gt; you can reproduce this problem in pure PIR with this:<br />
&gt;<br />
&gt; .sub main :main<br />
&gt; $P0 = getinterp<br />
&gt; $P1 = $P0[&#39;lexpad&#39;;1]<br />
&gt; .end<br />
&gt;<br />
&gt; if we want perl6 subs to be directly invokable from an embedded<br />
&gt; environemnt, we either need to teach perl6 to be smarter about this or<br />
&gt; change how parrot handles this kind of exception.<br />
&gt;<br />
&gt; -jeff<br />
</div>
<br />
After further investigation, it looks like the parrotinterpreter PMC is <br />
validating caller depth before looking up the keyed item. So for <br />
$P0[&#39;lexpad&#39;;1] it verifies there&#39;s a call frame 1 level up before doing <br />
anything else. A backtrace reveals that the exception occurs at <br />
parrotinterpreter.pmc:426:<br />
<br />
if &#40;!ctx-&gt;current_sub&#41;<br />
real_exception&#40;interp, NULL, E_ValueError,<br />
&#34;No such caller depth&#34;&#41;;<br />
<br />
So it *does* find a valid context one level up, but no current_sub since <br />
we&#39;re calling from C. Is it necessary for this to be fatal? Should we <br />
return NULL here instead of bombing out?<br />
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="ticket-transaction message odd">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td rowspan="2" valign="top" class="type">
<a name="txn-409140" href="/rt3/Ticket/Display.html?id=54444#txn-409140">#</a>
&nbsp;
</td>
<td class="date">Tue&nbsp;May&nbsp;20&nbsp;08:27:59&nbsp;2008</td>
<td class="description">
pmichaud - Comments added
</td>
<td class="time-taken"></td>
<td class="actions">&nbsp;</td>
</tr>
<tr>
<td colspan="4" class="content">
<table>
</table>
<div class="downloadattachment">
<a href="/rt3/Ticket/Attachment/409140/185798/">Download &#40;untitled&#41;</a>
<span class="downloadcontenttype">
[text/plain 91b]
</span>
</div>
<div class="messagebody">
<div class="message-stanza-depth-0">
Fixed by jhorwitz in r27668 by placing a handler around the exception. <br />
Closing ticket.<br />
<br />
Pm<br />
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="ticket-transaction basics even">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td rowspan="2" valign="top" class="type">
<a name="txn-409142" href="/rt3/Ticket/Display.html?id=54444#txn-409142">#</a>
&nbsp;
</td>
<td class="date">Tue&nbsp;May&nbsp;20&nbsp;08:28:00&nbsp;2008</td>
<td class="description">
pmichaud - Status changed from &#39;new&#39; to &#39;resolved&#39;
</td>
<td class="time-taken"></td>
<td class="actions">&nbsp;</td>
</tr>
<tr>
<td colspan="4" class="content">
</td>
</tr>
</table>
</div>
</div>
<hr class="clear" />
</div>
</div>
</div>
<hr size=0>
<div>
For issues related to this RT instance (aka "perlbug"), please contact <tt>perlbug-admin at perl.org</tt>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-50555-18");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<div id="footer">
<p id="time">
<span>Time to display: 1.122978</span>
</p>
<p id="bpscredits">
<span>
&#187;&#124;&#171; RT 3.6.HEAD Copyright 1996-2006 <a href="http://www.bestpractical.com?rt=3.6.HEAD">Best Practical Solutions, LLC</a>.
</span>
</p>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.