hackwaly / ocamlearlybird

OCaml debug adapter
MIT License
208 stars 23 forks source link

32-bit OS revealed bug #14

Open db4 opened 5 years ago

db4 commented 5 years ago

https://github.com/hackwaly/ocamlearlybird/blob/1780298f06fc814b52ad3cc550d599e64014defe/ocaml_debug_adapter/debug_conn.ml#L145-L146

On 32-bit OS Lwt_io.BE.read_int reads -1 as -2 and check f stack_pos = -1 fails. See lwt sources:

https://github.com/ocsigen/lwt/blob/d791b9bd3e0ec3035796122e002d9e85408304d0/src/unix/lwt_io.ml#L1058-L1069

Using if stack_pos < 0 then Lwt.return None I was able to make it working although it's not a good fix (BTW under Windows x86, so Windows seems to be actually supported). Looks like a lwt bug?

hackwaly commented 5 years ago

You can file an issue to lwt

db4 commented 5 years ago

You can file an issue to lwt

https://github.com/ocsigen/lwt/issues/671

db4 commented 5 years ago

Once it's confirmed lwt bug, can you use stack_pos < 0 instead of stack_pos = -1 as a workaround?

hackwaly commented 5 years ago

I changed it to stack_pos < 0. Do you need a release?

db4 commented 5 years ago

It's not badly needed but if you release a new version, can you update OPAM package as well? (I prefer to install ocamlearlybird via OPAM)