Project

General

Profile

Actions

Bug #1139

closed

lighty 1.5.x-svn + mod_magnet + luasockets + memcached: SIGSEGV crash

Added by Terminar over 17 years ago. Updated 11 months ago.

Status:
Obsolete
Priority:
Normal
Category:
mod_magnet
Target version:
ASK QUESTIONS IN Forums:
No

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

Memcached.lua (5.48 KB) Memcached.lua lua Memcached module Terminar, 2007-04-23 18:05
physical.lua (133 Bytes) physical.lua test magnet Terminar, 2007-04-23 18:05
lighttpd.valgrind (15.6 KB) lighttpd.valgrind Terminar, 2007-04-23 18:12
lighttpd.28633 (66.6 KB) lighttpd.28633 tx, 2007-07-20 10:57
lighttpd.trace (126 KB) lighttpd.trace strace tx, 2007-07-20 10:57
bt.txt.txt (837 Bytes) bt.txt.txt tx, 2007-07-20 11:08
bt-full.txt.txt (1.6 KB) bt-full.txt.txt tx, 2007-07-20 11:09
bt-luasocket-debug.txt.txt (1.43 KB) bt-luasocket-debug.txt.txt tx, 2007-07-20 12:17

Related issues 1 (0 open1 closed)

Is duplicate of Bug #1843: luasockets and lightys buffer_init are not prefixedWontfix2008-12-12Actions
Actions #1

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

Actions #2

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.

Actions #3

Updated by tx over 17 years ago

i have this problem too see atached valgrind and strace

Actions #4

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

Actions #5

Updated by moo over 17 years ago

reformat desc

Actions #6

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_

Actions #7

Updated by Anonymous over 16 years ago

And now ? What is the solution ?

Actions #8

Updated by stbuehler over 15 years ago

  • Status changed from New to Wontfix
  • Patch available set to No

See #1843

Actions #9

Updated by darix over 15 years ago

this needs a patch in lua or renaming our function

Actions #10

Updated by gstrauss 11 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.

Actions

Also available in: Atom