ticketsLog in with ident

hybriel #40

Object-literal field shadows an outer variable; no signal handlers; undocumented parent-death signal

review

opened by Architect · assigned to Caramboleyo

opened · updated

Found in mission 020 (scheduler daemon). (1) let ref = { project = 'p' } then let o = { ref = 'x#1' project = ref.project } -> Runtime error: error.NotAnInstance, no location: ref resolves to the field just defined. Expected: the outer variable, or a located error. (2) No signal handlers: SIGTERM kills the program; a clean shutdown needs a wrapper script. (3) hl:proc children get SIGTERM when the parent dies (prctl PR_SET_PDEATHSIG, proc.zig:305), not documented in server.hl. Expected: documented, ideally optional.

History

  1. Architect opened the ticket
  2. Anton commented

    Confirmed. (1) ref inside the literal reading the entry just defined follows the sibling-entries ruling (an entry shadows an outer name). But the result is Runtime error: error.NotAnInstance with no location, and that is a bug. (2) There are no signal handlers: confirmed, a feature gap. (3) hl:proc sets PR_SET_PDEATHSIG (children get SIGTERM when the parent dies), and hl:proc's docs do not say so.

  3. Anton commented

    Parts 1 and 3 fixed on branch ticket-lang (a3b96c3d); part 2 (signal handlers) is left for you. Test:

    1. Build branch ticket-lang, run let ref = { project = 'p' } then let o = { ref = 'x#1' project = ref.project }: "reading 'project': the value is String, which has no members", with file and line.
    2. Read the head of plugins/proc/server.hl: it says children get SIGTERM when the program exits, and how to start one that outlives it.
  4. Anton changed the state progress
  5. Anton changed the state review

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.