Closed Bug 925604 Opened 11 years ago Closed 11 years ago

Crash when calling back into javascript repeatedly

Categories

(Core :: js-ctypes, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bdahl, Unassigned)

Details

Attachments

(4 files)

Attached file backtrace.txt
This was first observed in the libadb add-on when we were busy waiting.  I've created a minimal extension and shared library that reproduces the crash. The shared library basically just calls back into js code in a loop and eventually crashes with the attached backtrace.
Attached file mymod.c
Attached file bootstrap.js
Attached file worker.js
I'm pretty sure bug 915613 fixed this. Which build are you running on?
Debug build, updated yesterday 40c7c53fe9b0
Oh, I misinterpreted the stack.

What's happening is that the |cinfo| that gets passed from your native code to the JS callback points to freed JS heap memory. The most likely reason is that you're letting the callback object be collected in JS before you invoke it.

See the second warning here: https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes/js-ctypes_reference/Callbacks
That was it.  Looks like it happens multiple places in the libadb code. Thanks for the help!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: