Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate instead failing if string is too long in writer #304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions vendor/tracing/zero/writer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,12 @@ end
let max_interned_string_length = 32000 - 1

let set_string_slot t ~string_id s =
let s =
if String.length s > max_interned_string_length
then String.sub s 0 max_interned_string_length
else s
in
let str_len = String.length s in
if str_len > max_interned_string_length
then failwithf "string too long for FTF trace: %i is over the limit of 32kb" str_len ();
(* String record *)
let rtype = 2 in
let rsize = 1 + round_words_for str_len in
Expand Down
Loading