MySQL Forums
Forum List  »  Router & Proxy

Be careful, some lua script lead the proxy 0.6.1 core .
Posted by: wang zone
Date: May 23, 2010 05:07AM

If there are many clients access proxy which with more than 2 backends, the proxy 0.6.1 will be cored some times, The back trace is as following :
(gdb) bt
#0 0x08054886 in proxy_resultset_field_get (L=0x8146580) at network-mysqld-proxy.c:1744
#1 0x0805d4b5 in luaD_precall ()
#2 0x0805d6a9 in luaD_call ()
#3 0x08064d3a in callTMres ()
#4 0x08064ed2 in luaV_gettable ()
#5 0x080659e1 in luaV_execute ()
#6 0x0805d6eb in luaD_call ()
#7 0x0805b1c9 in f_call ()
#8 0x0805cd0e in luaD_rawrunprotected ()
#9 0x0805d9a0 in luaD_pcall ()
#10 0x0805b218 in lua_pcall ()
#11 0x08055403 in proxy_lua_read_query_result (con=0x814e8b0) at network-mysqld-proxy.c:2098
#12 0x08056da8 in proxy_read_query_result (srv=0x8080050, con=0x814e8b0) at network-mysqld-proxy.c:3563
#13 0x0804f27a in plugin_call (srv=0x8080050, con=0x814e8b0, state=16) at network-mysqld.c:1008
#14 0x0804fe34 in network_mysqld_con_handle (event_fd=17, events=2, user_data=0x814e8b0) at network-mysqld.c:1551
#15 0xb7fc565a in event_process_active (base=0x8098a80) at event.c:366
#16 0xb7fc59c2 in event_base_loop (base=0x8098a80, flags=0) at event.c:508
#17 0xb7fc571e in event_base_dispatch (event_base=0x8098a80) at event.c:386
#18 0x08050366 in network_mysqld_thread (_srv=0x8080050) at network-mysqld.c:1811
#19 0x0804e46f in main (argc=1, argv=0xbf971884) at mysql-proxy.c:615

the error lua script is as following:
local temp_count = 1
local fields = inj.resultset.fields

if not fields then

while fields[temp_count] do
local field = fields[temp_count]
temp_count = temp_count + 1

we should to change script as following, it will avoid this bug:

local fields = inj.resultset.fields

if not fields then

local field_count = #fields
for n=1, field_count do

I guess the EOF of field packect is not well processed by proxy 0.6.1. I haven't test on other proxy versions.

Options: ReplyQuote

Written By
Be careful, some lua script lead the proxy 0.6.1 core .
May 23, 2010 05:07AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.