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

Openresty v3.0 #46

Merged
merged 102 commits into from
Mar 19, 2024
Merged

Openresty v3.0 #46

merged 102 commits into from
Mar 19, 2024

Conversation

Brugarolas
Copy link
Owner

No description provided.

Brugarolas and others added 29 commits December 21, 2023 16:00
Specialize to the global environment
Update to latest changes in v2.1
These instructions are useful to support Intel Control-flow Enforcement Technology (CET),
when JIT code is called through idirect jump.

See `man gcc` "-fcf-protection" and https://www.felixcloutier.com/x86/endbr64
Add support for ENDBR instructions
Import OpenXRay changes
Better support for Android & iOS
Small steviegt6 patches
Specialize to the global environment
JIT recording semantics assumes FFI calls are leaf regarding the LuaJIT
VM: if the execution exited Lua world through FFI machinery it is not
re-entering Lua world again.

However, there is a way to break this assumption via FFI: one can
re-enter LuaJIT VM via Lua C API used within the particular C routine
called via FFI. As a result the following host stack mix is created:
| Lua-FFI -> C routine -> Lua-C API -> Lua VM

This sort of re-entrancy is not supported by LuaJIT tracing compiler.
@mraleph named such kind of the call stack an "FFI sandwich" in the
tarantool/tarantool#4427.

This changeset introduces the mechanism for Lua-C API callbacks similar
to the one implemented for Lua-FFI: trace recording is aborted when the
execution re-enters LuaJIT VM. If re-enter is detected while running the
particular mcode, the runtime finishes its execution with EXIT_FAILURE
code and calls panic routine prior to the exit.

Co-authored-by: Vyacheslav Egorov <[email protected]>
Co-authored-by: Sergey Ostanevich <[email protected]>
Signed-off-by: Igor Munkin <[email protected]>
@Brugarolas Brugarolas merged commit 97c02da into v3.0-openresty Mar 19, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.