Skip to content

debug.traceback does not handle coroutines#182

Open
brandonbloom wants to merge 1 commit intoterralang:masterfrom
brandonbloom:coroutine-traceback
Open

debug.traceback does not handle coroutines#182
brandonbloom wants to merge 1 commit intoterralang:masterfrom
brandonbloom:coroutine-traceback

Conversation

@brandonbloom
Copy link
Copy Markdown
Contributor

NOTE: Pull request is broken. Only providing the patch for discussion.

See https://www.lua.org/manual/5.1/manual.html#pdf-debug.traceback - The override of debug.traceback in terralib does not respect the thread parameter.

You get something like this:

$ terra

Terra -- A low-level counterpart to Lua

Stanford University
zdevito@stanford.edu

> = debug.traceback(coroutine.running(), 'on noez!', 2)
src/terralib.lua:433: attempt to perform arithmetic on local 'level' (a string value)
stack traceback:
    src/terralib.lua:433: in function <src/terralib.lua:431>

Compare to Lua:

~/Projects/plop $ lua
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> = debug.traceback(coroutine.running(), 'on noez!', 2)
on noez!
stack traceback:
    [C]: in ?
> ^D

I tried to fix the definition of debug.traceback in terralib, but the obvious solution produced 'error in error handling' for some non-obvious reason. I'll take another look at it soon if you don't have an idea offhand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant