# Segmentation fault in drizzle-nginx-module 0.1.0

**URL:** <https://www.ruby-forum.com/t/segmentation-fault-in-drizzle-nginx-module-0-1-0/211905>\
**Category:** NGINX\
**Created:** [September 16, 2011, 4:35pm UTC](https://www.ruby-forum.com/t/segmentation-fault-in-drizzle-nginx-module-0-1-0/211905 "2011-09-16T16:35:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 16, 2011, 4:35pm UTC](https://www.ruby-forum.com/t/segmentation-fault-in-drizzle-nginx-module-0-1-0/211905/1 "2011-09-16T16:35:34Z")

</div>

Env:  
CentOS 5.6  
nginx 0.8.54  
rds-json-nginx-module-0.11  
mysql 5.0  
drizzle7-2011.08.25

nginx.conf

```
    location =/mysql_status {
        drizzle_status;
    }

    #Common SQL Query point
    location =/mysql_query {
      #internal;
        set_by_lua $sql "return ngx.unescape_uri(ngx.var.arg_sql)";
        drizzle_query $sql;
        drizzle_pass mysqls;
        drizzle_module_header off;
        rds_json on;
    }

```

===========================================================================================================

request path : localhost/mysql\_query?sql=SELECT%201

print out by gdb:

Program terminated with signal 11, Segmentation fault.  
#0 0x080c2551 in ngx\_http\_upstream\_dbd\_connect (r=0x8badcd0,  
u=0x8bae2d4)  
at …/drizzle-nginx-module/src/ngx\_http\_drizzle\_util.c:604  
604 r-\>connection-\>log-\>action = “connecting to upstream”;  
(gdb) bt  
#0 0x080c2551 in ngx\_http\_upstream\_dbd\_connect (r=0x8badcd0,  
u=0x8bae2d4)  
at …/drizzle-nginx-module/src/ngx\_http\_drizzle\_util.c:604  
#1 0x080c2539 in ngx\_http\_upstream\_dbd\_init\_request (r=0x8badcd0) at  
…/drizzle-nginx-module/src/ngx\_http\_drizzle\_util.c:593  
#2 0x080c2066 in ngx\_http\_upstream\_dbd\_init (r=0x8badcd0) at  
…/drizzle-nginx-module/src/ngx\_http\_drizzle\_util.c:390  
#3 0x080be58e in ngx\_http\_drizzle\_handler (r=0x8badcd0) at  
…/drizzle-nginx-module/src/ngx\_http\_drizzle\_handler.c:164  
#4 0x0807d610 in ngx\_http\_core\_content\_phase (r=0x8badcd0,  
ph=0x8bbb6d8) at  
src/http/ngx\_http\_core\_module.c:1350  
#5 0x0807c8a9 in ngx\_http\_core\_run\_phases (r=0x8badcd0) at  
src/http/ngx\_http\_core\_module.c:852  
#6 0x0807c844 in ngx\_http\_handler (r=0x8badcd0) at  
src/http/ngx\_http\_core\_module.c:835  
#7 0x08086a03 in ngx\_http\_run\_posted\_requests (c=0xb6a900b8) at  
src/http/ngx\_http\_request.c:1828  
#8 0x080866b1 in ngx\_http\_process\_request (r=0x8ba6368) at  
src/http/ngx\_http\_request.c:1643  
#9 0x080855b9 in ngx\_http\_process\_request\_headers (rev=0xb657b070) at  
src/http/ngx\_http\_request.c:1084  
#10 0x08084f4e in ngx\_http\_process\_request\_line (rev=0xb657b070) at  
src/http/ngx\_http\_request.c:889  
#11 0x0808493b in ngx\_http\_init\_request (rev=0xb657b070) at  
src/http/ngx\_http\_request.c:514  
#12 0x0806f59f in ngx\_event\_process\_posted (cycle=0x8ba6e98,  
posted=0x80df6cc) at src/event/ngx\_event\_posted.c:39  
#13 0x0806ddf3 in ngx\_process\_events\_and\_timers (cycle=0x8ba6e98) at  
src/event/ngx\_event.c:272  
#14 0x08076c50 in ngx\_worker\_process\_cycle (cycle=0x8ba6e98, data=0x0)  
at  
src/os/unix/ngx\_process\_cycle.c:795  
#15 0x080746a2 in ngx\_spawn\_process (cycle=0x8ba6e98, proc=0x8076b3a  
\<ngx\_worker\_process\_cycle\>, data=0x0, name=0x80cdc44 “worker process”,  
respawn=-3)  
at src/os/unix/ngx\_process.c:196  
#16 0x080761b9 in ngx\_start\_worker\_processes (cycle=0x8ba6e98, n=2,  
type=-3)  
at src/os/unix/ngx\_process\_cycle.c:355  
#17 0x08075ac2 in ngx\_master\_process\_cycle (cycle=0x8ba6e98) at  
src/os/unix/ngx\_process\_cycle.c:136  
#18 0x08053faf in main (argc=1, argv=0xbfe971b4) at src/core/nginx.c:401

============================================================================================================

request path : /mysql\_status

===========================================================================================================  
#0 0x080bef9b in ngx\_http\_drizzle\_status\_handler (r=0x8ba6368) at  
…/drizzle-nginx-module/src/ngx\_http\_drizzle\_handler.c:604  
604 ngx\_log\_error(NGX\_LOG\_ALERT, r-\>connection-\>log, 0,  
(gdb) bt  
#0 0x080bef9b in ngx\_http\_drizzle\_status\_handler (r=0x8ba6368) at  
…/drizzle-nginx-module/src/ngx\_http\_drizzle\_handler.c:604  
#1 0x0807d610 in ngx\_http\_core\_content\_phase (r=0x8ba6368,  
ph=0x8bbb6d8) at  
src/http/ngx\_http\_core\_module.c:1350  
#2 0x0807c8a9 in ngx\_http\_core\_run\_phases (r=0x8ba6368) at  
src/http/ngx\_http\_core\_module.c:852  
#3 0x0807c844 in ngx\_http\_handler (r=0x8ba6368) at  
src/http/ngx\_http\_core\_module.c:835  
#4 0x080866a6 in ngx\_http\_process\_request (r=0x8ba6368) at  
src/http/ngx\_http\_request.c:1641  
#5 0x080855b9 in ngx\_http\_process\_request\_headers (rev=0xb657b070) at  
src/http/ngx\_http\_request.c:1084  
#6 0x08084f4e in ngx\_http\_process\_request\_line (rev=0xb657b070) at  
src/http/ngx\_http\_request.c:889  
#7 0x0808493b in ngx\_http\_init\_request (rev=0xb657b070) at  
src/http/ngx\_http\_request.c:514  
#8 0x0806f59f in ngx\_event\_process\_posted (cycle=0x8ba6e98,  
posted=0x80df6cc) at src/event/ngx\_event\_posted.c:39  
#9 0x0806ddf3 in ngx\_process\_events\_and\_timers (cycle=0x8ba6e98) at  
src/event/ngx\_event.c:272  
#10 0x08076c50 in ngx\_worker\_process\_cycle (cycle=0x8ba6e98, data=0x0)  
at  
src/os/unix/ngx\_process\_cycle.c:795  
#11 0x080746a2 in ngx\_spawn\_process (cycle=0x8ba6e98, proc=0x8076b3a  
\<ngx\_worker\_process\_cycle\>, data=0x0, name=0x80cdc44 “worker process”,  
respawn=-3)  
at src/os/unix/ngx\_process.c:196  
#12 0x080761b9 in ngx\_start\_worker\_processes (cycle=0x8ba6e98, n=2,  
type=-3)  
at src/os/unix/ngx\_process\_cycle.c:355  
#13 0x08075ac2 in ngx\_master\_process\_cycle (cycle=0x8ba6e98) at  
src/os/unix/ngx\_process\_cycle.c:136  
#14 0x08053faf in main (argc=1, argv=0xbfe971b4) at src/core/nginx.c:401

===========================================================================================================  
Thank any help !!!

---

<div class="post-metadata">

**Author:** ![Wendal\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e19b73/32.png) [@Wendal\_C](https://www.ruby-forum.com/u/Wendal_C)\
**Post date:** [September 16, 2011, 6:00pm UTC](https://www.ruby-forum.com/t/segmentation-fault-in-drizzle-nginx-module-0-1-0/211905/2 "2011-09-16T18:00:54Z")

</div>

switch to:

ngx\_openresty-1.0.5.1 + drizzle7-2011.08.25

work find.

2011/9/16 Wendal C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Wendal\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e19b73/32.png) [@Wendal\_C](https://www.ruby-forum.com/u/Wendal_C)\
**Post date:** [September 17, 2011, 6:43am UTC](https://www.ruby-forum.com/t/segmentation-fault-in-drizzle-nginx-module-0-1-0/211905/3 "2011-09-17T06:43:43Z")

</div>

On Fri, Sep 16, 2011 at 10:34 PM, Wendal C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Program terminated with signal 11, Segmentation fault.  
> #0 0x080c2551 in ngx\_http\_upstream\_dbd\_connect (r=0x8badcd0, u=0x8bae2d4)  
> at ../drizzle-nginx-module/src/ngx\_http\_drizzle\_util.c:604  
> 604 r-\>connection-\>log-\>action = “connecting to upstream”;  
> (gdb) bt

This was a known issue in ngx\_drizzle v0.1.0 and earlier on 32-bit  
systems and has already been fixed in ngx\_drizzle v0.1.1rc3. I’ll  
release ngx\_drizzle v0.1.1 soon 🙂

Regards,  
-agentzh

---

<div class="post-metadata">

**Author:** ![Wendal\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e19b73/32.png) [@Wendal\_C](https://www.ruby-forum.com/u/Wendal_C)\
**Post date:** [September 17, 2011, 6:45am UTC](https://www.ruby-forum.com/t/segmentation-fault-in-drizzle-nginx-module-0-1-0/211905/4 "2011-09-17T06:45:34Z")

</div>

On Sat, Sep 17, 2011 at 12:00 AM, Wendal C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> switch to:
> 
> ngx\_openresty-1.0.5.1 + drizzle7-2011.08.25
> 
> work find.

Cool 🙂

The ngx\_openresty 1.0.5.1 release bundles ngx\_drizzle 0.1.1rc4, which  
already contains the fix for 32-bit systems. See

> **[OpenResty® - High-Concurrency Web Platform Built on Nginx + LuaJIT](https://openresty.org/en/)**
>
> OpenResty integrates an enhanced Nginx core, LuaJIT and quality Lua libraries so you can script Nginx in Lua and build high-performance web apps that handle massive concurrency.

Regards,  
-agentzh
