You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tianyin Xu <ti...@cs.ucsd.edu> on 2012/03/07 03:15:11 UTC

Re: [users@httpd] mod_lua segfault in httpd-2.4.1

Hi, Marco,

I tried to replay the bug you found. But I didn't see any error message. It
works pretty well...
I'm sure that I followed all the steps listed in your previous email.

Could you provide more information?

btw, My platform is Ubuntu 10.04.

-- Tianyin




On Fri, Feb 24, 2012 at 4:19 AM, Marco van Tol <ma...@tols.org> wrote:

> Goodday,
>
> I have tried to make a setup using mod_lua using version 2.4.1 of the
> apache httpd server and noticed that requests involving lua render a
> segfault message in the error log like this one:
>
> [Fri Feb 24 11:42:41.410706 2012] [core:notice] [pid 64609:tid
> 34397516800] AH00052: child pid 64612 exit signal Segmentation fault (11)
>
>
> This is very easy to replicate by following these steps:
> - download the httpd-2.4.1.tar.gz from
>  http://httpd.apache.org/download.cgi#apache24
> - create a directory, in my case I created /apache24 and changed
>  ownership to myself
> - extract the tarball
> - execute:
>  ./configure --prefix /apache24 --enable-lua
> - run 'make' and 'make install'
> - modify /apache24/conf/httpd.conf and make the following changes:
>  Listen 8080 # (Instead of 80)
>  LoadModule lua_module modules/mod_lua.so
>  LuaHookAccessChecker /apache24/lua/luatest.lua access_hook
> - Create /apache24/lua/luatest.lua with the following contents  (Other
>  contents render a segfault as well)
>  -----
>  require 'apache2'
>
>  function access_hook(r)
>    r:puts("---- access_hook\n")
>    return apache2.DECLINE
>  end
>  -----
> - start the server using a simple '/apache24/bin/httpd'
> - Keep a tail open on the error log
> - Do something like: curl -D - -s 'http://localhost:8080/'
> - You will see expected output, i.e. "---- access_hook" and the "It
>  works!" text.
> - The error log will log a segfault from the child that handled the
>  request, like the one I paste above.
>
> This can be fixed by the attached patch, which is really crude and
> doesn't consider whether it opens up a memory leak or not.
>
> Is there something I'm doing wrong, or is this a bug in the 2.4.1
> mod_lua?
>
> This happens both on FreeBSD 9.0-RELEASE as well as
> linux 2.6.27.59 and 3.0.20.
>
> Thanks in advance,
>
> Marco van Tol
>
> --
> Marco van Tol
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>



-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] mod_lua segfault in httpd-2.4.1

Posted by Marco van Tol <ma...@tols.org>.
On 7 mrt. 2012, at 09:37, Tianyin Xu wrote:
> OK, cool!
> 
> Thanks a lot!
> 
> -- Tianyin
> 
> On Wed, Mar 7, 2012 at 12:25 AM, Marco van Tol <ma...@tols.org> wrote:
> On Tue, Mar 06, 2012 at 06:15:11PM -0800, Tianyin Xu wrote:
> > Hi, Marco,
> >
> > I tried to replay the bug you found. But I didn't see any error message. It
> > works pretty well...
> > I'm sure that I followed all the steps listed in your previous email.
> >
> > Could you provide more information?
> >
> > btw, My platform is Ubuntu 10.04.
> 
> Ah okay, thank you for trying to replicate this.  I will try to get more
> information, which might involve me installing ubuntu some place and see
> what happens.
> 
> It may be in the apr area, which is also where some of the functions are
> in the stacktrace that results from the segfault.  I'll let you know.

Hey, sorry for the long silence from my side of things.

I haven't tried much else with this yet due to too many other things to do.

What I can add for information is the following:

- My initial "how to replicate" also works for apache-2.4.2
- What I forgot to mention in the first place is that I also download the httpd-2.4.2-deps.tar.gz tarball, and extract that into the extracted httpd-2.4.2.tar.gz dir.  That causes it to use the apr from the -deps tarball, which might explain what I see.  Not sure.

That's all for now, at some point I will try to have more information.

Thanks,

-- 
Marco van Tol


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_lua segfault in httpd-2.4.1

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
OK, cool!

Thanks a lot!

-- Tianyin

On Wed, Mar 7, 2012 at 12:25 AM, Marco van Tol <ma...@tols.org> wrote:

> On Tue, Mar 06, 2012 at 06:15:11PM -0800, Tianyin Xu wrote:
> > Hi, Marco,
> >
> > I tried to replay the bug you found. But I didn't see any error message.
> It
> > works pretty well...
> > I'm sure that I followed all the steps listed in your previous email.
> >
> > Could you provide more information?
> >
> > btw, My platform is Ubuntu 10.04.
>
> Ah okay, thank you for trying to replicate this.  I will try to get more
> information, which might involve me installing ubuntu some place and see
> what happens.
>
> It may be in the apr area, which is also where some of the functions are
> in the stacktrace that results from the segfault.  I'll let you know.
>
> Thanks,
>
> --
> ...the only way to maintain a moderate sum of happiness in this life,
> is not to worry about the future or regret the past too much.
> - Mel Gibson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] mod_lua segfault in httpd-2.4.1

Posted by Marco van Tol <ma...@tols.org>.
On Tue, Mar 06, 2012 at 06:15:11PM -0800, Tianyin Xu wrote:
> Hi, Marco,
> 
> I tried to replay the bug you found. But I didn't see any error message. It
> works pretty well...
> I'm sure that I followed all the steps listed in your previous email.
> 
> Could you provide more information?
> 
> btw, My platform is Ubuntu 10.04. 

Ah okay, thank you for trying to replicate this.  I will try to get more
information, which might involve me installing ubuntu some place and see
what happens.

It may be in the apr area, which is also where some of the functions are
in the stacktrace that results from the segfault.  I'll let you know.

Thanks,

-- 
...the only way to maintain a moderate sum of happiness in this life,
is not to worry about the future or regret the past too much.
- Mel Gibson 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org