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

all executable that uses lwt crashes #25

Closed
pirbo opened this issue May 10, 2017 · 10 comments
Closed

all executable that uses lwt crashes #25

pirbo opened this issue May 10, 2017 · 10 comments

Comments

@pirbo
Copy link
Collaborator

pirbo commented May 10, 2017

I know, I'm the maintainer but I need help.

Take for example the program foo.ml:

let () = Lwt_main.run (Lwt_io.print "Hello\n")

opam install lwt-windows.2.6.0 and ocamlfind -toolchain windows opt -linkpkg -package lwt.unix -g -linkpkg -o foo foo.ml will work but

$ wine ./foo
Fatal error: exception Invalid_argument("Lwt_unix.on_signal: unavailable signal")

(It also crash on a real windows 7 and 10)

If you use the former version lwt-windows.2.5.2. it works. It get worse if you try to use lwt.2.7.0 or lwt.3.0.0 (available at https://github.com/pirbo/opam-cross-windows) where the result is now a segfault!

I have no idea how to tackle the issue...

@pirbo
Copy link
Collaborator Author

pirbo commented May 10, 2017

I've made progress thanks to @aantron !
The problem has nothing to do with an update of lwt. The culprit is moving from ocaml 4.02.3 to ocaml 4.04.0.
lwt.2.6.0 works fine with ocaml 4.02.3. lwt.2.5.2 crashes with ocaml 4.04.0.

@aantron
Copy link

aantron commented May 10, 2017

I doubt that I helped in any way, except the most vague way possible. I am very interested in the outcome of this issue, however :)

@whitequark
Copy link
Member

@pirbo I would like to help you but I do not think I will have time to dig into that any time soon. You're on your own, sorry.

@aantron
Copy link

aantron commented May 10, 2017

FTR, Lwt has been building, when not cross-compiling, on both 4.02.3 and 4.04.0 (but probably 4.04.1 now), continuously since before 2.6.0: Travis, AppVeyor. But I'm guessing that you already know this.

@pirbo
Copy link
Collaborator Author

pirbo commented May 10, 2017

And the final answer is .... lwt is incompatible with conf-flambda-windows !
Looking at ocamlfind -toolchain windows opt -config I realised that flambda: true. I uninstalled conf-flambda-windows, recompiled my toy example and it worked!

Have you tried (not cross-)compiling lwt under windows with flambda activated?
Anyway, I don't need flambda my problem is solved, thanks for your help

@whitequark
Copy link
Member

@pirbo Ohhhh... I know what happened here. The Sys.win32 constants get inlined by ocamlc instead of being called at runtime. But the cross-compiler and the runtime differ in what they think their value is. I filed #27 to track this.

@aantron
Copy link

aantron commented May 10, 2017

Thanks @pirbo, @whitequark. I got really worried that Lwt might not be compatible with Flambda on Windows, but I hope it's just what @whitequark filed in #27. I'll watch both of these issues, in case Lwt itself turns out to need a fix.

@aantron
Copy link

aantron commented May 10, 2017

And we haven't tried compiling with Flambda on Windows, no. Perhaps we will soon, but compiling Lwt on Windows is a bit of a maintenance nightmare so far, at least in CI...

pirbo added a commit to pirbo/opam-cross-windows that referenced this issue May 10, 2017
@aantron
Copy link

aantron commented May 11, 2017

Also cc'ing the rest of the maintainers: @mfp @c-cube.

In case I suffer an untimely demise or otherwise disappear, the Lwt "organization" will still know about this :)

@c-cube
Copy link

c-cube commented May 11, 2017

Not that I have the slightest amount of competence when it comes to windows ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants