[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Problem with lua redis clients
- From: Javier Gallart <jgallartm@...>
- Date: Thu, 28 Jul 2011 11:36:02 +0200
Hello list,
I'm trying to execute a tshark embedded lua script. This script connects to a redis server and updated some keys according to the content of the captured packets. I've tested both redis-lua and lua-hiredis; both of them are failing, although for different reasons:
When the script is executed with redis-lua, I get a segmentation fault; these are the details (I first posted the problem in wireshark list, but they said it was a luasocket issue...):
This is the relevant part of the lua script code:
require("redis")
require("socket")
call_db = 0
local redis_server = "localhost"
local redis_port = '6379'
-- Connection to redis server
redis = Redis.connect(redis_server,redis_port)
redis:select(call_db)
[root@server]# tshark -i eth1 -X lua_script:test.lua
Segmentation fault
[root@server]# gdb
GNU gdb Fedora (6.8-24.fc9)
This GDB was configured as "i386-redhat-linux-gnu".
(gdb) set args -i eth1 -X lua_script:test.lua
(gdb) file tshark
Reading symbols from /usr/local/bin/tshark...done.
(gdb) run
Starting program: /usr/local/bin/tshark -i eth1 -X lua_script:test.lua
[Thread debugging using libthread_db enabled]
[New Thread 0xb7ef96c0 (LWP 27860)]
Program received signal SIGSEGV, Segmentation fault.
0x00a25c52 in timeout_markstart () from
/usr/local/lib/lua/5.1/socket/core.so
Missing separate debuginfos, use: debuginfo-install glib2.i386
glibc.i686 libpcap.i386 zlib.i386
(gdb) bt
#0 0x00a25c52 in timeout_markstart () from
/usr/local/lib/lua/5.1/socket/core.so
#1 0x00a2655a in buffer_meth_send () from
/usr/local/lib/lua/5.1/socket/core.so
#2 0x00a28193 in meth_send () from /usr/local/lib/lua/5.1/socket/core.so
#3 0x01ffea05 in luaD_precall () from /usr/local/lib/libwireshark.so.1
#4 0x02007f68 in luaV_execute () from /usr/local/lib/libwireshark.so.1
#5 0x01ffefa8 in luaD_call () from /usr/local/lib/libwireshark.so.1
#6 0x01ffc081 in f_call () from /usr/local/lib/libwireshark.so.1
#7 0x01ffe5b7 in luaD_rawrunprotected () from /usr/local/lib/libwireshark.so.1
#8 0x01ffe61f in luaD_pcall () from /usr/local/lib/libwireshark.so.1
#9 0x01ffbe9b in lua_pcall () from /usr/local/lib/libwireshark.so.1
#10 0x01ffa278 in lua_load_script (filename=0x0) at init_wslua.c:242
#11 0x01ffa8f5 in wslua_init (LS=0x0) at init_wslua.c:411
#12 0x01409e89 in epan_init (register_all_protocols_func=0x804e9dc
<register_all_protocols@plt>,
register_all_handoffs_func=0x804f10c
<register_all_protocol_handoffs@plt>, cb=0, client_data=0x0,
report_failure_fcn_p=0x80683c0 <failure_message>,report_open_failure_fcn_p=0x80689f0 <open_failure_message>,
report_read_failure_fcn_p=0x80697c0 <read_failure_message>,
report_write_failure_fcn_p=0x8069790 <write_failure_message>) at epan.c:112
#13 0x0806aa49 in main (argc=5, argv=0xbfb1c3d4) at tshark.c:940
As for the lua-hiredis module, I was able to use it for a while, but at some point it stopped loading. This has nothing to do with wiresahrk:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> hiredis = require("hiredis")
./hiredis.lua:1: loop or previous error loading module 'hiredis'
stack traceback:
[C]: in function 'require'
./hiredis.lua:1: in main chunk
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?
>
Any help will be appreciated.
Thanks in advance
Javi