httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 52779] New: mod_lua segfaults
Date Mon, 27 Feb 2012 12:12:32 GMT

             Bug #: 52779
           Summary: mod_lua segfaults
           Product: Apache httpd-2
           Version: 2.4.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_lua
    Classification: Unclassified

Created attachment 28390
crude fix for the segfaults - doesn't consider whether it opens memleaks

Hi there,

I mailed this to the mailing list with subject "mod_lua
segfault in httpd-2.4.1" last friday, but this is probably a better place to
report it.

Also, I checked whether the fix for bug 49044 also fixes this issue, but it
doesn't.  Also the memset(0) that is used in the fix for that bug is now solved
by using apr_pcalloc instead of apr_palloc in the code from the 2.4.1 tarball,
so doesn't apply anymore.

What I mailed is this:

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
- 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/
  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
- 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

This happens both on FreeBSD 9.0-RELEASE as well as
linux and 3.0.20.

Thanks in advance,

Marco van Tol

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message