lua: prevent LuaJIT from panicking.#6994
Conversation
Migration from the build recipes to foreign_cc rules resulted
in dependencies being built with different compiler flags.
Among other things, those compiler flags were added:
-ffunction-sections -fdata-sections
use of which leads to LuaJIT panicking:
PANIC: unprotected error in call to Lua API
and Envoy subsequently crashing.
Broken in envoyproxy#6168.
Fixes istio/istio#13722.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
|
/lgtm |
|
@PiotrSikora why doesn't this crash Envoy's integration tests? |
|
@mattklein123 it happens once JIT kicks in (it always panicked on the 8th request in my tests), and tries to read something that linker removed thinking it was a dead code (educated guess). |
|
Interesting. Is there any way to make one of our integration tests run a bunch of requests and crash? That would be pretty nice. |
|
Adding more details: Not sure if my observation is helping: A clean envoy build without istio proxy build didn't crash at my environment. |
|
@silentdai are you building optimized binary (i.e. using @mattklein123 it looks that integration tests already have |
|
Sorry for the late reply: I am pretty sure I build envoy use |
|
@PiotrSikora sorry for being late, how do you want to proceed with this? It would be nice to have a regression test but if it is not trivial then can you file an issue to track that? |
|
@lizan sorry for the delay. I couldn't figure out how to create a regression test for this, since the same Lua script that panics when loaded in the binary, works fine in the integration tests. I created an issue to add it, with the reproduction steps: #7116. However, the weird thing is that, without this fix, existing Lua tests are failing for me already, when built with but for some reason they are all passing in the With this fix applied, all Lua tests are passing locally: |
Migration from the build recipes to foreign_cc rules resulted
in dependencies being built with different compiler flags.
Among other things, those compiler flags were added:
-ffunction-sections -fdata-sections
use of which leads to LuaJIT panicking:
PANIC: unprotected error in call to Lua API
and Envoy subsequently crashing.
Broken in envoyproxy#6168.
Fixes istio/istio#13722.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Update istio/envoy sha to pick up envoyproxy/envoy#6994 * Pick up istio/envoy#76
* Update istio/proxy for 1.1.8 * Import two additional istio/envoy commits. envoyproxy/envoy#6994 and istio/envoy#76
cherry-pick into 1.2: lua: prevent LuaJIT from panicking. (envoyproxy#6994)
Migration from the build recipes to foreign_cc rules resulted
in dependencies being built with different compiler flags.
Among other things, those compiler flags were added:
use of which leads to LuaJIT panicking:
and Envoy subsequently crashing.
Broken in #6168.
Fixes istio/istio#13722.
Signed-off-by: Piotr Sikora piotrsikora@google.com