Argus.Extractors.CallbackTag (Panoptes v0.13.0)

Copy Markdown View Source

The message tags a handle_call/3, handle_cast/2 or handle_info/2 discriminates on, and whether it has a catch-all.

The server half of a GenServer's contract. The client half — which tag a wrapper actually sends — is not extracted here: it is a join over tuple_literal/literal_value, def_use and remote_call, which is what makes it sound. An earlier version scanned backwards from the call for the last write to {x,1} and attributed a stale one, reporting :amqp_channel as casting :ok when the write was really gen_server:reply(From, ok).

Tags are over-approximated: every atom compared anywhere in the body counts, without tracking which register held it. Consumers ask whether a tag is NOT handled, so over-approximating suppresses findings rather than inventing them.

Emitted facts

  • callback_tag(func, callback, tag) — an atom the callback discriminates on
  • callback_total(func, callback) — some clause accepts every message, whatever it demands of the state (handle_info(msg, {stack, cont}) is a catch-all for messages), so no tag can fail