lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Sep 01, 2013 at 12:56:15PM +0300, Chris Datfung wrote:
> On Fri, Aug 30, 2013 at 8:24 PM, William Ahern
> <william@25thandclement.com>wrote:
> 
> > On Fri, Aug 30, 2013 at 11:54:53AM +0300, Chris Datfung wrote:
> > > I have a lua script embedded within another program. The script uses
> > > socket.http from the lua-socket CentOS package installed via yum. When I
> > > run my program with the lua script enabled the program dies with a
> > > segfault. I created a backtrace and saw the following:
> > >
> > > #5  0x00397945 in luaopen_socket_core () from
> > > /usr/lib/lua/5.1/socket/core.so
> > > No symbol table info available.
> > > #6  0x003d7d3a in ?? () from /usr/lib/liblua-5.1.so
> > > No symbol table info available.
> > > ...
> > >
<snip> 
> I uploaded the full backtrace log to:
> http://pastebin.com/sXpFH2jy

 #0  0x0095b8c6 in __strcmp_sse4_2 () from /lib/libc.so.6
 No symbol table info available.
 #1  0x00ab6e29 in _nss_files_getservbyname_r () from /lib/libnss_files.so.2
 No symbol table info available.
 #2  0x0092e6fc in getservbyname_r@@GLIBC_2.1.2 () from /lib/libc.so.6
 No symbol table info available.
 #3  0x0092e556 in getservbyname () from /lib/libc.so.6
 No symbol table info available.
 #4  0x011e8173 in tcp_open (host=0xb43c918 "\200\313C\v\ba",
 # service=0xfffffffd <Address 0xfffffffd out of bounds>, port=62352) at
 # tcp_unix.c:166

A little Googling suggests that _this_ tcp_open call comes from c-client,
the UW-IMAP library. Perhaps the issue is as kamicc olo suggested.

Try not linking in c-client into your Apache process (perhaps coming from
PHP?), or edit luasocket.c to keep its tcp_open definition static. You'll
probably have to source include tcp.c into luasocket.c. And you might want
to fix some other routines.

I'm surprised this happens as Lua by default loads modules with RTLD_LOCAL.
But kamicc olo attests to it, and it looks like it's happening to you,
so....