Skip to content

Truncate RTS eventlog event in postCapsetVecEvent if payload is larger than EVENT_PAYLOAD_SIZE_MAX (#20221)

Ian-Woo Kim requested to merge wavewave/ghc:wavewave/eventlog-fix into master

Previously, postCapsetVecEvent records eventlog event with payload of variable size larger than EVENT_PAYLOAD_SIZE_MAX (2^16) without any validation, resulting in corrupted data. For example, this happens when a Haskell binary is invoked with very long command line arguments exceeding 2^16 bytes (see #20221 (closed)). Now we check the size of accumulated payload messages incrementally, and truncate the message just before the payload size exceeds EVENT_PAYLOAD_SIZE_MAX. RTS will warn the user with a message showing how many arguments are truncated.

Edited by Ian-Woo Kim

Merge request reports