assertion failure, bind() issue

Posted on
  • I'm continuing to have issues that I believe are related to using bind(). The call of the function returned crashes. I don't know how to repro it in a simple situation yet. I do have a stack back-trace. The assertion is in jsvRef:

    ASSERT(var && jsvHasRef(var)) FAILED AT src/jsvar.c:622
    

    The lower part of the stack is (top-down):

    jspePostfixExpression at /big/home/src/esp8266/Espruino/src/jspar­se.c:1424
    jspeFactorFunctionCall at /big/home/src/esp8266/Espruino/src/jspar­se.c:1157
    jspeFunctionCall at /big/home/src/esp8266/Espruino/src/jspar­se.c:618
    jsvCopy at /big/home/src/esp8266/Espruino/src/jsvar­.c:2051
    jsvRef at /big/home/src/esp8266/Espruino/src/jsvar­.c:622
    

    Any clue? How can I troubleshoot this? Any way I can find out which JS statement caused this?

  • There's a GDB macro called whereami in .gdbinit that should tell you what the call was.

    Looks to me like that's an issue when running jsvCopy on a 'bound' function parameter. Could be it's an argument type that jsvCopy doesn't usually get run with.

    If you can find out what the parameter was ( p jsvTrace(value,0) in jspeFunctionCall's scope) it should be trivial to reproduce.

  • No gdb :-). But I should be able to add the jsvTrace.

  • Ahh, yeah :) I guess an assert_with_var would be cool, and then it could trace the offending variable if the assert failed.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

assertion failure, bind() issue

Posted by Avatar for tve @tve

Actions