lucasgl / luainterface-debugger

Automatically exported from code.google.com/p/luainterface-debugger
1 stars 0 forks source link

Using coroutines crashes the debugger #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the following program in debug mode:

function foo (a)
    print("foo", a)
    return coroutine.yield(2*a)
end

co = coroutine.create(function (a,b)
    print("co-body", a, b)
    local r = foo(a+1)
    print("co-body", r)
    local r, s = coroutine.yield(a+b, a-b)
    print("co-body", r, s)
    return b, "end"
end)

print("main", coroutine.resume(co, 1, 10))
print("main", coroutine.resume(co, "r"))
print("main", coroutine.resume(co, "x", "y"))
print("main", coroutine.resume(co, "x", "y"))

What is the expected output? What do you see instead?
Expected Output:

co-body 1   10
foo 2
main    true    4
co-body r
main    true    11  -9
co-body x   y
main    true    10  end
main    false   cannot resume dead coroutine

Actual Output:
System.AccessViolationException was unhandled
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  Source=lua51

See attached file "memory_access_violation.txt" for detailed stack trace.

What version of the product are you using? On what operating system?
Version 0.1.0, Windows 7 64 bit

Please provide any additional information below.
The attached program runs as expected under .Net with LuaInterface 2.0.4, but 
crashes when run in debug mode. See attachments for program and detailed 
exception information.

Original issue reported on code.google.com by wstntur...@gmail.com on 2 Mar 2013 at 12:51

Attachments: