aantron / luv

Cross-platform asynchronous I/O and system calls
https://aantron.github.io/luv
MIT License
276 stars 26 forks source link

Write fails on s390x (size_t vs uint) #144

Closed talex5 closed 1 year ago

talex5 commented 1 year ago

https://github.com/aantron/luv/blob/0ed668e87ca55d65f4f84422b0dd3381701c71b0/src/c/luv_c_type_descriptions.ml#L147

But it should be size_t: http://docs.libuv.org/en/v1.x/misc.html#c.uv_buf_t

Test-case:

let () =
  let bufs = [Bigarray.Array1.of_array Bigarray.Char Bigarray.c_layout [|'H'; 'i'|]] in
  Luv.File.write Luv.File.stdout bufs (fun _err -> assert false)

strace on this shows:

[pid 17512] write(1, "Hi\3\377\204\251\356\0\0\0\3\377\204\251\356\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0!"..., 8589934592) = 2147479552
aantron commented 1 year ago

This was fixed in #133 by @haesbaert and the follow-on 76c713f952f70b947b7f8da8628f0d39511ec052, which has Luv interpret the field as a size_t, and will be released in 0.5.12. cc @raphael-proust.