You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2006/04/25 09:04:09 UTC

[jira] Commented: (MODPYTHON-104) Allow Python code callouts with mod_include (SSI).

    [ http://issues.apache.org/jira/browse/MODPYTHON-104?page=comments#action_12376180 ] 

Graham Dumpleton commented on MODPYTHON-104:
--------------------------------------------

On Apache 2.2, but not on Apache 2.0, if an error occurs in the Python script, Apache is later crashing at some point.

[Tue Apr 25 16:32:13 2006] [error] [client ::1] includes /Users/grahamd/Workspaces/testing/ssi-1/ssi.shtml: Traceback (most recent call last):
[Tue Apr 25 16:32:13 2006] [error] [client ::1] includes /Users/grahamd/Workspaces/testing/ssi-1/ssi.shtml:   File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/mod_python/importer.py", line 1377, in IncludeDispatch\n    exec(code, filter.req.ssi_globals)
[Tue Apr 25 16:32:13 2006] [error] [client ::1] includes /Users/grahamd/Workspaces/testing/ssi-1/ssi.shtml:   File "<string>", line 2, in ?
[Tue Apr 25 16:32:13 2006] [error] [client ::1] includes /Users/grahamd/Workspaces/testing/ssi-1/ssi.shtml: ImportError: No module named module_1
[Tue Apr 25 16:32:14 2006] [error] [client ::1] File does not exist: /usr/local/apache-2.2/htdocs/favicon.ico
[Tue Apr 25 16:32:15 2006] [notice] child pid 5360 exit signal Bus error (10)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000005
[Switching to process 5368 thread 0x1203]
apr_pool_clear (pool=0x1) at memory/unix/apr_pools.c:685
685         while (pool->child)
(gdb) where
#0  apr_pool_clear (pool=0x1) at memory/unix/apr_pools.c:685
#1  0x00028c4c in includes_filter (f=0x19117f8, b=0x1911998) at mod_include.c:3402
#2  0x00008af8 in default_handler (r=0x190c450) at core.c:3701
#3  0x0000a224 in ap_run_handler (r=0x190c450) at config.c:157
#4  0x0000a7ec in ap_invoke_handler (r=0x190c450) at config.c:371
#5  0x0002e44c in ap_process_request (r=0x190c450) at http_request.c:258
#6  0x0002dac0 in ap_process_http_connection (c=0x1902bd0) at http_core.c:172
#7  0x0001cd64 in ap_run_process_connection (c=0x1902bd0) at connection.c:43
#8  0x000441bc in worker_thread (thd=0x1899920, dummy=0x0) at worker.c:531
#9  0x9002ba68 in _pthread_body ()

The ctx pointer seems to be somehow be getting overwritten with 0.

This may be related to issue Nicolas saw on Win32 with Apache 2.2 in test suite, but then that would imply the Python code in the test failed for some reason which it shouldn't have.

> Allow Python code callouts with mod_include (SSI).
> --------------------------------------------------
>
>          Key: MODPYTHON-104
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-104
>      Project: mod_python
>         Type: New Feature

>   Components: core
>     Reporter: Graham Dumpleton
>     Assignee: Graham Dumpleton
>      Fix For: 3.3
>  Attachments: MP104_20060317_jgallacher_1.diff, grahamd_20060126_1_mod_include.diff, grahamd_20060226_MP104_1.diff
>
> The mod_include module supporting server side includes (SSI), provides a means of registering new element tags which trigger callouts to other code in separate Apache modules. This is used for example in mod_perl to allow Perl language code to be used with server side includes:
>  <!--#perl sub="MySSI::remote_host" -->
>   <!--#perl arg="Hello" arg="SSI" arg="World"
>          sub="sub {
>                   my($r, @args) = @_;
>                   print qq(@args);
>               }"
>   -->
> An equivalent feature for Python was previously asked about on the mailing list back in 2004:
>   http://www.modpython.org/pipermail/mod_python/2004-January/014832.html
> Since it seems entirely reasonable that such integration of mod_python and mod_include would be possible, thought it would be good to log it as a possible new feature.
> Because of SSI's support for basic conditionals, includes and other callout mechanisms, would be a good quick and dirty way of doing templating without having to resort to PSP, or other high level templating systems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira