ID:2958385
 
BYOND Version:516.1648
Operating System:Windows 11 Pro 64-bit
Web Browser:Firefox 133.0
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
Try to pass through any list or datum to an ffi function

/proc/test_readwrite_var(object)
var/static/loaded = load_ext(BYONDAPI_TEST, "byond:test_readwrite_var_ffi")
return call_ext(loaded)(object)

/datum/data
var/name = "test name"

/test/proc/test_byondapi_readwrite_var()
var/datum/data/stub = new()

var/ret = test_readwrite_var(stub)

if(stub.name != ret)
throw EXCEPTION("Call proc failed, expected rust to return 'test name' but got '[ret]'")


Expected Results:

Passing the var over shouldn't cause any issues and nothing should be printed.

The code on the other side of the ffi function doesn't matter as it prints that even when the function does nothing.

Actual Results:

BUG: Bad ref (dd:4294967295) in DecRefCount(DM test readwrite var)
BUG: Call stack:
Gets printed every time

Does the problem occur:
Problem occurs every time, even on above sample project

When does the problem NOT occur?
Problem did not occur when load_ext() is removed

Workarounds:
Remove load_ext() and load the function like usual
Your snippet only mentions load_ext(). Does this happen without using load_ext()?
In response to Lummox JR
Doesn't happen when load_ext() isn't there.

Login to reply.