You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2016/05/13 12:46:38 UTC

[Bug 59542] New: mod_http2 somehow breaks some mod_lua processing

https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

            Bug ID: 59542
           Summary: mod_http2 somehow breaks some mod_lua processing
           Product: Apache httpd-2
           Version: 2.4.20
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_http2
          Assignee: bugs@httpd.apache.org
          Reporter: adrian.sandu@asandu.eu

Created attachment 33843
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33843&action=edit
logs

Using gentoo, I got the latest (2.4.20) apache, with latest mod_lua ( compiled
separately ) and mod_http2 ( compiled with apache ).

I got the following 10_mod_lua.conf
```
<IfDefine LUA>
LoadModule lua_module         modules/mod_lua.so
AddHandler lua-script .lua
LogLevel mod_lua.c:debug
LuaScope thread
LuaCodeCache stat
LuaRoot /etc/apache2/lua_scripts/
LuaHookAccessChecker authcheck_hook.lua authcheck_hook
</IfDefine>
```

41_mod_http2.conf
```
<IfDefine SSL>
  <IfModule http2_module>
    LogLevel http2:debug
    Protocols h2 http/1.1
  </IfModule>
</IfDefine>
```

and the authcheck_hook.lua script
```
processhostnames = { 'd3xbucharest.go.ro', '192.168.1.95', 'd3xt3r01.tk' }

function authcheck_hook(r)
        if r.uri == "/favicon.ico" then return apache2.DECLINED end

        processhostname = false
        for key,value in pairs(processhostnames) do
                if r.hostname == value then
                        processhostname = true
                        break
                end
        end
        if not processhostname then
                return apache2.DECLINED
        end

        return apache2.OK
end
```

Disabling either mod_lua or mod_http2 works.

I've created a test page like this:
index.php
```
IT WORKS
<?php
if(isset($_GET['frame'])){
        echo "FRAME ".$_GET['frame'];
        die();
}
for($i=0;$i<30;$i++){
        echo '<iframe src="index.php?frame='.$i.'"></iframe>';
}
```
Nothing special, just some frames with text. The result is that some frames
load, some show an internal error .. some crash completely. Not always in the
same order or on the same frames.

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

--- Comment #5 from Adrian Sandu <ad...@asandu.eu> ---
*** Bug 59370 has been marked as a duplicate of this bug. ***

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

--- Comment #3 from Eric Covener <co...@gmail.com> ---
(In reply to Adrian Sandu from comment #2)
> @eric I have no idea what you're sayin' ! :) I could try what ?

Your conf has:

  LuaScope thread

I suspect it might be broken with h2, but the other options would not be. e.g.
"LuaScope server"

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

--- Comment #2 from Adrian Sandu <ad...@asandu.eu> ---
@eric I have no idea what you're sayin' ! :) I could try what ?

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

Adrian Sandu <ad...@asandu.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adrian.sandu@asandu.eu

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

--- Comment #6 from Eric Covener <co...@gmail.com> ---
I was able to generate my own errors with a dummy LuaTranslateName and
"LuaScope thread". This seemed to do the trick, but I can't tell for sure if
tasks might jump h2 threads over time.

Index: modules/http2/h2_worker.c
===================================================================
--- modules/http2/h2_worker.c   (revision 1743942)
+++ modules/http2/h2_worker.c   (working copy)
@@ -42,7 +42,8 @@
         /* Get a h2_task from the main workers queue. */
         worker->get_next(worker, worker->ctx, &task, &sticky);
         while (task) {
-        
+            task->c->current_thread = thread; 
+
             h2_task_do(task);
             /* report the task done and maybe get another one from the same
              * mplx (= master connection), if we can be sticky.

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

--- Comment #4 from Adrian Sandu <ad...@asandu.eu> ---
@eric .. yep, works ! Thanks.

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

--- Comment #7 from Stefan Eissing <st...@eissing.org> ---
Added slightly modified to trunk in r1744203. Can you verify if this fixes the
problem for you? Thanks!

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

Adrian Sandu <ad...@asandu.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Adrian Sandu <ad...@asandu.eu> ---
Yep, all seems great now !
Thanks !

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

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


[Bug 59542] mod_http2 somehow breaks some mod_lua processing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59542

--- Comment #1 from Eric Covener <co...@gmail.com> ---
Looks like there is currently no setting of c->current_thread in h2 but there
used to be (my cscope had one before I re-ran). Stefan, do you recall when it
was dropped?  May be relevant to the PR.

Adrian, you could try probably any other LuaScope for relief.

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

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