laverdet / node-fibers

Fiber/coroutine support for v8 and node.
MIT License
3.56k stars 224 forks source link

Settinag fiber playground as real stack pages on Linux and FreeBSD too. #415

Closed devnexen closed 5 years ago

laverdet commented 5 years ago

I see you're also adding MAP_GROWSDOWN, is that intended? There is a lot of FUD online about this flag but I think I've gotten to the bottom of it. I think this is used for a process's entry stack to allow it to grow downward as long as memory is available. In the case of a coroutine or thread this isn't what we want.

Also I've never really scrutinized this code but I don't see any reason for that PROT_EXEC logic, do you? I can't think of any reason why we would want the stack to be executable.

devnexen commented 5 years ago

Yes but my main concern is FreeBSD rather than Linux so that is fine :-) Otherwise I did not question the workflow and got interested by fiber app only today but you are right after second thought, there is no need (and that will please OpenBSD/HardenedBSD folks :-)) But normally a page needs really to be a stack but I understand the reasoning for Linux...

laverdet commented 5 years ago

Thanks!