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

fixed segfault on windows for nginx-1.17.x ~ nginx-1.23.2 #248

Merged
merged 2 commits into from Nov 19, 2022

Conversation

chobits
Copy link
Owner

@chobits chobits commented Nov 19, 2022

try to fix #68

skip ngx_http_process_request_uri for CONNECT request

@chobits chobits changed the title fixed segfault on windows for nginx-1.21.1+ fixed segfault on windows for nginx-1.17.x ~ nginx-1.23.2 Nov 19, 2022
@chobits chobits merged commit b998d16 into master Nov 19, 2022
@chobits
Copy link
Owner Author

chobits commented Nov 19, 2022

Note that only nginx-1.17.x ~ nginx-1.23.2 have been fixed. Their corresponding patch is proxy_connect_rewrite_1018.patch and proxy_connect_rewrite_102101.patch.

@chobits
Copy link
Owner Author

chobits commented Nov 19, 2022

segfault details:

enable NGX_WIN32 macro to trigger sigfault in gdb:

Program received signal SIGSEGV, Segmentation fault.                       
 ngx_http_process_request_uri (r=r@entry=0x56203f79da80)                         at src/http/ngx_http_request.c:1346                                     1346            if (*p == ' ') {                                            (gdb) bt                                                                    #0  ngx_http_process_request_uri (r=r@entry=0x56203f79da80)
    at src/http/ngx_http_request.c:1346
#1  0x000056203d7d616f in ngx_http_process_request_line (
    rev=rev@entry=0x56203f7e2a40) at src/http/ngx_http_request.c:1103
#2  0x000056203d7d6664 in ngx_http_wait_request_handler (
    rev=0x56203f7e2a40) at src/http/ngx_http_request.c:501
#3  0x000056203d7b9b8d in ngx_epoll_process_events (cycle=0x56203f7a2c60,
    timer=<optimized out>, flags=<optimized out>)
    at src/event/modules/ngx_epoll_module.c:901

(gdb) p p                                                                   
$17 = (u_char *) 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>
(gdb) f 0
#0  ngx_http_process_request_uri (r=r@entry=0x56203f79da80)
    at src/http/ngx_http_request.c:1346
1346            if (*p == ' ') {
(gdb) l
1341
1342        p = r->uri.data + r->uri.len - 1;
1343
1344        while (p > r->uri.data) {
1345
1346            if (*p == ' ') {

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.

[TODO] windows support // using on Windows crash
1 participant