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
Native fiber #1878
Native fiber #1878
Conversation
@nobu I don't expect to merge this yet, but I would like to continue to work on it. |
0cd0f54
to
0044c3c
Compare
@nobu I believe this is ready for your review/testing. |
ef7efd3
to
456a0a2
Compare
I've rebased this on trunk. |
Looks like build failure on Linux. I will review. |
I am going to see if I can get 32-bit linux passing too. It seems like a very minor target, but it's probably good to support it. As long as it's similar to win32 implementation, it should be straight forward. |
fb651b9
to
2fd0495
Compare
It seems like windows build might be broken. It's selecting a coroutine implementation (amd64), but I haven't really tested it much. Looks like we might need to fix this so that it uses the existing code path.
|
67b4c2f
to
86d68b4
Compare
Here is a brief summary of native implementations now working:
I don't know how to make other Windows builds compile the right files. Other platforms use existing code path. |
d2a745f
to
99f433d
Compare
@MSP-Greg I am tracking issues here. c745c56#commitcomment-31373680 It seems odd to me that MSYS build is failing while win32/win64 build is passing. I wonder what configure is doing. |
|
A ruby-loco build I just did passed. See here. Run on ruby 2.6.0dev (2018-11-21 trunk 65895) [x64-mingw32] I have the patches from the PR added to it. EDIT: I just started another build, as failures may be intermittent. |
I've already added it to ruby-loco as a patch, as soon as the current build is done, I'll start it. |
Here is how we should be allocating stack on Windows. |
@MSP-Greg Sorry, there are some more changes, according to documentation, to correctly allocate guard page. |
Thanks. I was just about to push the first patch. That build passed test-all, but spec froze. When
I haven't done much of that, as I haven't replaced the (nice) desktop I had. I'm now on a rather light notebook. I don't even have VS installed. Re the ruby-loco builds, every build saves an artifact, so you can dl them and run tests with runner.rb. Building is a bit more involved, but not that complicated. |
It looks like everything is compiling now. |
I'm building at https://ci.appveyor.com/project/MSP-Greg/ruby-loco/builds/20448476 |
Looks like still got problems :( |
How did you get stack trace before, did you run it locally? |
Oh, I know the problem... I'm still using free on virtualalloc memory lol |
It was collected by the ruby-loco build. I hate long CI logs, so everything is saved to a 7z file.
Cool. I'd never know. I'll stop and re-start. Current build is always at |
Any backtrace you provide is super useful to me since I'm not actually working on Windows and relying on appveyor and documentation to get things working. |
On Windows, I think it's the cause of intermittent failure. Sometimes aligned, sometimes not. Linux has On a stack, the last (lowest by address) page should be marked read-only or something similar. this is called guard page. If you try to make too many function calls, eventually your stack hits this page and it causes page fault. It kill your program, instead of allowing your program to overwrite arbitrary memory (a security problem). On windows, it's the same concept, but they use |
Thanks for the explanation. The last two builds of ruby-loco passed, with the patch skipping the two tests. I can't get the test in test_enum.rb to fail locally, but the test in test_enumerable.rb fails consistently. We've got a long weekend, I may build a repo to allow one to use a pre-existing build and run test-all & test-spec (or parts thereof) a half dozen times. That might at least determine whether there is an intermittent issue. |
I tried to reproduce bug on my local windows bug but I only managed to reproduce once, I don’t know how to attach debugger to I will try test_enumerable. How do you run just that test? |
From test folder, I use:
Ran a third build, three in a row green. |
0b5448d
to
b5813f5
Compare
This is sort-of passing on Appveyor. The error in test-all is an unrelated error. But, if test-all fails, test-spec doesn't run. Thanks, Greg |
b5813f5
to
050651c
Compare
All builds passing, I merged to trunk. |
050651c
to
94ec8e0
Compare
This is an implementation of fibers using hand-optimised assembly.
There are implementations for amd64, win32, win64, arm32, arm64, and I will add i386 soon too.