https://issues.apache.org/bugzilla/show_bug.cgi?id=52779
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 AssignedTo: bugs@httpd.apache.org ReportedBy: ma...@tols.org Classification: Unclassified Created attachment 28390 --> https://issues.apache.org/bugzilla/attachment.cgi?id=28390 crude fix for the segfaults - doesn't consider whether it opens memleaks Hi there, I mailed this to the us...@httpd.apache.org 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: ------ 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 ------ -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org For additional commands, e-mail: bugs-h...@httpd.apache.org