Bug #1139
closedlighty 1.5.x-svn + mod_magnet + luasockets + memcached: SIGSEGV crash
Description
Lighty doesn't like that combination. It seems that on socket connect, lighty crashes.
Here is a small strace.log
17:09:15.183785 rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0 17:09:15.184030 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 12 17:09:15.184092 fcntl64(12, F_GETFL) = 0x2 (flags O_RDWR) 17:09:15.184135 fcntl64(12, F_SETFL, O_RDWR|O_NONBLOCK) = 0 17:09:15.184182 gettimeofday({1177340955, 184201}, NULL) = 0 17:09:15.184233 connect(12, {sa_family=AF_INET, sin_port=htons(11211), sin_addr=inet_addr("XXXXXXXXXXXXXXXXX")}, 16) = -1 EINPROGR ESS (Operation now in progress) 17:09:15.184337 select(13, [12], [12], NULL, NULL) = 1 (out [12]) 17:09:15.199262 gettimeofday({1177340955, 199293}, NULL) = 0 17:09:15.199319 --- SIGSEGV (Segmentation fault) @ 0 (0) --- 17:09:15.199357 +++ killed by SIGSEGV +++
Files
Updated by Terminar over 17 years ago
I'm trying to find the exact reason for the sigsegv, it is not the connect, but the first call to functions like add, set, get. If i have more details i'll add them here
Updated by Terminar over 17 years ago
Ok, it doesn't seem to be in the Connect, crash happenes when socket:send is used,,, I have attached the Memcache module the testfile i used as "magnet" and the valgrind output. You need to install luasocket to use this.
Updated by tx over 17 years ago
i have this problem too see atached valgrind and strace
Updated by tx over 17 years ago
in addition with some peoples on irc we made additional tests with
stand alone lua and luasocket
works like charm
Updated by Anonymous almost 17 years ago
That is obviously not a lighttpd bug. In fact memcache.lua uses luasockets. Luasockets has a buffer_init function that is called when sending data. Unfortunatly lighty also has a buffer_init method which overwrites luasocket's buffer_int method. Therefore the buffer get's not initialized correct and when the process tries to access buf->tm it fails with a null pointer (sigsegv).
In my opinion that is not a lighttpd bug, but in fact is a result of bad naming in luasockets as a library should at least prefix it's exported methods.
I suggest to close this ticket.
-- sn_
Updated by stbuehler over 15 years ago
- Status changed from New to Wontfix
- Patch available set to No
See #1843
Updated by darix over 15 years ago
this needs a patch in lua or renaming our function
Updated by gstrauss 12 months ago
- Status changed from Wontfix to Obsolete
- ASK QUESTIONS IN Forums set to No
lighttpd 1.5.x branch has been abandoned.
lighttpd 1.4.x branch is now far more advanced and continues to be maintained.
For this issue, a long time ago, luasockets was patched upstream to export a smaller set of symbols, namely only its intended API functions.
Also available in: Atom