Disable trace stitching (for now) due to a design mistake.

Thanks to Elias Hogstvedt for finding a test case for a well known,
but hard to track down issue with trace stitching.
This commit is contained in:
Mike Pall 2015-04-28 20:46:59 +02:00
parent 74caac97ae
commit c2924c3e1d
2 changed files with 34 additions and 0 deletions

View File

@ -96,6 +96,13 @@ static ptrdiff_t results_wanted(jit_State *J)
return -1; return -1;
} }
#ifdef LUAJIT_TRACE_STITCHING
/* This feature is disabled for now due to a design mistake. Sorry.
**
** It causes unpredictable behavior and crashes when a full trace flush
** happens with a stitching continuation still in the stack somewhere.
*/
/* Trace stitching: add continuation below frame to start a new trace. */ /* Trace stitching: add continuation below frame to start a new trace. */
static void recff_stitch(jit_State *J) static void recff_stitch(jit_State *J)
{ {
@ -174,6 +181,31 @@ static void LJ_FASTCALL recff_nyi(jit_State *J, RecordFFData *rd)
/* Must stop the trace for classic C functions with arbitrary side-effects. */ /* Must stop the trace for classic C functions with arbitrary side-effects. */
#define recff_c recff_nyi #define recff_c recff_nyi
#else
/* Fallback handler for fast functions that are not recorded (yet). */
LJ_NORET static void recff_nyi(jit_State *J, RecordFFData *rd)
{
setfuncV(J->L, &J->errinfo, J->fn);
lj_trace_err_info(J, LJ_TRERR_NYIFF);
UNUSED(rd);
}
/* Throw error for unsupported variant of fast function. */
LJ_NORET static void recff_nyiu(jit_State *J, RecordFFData *rd)
{
setfuncV(J->L, &J->errinfo, J->fn);
lj_trace_err_info(J, LJ_TRERR_NYIFFU);
UNUSED(rd);
}
/* Must abort the trace for classic C functions with arbitrary side-effects. */
LJ_NORET static void recff_c(jit_State *J, RecordFFData *rd)
{
setfuncV(J->L, &J->errinfo, J->fn);
lj_trace_err_info(J, LJ_TRERR_NYICF);
UNUSED(rd);
}
#endif
/* Emit BUFHDR for the global temporary buffer. */ /* Emit BUFHDR for the global temporary buffer. */
static TRef recff_bufhdr(jit_State *J) static TRef recff_bufhdr(jit_State *J)

View File

@ -24,6 +24,8 @@ TREDEF(BADTYPE, "bad argument type")
TREDEF(CJITOFF, "JIT compilation disabled for function") TREDEF(CJITOFF, "JIT compilation disabled for function")
TREDEF(CUNROLL, "call unroll limit reached") TREDEF(CUNROLL, "call unroll limit reached")
TREDEF(DOWNREC, "down-recursion, restarting") TREDEF(DOWNREC, "down-recursion, restarting")
TREDEF(NYICF, "NYI: C function %p")
TREDEF(NYIFF, "NYI: FastFunc %s")
TREDEF(NYIFFU, "NYI: unsupported variant of FastFunc %s") TREDEF(NYIFFU, "NYI: unsupported variant of FastFunc %s")
TREDEF(NYIRETL, "NYI: return to lower frame") TREDEF(NYIRETL, "NYI: return to lower frame")