Skip to content

Errors caused by invalid user input should not panic/abort/deadlock #1275

@stevenengler

Description

@stevenengler

There are a few places in Shadow that call panic() if user input is invalid, which prints a backtrace. Instead we should exit gracefully.

Known issues:

  • panic when network graph file doesn't exist — Crash when network graph file does not exist #1459
  • panic when the managed process binary doesn't exist - Provide a clearer error message when process binary isn't found #1522
  • panic when data directory already exists
  • panic when template directory does not exist
  • abort (no message or backtrace) when the managed process path exists but is not executable
  • panic when an out-of-range network_node_id is given (networkgraph_nodeBandwidthDownBits panicked at 'called Option::unwrap() on a None value')
  • panic when the configuration has no hosts (config_getWorkers panicked at 'called Option::unwrap() on a None value')
  • panic when the network has an edge with a latency of 0 ("Message: need nonzero latency to set buffer sizes, source=1 dest=2 send=0 recv=0")
  • deadlock when a process specifies a stop_time where stop_time <= start_time
  • panic when a host IP address is specified as an IPv6 address

Metadata

Metadata

Assignees

Labels

Component: MainComposing the core Shadow executableType: EnhancementNew functionality or improved design

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions