Kong / Kong/ngx_wasm_module

Segmentation fault when instance traps after sending local response

Open
#696 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
142
Forks
16
PR merge metrics
No merged PRs in 30d

Description

I believe there is a bug in the code where when you send a local response which overrides the action, and trap after it nginx will then segfault when trying to cleanup the request and the 503 response is not sent.

Probably issue here, I believe trapping should have higher priority then action
https://github.com/Kong/ngx_wasm_module/blob/main/src/common/proxy_wasm/ngx_proxy_wasm.c#L864-L890

Contributor guide

Open the contributing guide

Research direction

Start in src/common/proxy_wasm/ngx_proxy_wasm.c at lines 864-890 and trace cleanup after a local response overrides the action, followed by a trap. Reproduce the request flow described in the issue and verify that cleanup no longer segfaults and that the 503 response is sent.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, nginx, wasm
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.