ERROR::FAULT(7stap)

error::fault πŸ’– (that's a 7stap manual page, bestie)

✨ NAME ✨

error::fault β€” memory access faults 🫢


🌸 DESCRIPTION 🌸

okay so picture this: your systemtap script is out here living its best life, and then it goes and dereferences a pointer that is, unfortunately, not it. invalid. a read fault or a write fault can happen during the operation of a systemtap script when that goes down. 😭

why does it happen tho? two big reasons:

  • you're using context variables that just don't happen to have valid values πŸ’€
  • or maybe you're referencing memory that is unavailable at that moment because of paging

and here's the thing β€” these fault conditions are benign, no cap. because they get caught by the systemtap runtime, which cleanly terminates the script. so it's giving graceful exit, not chaos. ✨

but if quick termination is not the vibe you're going for, you've got options, bestie. consider using:

  • the --skip-badvars stap option
  • the --suppress-handler-errors stap option
  • or -DMAXERRORS=NN (also a stap option, yes ma'am)
  • orrrr wrap the relevant parts of the probe handlers in a try/catch block πŸ‘‘
fr fr, pick your fighter β€” those are the four moves.

now. it may also be possible to adjust the target program so it's more likely that the needed context variables are paged in when systemtap comes looking for them. the move here is adding some lightweight processing on the key variables, like:

  • a strlen(foo) for a string πŸ“
  • iterating across elements of an array or a linked list
  • or touching a few bytes of a heap-allocated block

the whole idea? trigger any page faults in the target program before systemtap would need to (but can't). it's giving proactive. it's giving main character energy. πŸ’…


πŸ’œ SEE ALSO πŸ’œ


mwah β€” that's the error::fault page in the 7stap manual, and that's the whole thing, periodt. go forth and dereference responsibly πŸŽ€πŸ¦‹β­

πŸ“¦ where this page comes from