Bug 49044

Summary: mod_lua causes segfault on some requests.
Product: Apache httpd-2 Reporter: Sean Conner <sean>
Component: Other ModulesAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: CLOSED FIXED    
Severity: normal Keywords: FixedInTrunk
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: Possible patch for bug 49044

Description Sean Conner 2010-04-04 05:07:23 UTC
Using Apache 2.3-HEAD and mod_lua enabled, with the following virtual server configuration:

NameVirtualHost [fc00::1:3]:80
<VirtualHost [fc00::1:3]:80>
        ServerName      lua.roswell.area51
        ServerAdmin     sean@conman.org
        DocumentRoot    /home/spc/web/lua/htdocs
        CustomLog       logs/lua.roswell.area51 combined
        ErrorLog        syslog:daemon
        LuaRoot         /home/spc/web/lua   
        AddHandler      lua-script      .lua
        LuaMapHandler   /basic          /home/spc/web/lua/htdocs/test.lua
        LuaMapHandler   /filter/simple  /home/spc/web/lua/htdocs/filters.lua handle_simple
        LuaMapHandler   ^/(\w+)_(\w+)$  /home/spc/web/lua/htdocs/$1.lua handle_$2
        LuaHookTranslateName    htdocs/hooks.lua translate_name
        LuaHookTranslateName    htdocs/hooks.lua translate_name2
        LuaHookFixups           htdocs/hooks.lua fixups_test
        LuaPackagePath          lib/?.lua
        LuaCodeCache            stat
        LogLevel                debug
        <Directory      /home/spc/web/lua>
                Require         all granted
        </Directory>
        <Directory      /home/spc/web/lua/htdocs>
                Options         All
                AllowOverride   None
                Require         all granted
        </Directory>
</VirtualHost>

Requesting the URL "http://lua.roswell.area51/test_serverversion" results in the following line being logged in error_log:

[Sun Apr 04 00:52:10 2010] [notice] child pid 9065 exit signal Segmentation fault (11)

Not all requests fail though---"http://lua.roswell.area51/basic" does work.
Comment 1 Sean Conner 2010-04-04 05:10:28 UTC
Created attachment 25227 [details]
Possible patch for bug 49044
Comment 2 Sean Conner 2010-04-04 07:12:30 UTC
More details:  the ap_lua_vm_spec objects stored in cfg->mapped_handlers->elts (see lua_alias_munger() in mod_lua.c) weren't properly initialized and were handing off bogus values to the rest of the system.  The supplied patch ensures that the ap_lua_vm_spec objects stored in the cfg->mapped_handlers have known values and won't blow up the system.
Comment 3 Dan Poirier 2010-05-04 10:37:31 UTC
I think I fixed this a few days ago, sorry hadn't noticed the bug report until now.  Can you try and see if you still hit the problem?
Comment 4 Sean Conner 2010-05-04 17:23:22 UTC
(In reply to comment #3)
> I think I fixed this a few days ago, sorry hadn't noticed the bug report until
> now.  Can you try and see if you still hit the problem?

Where can I grab the latest sources?  On the Apache download page I only see 2.3.5-alpha (from January) available for downloading (which is what I currently have).
Comment 5 Dan Poirier 2010-05-05 07:33:39 UTC
You can extract from subversion per
http://httpd.apache.org/dev/devnotes.html

or grab a snapshot at
http://cvs.apache.org/snapshots/httpd/
Comment 6 Sean Conner 2010-05-05 17:24:08 UTC
Grabbed the latest version from SVN.  It works.  Thanks.
Comment 7 Dan Poirier 2010-05-06 08:41:15 UTC
Thanks, closing this bug.