Skip to content

Trap actions referencing deleted continuations #311

Open
@mshinwell

Description

@mshinwell

This was seen whilst debugging another patch. It looks like continuations named in trap actions may sometimes be left behind (with the continuation definition having been deleted) if an Invalid occurs:

>> Fatal error: Continuation k88 not found in env

Context is: translating function camlCmi_format__read_cmi_1_6_code to Cmm with return cont k213, exn cont k214 and body:
((let
  (name/639 = filename/635)
  ((apply
    ((Stdlib.camlStdlib__open_in_gen_119〈k219〉《k214》
      (Stdlib.camlStdlib__const_block592 0 filename/635))
     (call_kind
      (Direct (code_id camlStdlib__open_in_gen_30_120_code)
       (closure_id Stdlib.open_in_gen/30) (return_arity 𝕍)))
     (dbg ...)
     (inline Default_inline)
     (inlining_state
      (depth 1, arguments
       ((max_inlining_depth 1) (call_cost 0.625000) (alloc_cost 0.875000)
        (prim_cost 0.375000) (branch_cost 0.625000)
        (indirect_call_cost 0.500000) (poly_compare_cost 1.250000)
        (small_function_size 10) (large_function_size 10)
        (threshold 10.000000)))) (probe_name ())))
   k219 (param/640 ∷ 𝕍) #One: goto k218))
 k218 #One:
  (push_trap k88 then goto k220
   k220 #One: Invalid Halt_and_catch_fire))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingflambda2Prerequisite for, or part of, flambda2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions