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

crash #29

Open
mu326668629 opened this issue Jul 9, 2016 · 7 comments
Open

crash #29

mu326668629 opened this issue Jul 9, 2016 · 7 comments

Comments

@mu326668629
Copy link

mu326668629 commented Jul 9, 2016

ngx_http_drizzle_create_loc_conf(ngx_conf_t *cf){
conf->complex_target = NGX_CONF_UNSET_PTR;//0xffffffffffffffff
}

ngx_int_t
ngx_http_drizzle_handler(ngx_http_request_t r){
if (dlcf->complex_target) {//0xffffffffffffffff
/
variables used in the drizzle_pass directive */
if (ngx_http_complex_value(r, dlcf->complex_target, &target)
!= NGX_OK) //cash here..
{
dd("failed to compile");
return NGX_ERROR;
}
}

@agentzh
Copy link
Member

agentzh commented Jul 9, 2016

@mu326668629 Will you provide a sample nginx.conf snippet that can trigger this? Thanks!

@agentzh
Copy link
Member

agentzh commented Jul 9, 2016

@mu326668629 I don't see how you can end up getting ngx_http_drizzle_handler called without configuring the drizzle_pass directive which always initializes dlcf->complex_target properly.

@mu326668629
Copy link
Author

mu326668629 commented Jul 10, 2016

location =/modify {
set $sql "update testtb set";
if ($arg_status ~ "\d+") {
set $sql= "$sql status=$srg_status";
}
drizzle_query $sql;
drizzle_pass backend;
.......
}

127.0.0.1/modify?status=3

@agentzh
Copy link
Member

agentzh commented Jul 10, 2016

@mu326668629 Your nginx.conf snippet contains syntax error which won't even load. Will you provide a snippet that you have actually tested on your side? Thanks!

@agentzh
Copy link
Member

agentzh commented Jul 10, 2016

@mu326668629 Also, BTW, please use the markdown syntax for code snippets.

@agentzh
Copy link
Member

agentzh commented Jul 10, 2016

@mu326668629 From what you've provided, I can see the problem is the use of the if directive in your conf. Basically ngx_drizzle does not support the if directive yet (directive inheritance won't work). It's still a TODO. You can try using other alternatives to achieve the same effect (like with the ngx_lua module's access_by_lua* directive, for example).

Also, BTW, "if is evil": https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ Better avoid it than sorry.

@xiaoyuwz1234
Copy link

I also find this issue when using 'if' in the conf file.
Thanks!

@agentzh agentzh changed the title cash crash Aug 10, 2016
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

No branches or pull requests

3 participants