perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Hay" <Steve...@planit.com>
Subject RE: [RELEASE CANDIDATE] mod_perl-1.31 RC4
Date Tue, 22 Apr 2008 10:55:51 GMT
Philippe M. Chiasson wrote:
> Steve Hay wrote:
>> Philippe M. Chiasson wrote:
>>> The mod_perl 1.31 release candidate 4 "Works with Perl 5.10" is
>>> ready. It can be downloaded here:
>>> 
>>> http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc4.tar.gz
>> 
>> All tests OK using VC6 on WinXP with apache 1.3.39 and perl 5.10.0
>> built without USE_MULTI, USE_ITHREADS or USE_IMP_SYS.
>  >
>> Crashes on startup with apache 1.3.41 and perl 5.10.0 built with
>> default options (i.e. with USE_MULTI, USE_ITHREADS or USE_IMP_SYS).
> 
> Any chance to try and narrow it down a little bit more between these
> 3? 

I tried with USE_MULTI + USE_ITHREADS but no USE_IMP_SYS and it still
crashes, so it must be USE_ITHREADS that is doing it. (USE_MULTI is a
pre-requisite for USE_ITHREADS, so I can't try without that, and I've a
feeling that USE_MULTI on its own is useless and might not even build.)

So basically, mp1 crashes with ithreaded builds of perl.


> 
> I've finally managed to reproduce this crash myself. I've had to bite
> the bullet and get myself a Win32 VM I can actually build all this
> stuff under. 

:-)


> 
> Haven't managed to get a usefull debugging session running yet. Can't
> seem to get VC6 to pick up/display debugging symbols. Any hits from
> folks here with stronger win-foo than me ?

Obviously you need to build Apache and Perl in a debug configuration (I
assume you've figured out how to do that--I use src\makefile.win with
the "installd" option for Apache, and win32\Makefile with CFG=Debug for
Perl). Building Perl modules should then pick up the fact that Perl is
built in a debug configuration and build the modules likewise. This
works in general for ExtUtils-MakeMaker (and Module-Build) modules, and
hence for the Apache::* modules, but the mod_perl.so build doesn't seem
to pick up on it. Thus, the end of my mod_perl build goes like this:

        msdev src\modules\win32\mod_perl.dsp  /MAKE "mod_perl - Win32
Release" /USEENV
--------------------Configuration: mod_perl - Win32
Release--------------------
Compiling...
Apache.c
Connection.c
Constants.c
File.c
Log.c
ModuleConfig.c
ModuleConfig.xs(72) : warning C4715: 'vector_from_sv' : not all control
paths return a value
mod_perl.c
mod_perl_opmask.c
perl_config.c
perl_util.c
perlio.c
perlxsi.c
Server.c
Table.c
URI.c
Util.c
Linking...
   Creating library Release/mod_perl.lib and object Release/mod_perl.exp

mod_perl.so - 0 error(s), 1 warning(s)

Notice the "Win32 Release" configuration there. So you need to rebuild
mod_perl.so in debug mode after running the initial "nmake". You can do
so by running the following command (from the top-level directory):

msdev src\modules\win32\mod_perl.dsp  /MAKE "mod_perl - Win32 Debug"

That spits out a load of warnings on my system which the release mode
build didn't do, but does create a debug build mod_perl.so.

After that you need to run "nmake test" to get a httpd.conf created in
t/conf. That also copies the *release build* mod_perl.so from
src\modules\win32\Release into t\modules, so afterwards you need to
overwrite it with the *debug build* version from
src\modules\win32\Debug.

Then you're ready to debug Apache.exe. I normally start up Dev Studio
from the Command Prompt in which I've built everything so that the PATH
already includes perl\bin and apache. Open a Workspace and browse for
Apache.exe. Then go into Project > Settings, "Debug" tab and set the
"Working directory" to the path of your mod_perl source folder and the
"Program arguments" to specify the path to the httpd.conf file that was
created by "nmake test" earlier, e.g.:

"-f C:\Temp\mod_perl-1.31-rc4\t\conf\httpd.conf"

You'll also need to select "Additional DLLs" from the "Category"
drop-down and add both perl510.dll (or whatever version you're using)
and mod_perl.so to the list, otherwise VC6 doesn't pick up symbols from
DLLs! (VC8 onwards does automatically pick up DLLs as/when they're
loaded.)

Hope that helps!

Below is the stacktrace that I get when it crashes (using perl-5.10.0).
PerlIOUnix_setfd() is calling PerlIOUnix_refcnt_inc(fd) with fd 0.
Simply put a breakpoint on line 2548 in perlio.c and it crashes the
first time it hits it. Stepping inside PerlIOUnix_refcnt_inc() I find
that it reaches the line

MUTEX_LOCK(&PL_perlio_mutex);

(which is only present in the USE_ITHREADS case) and crashes there.
PL_perlio_mutex itself is a valid struct, but all its members are 0 or
0x00000000. I don't know if that's normal.

On Win32, MUTEX_LOCK(m) seems to be #defined as EnterCriticalSection(m)
(in win32\win32thread.h, given that DONT_USE_CRITICAL_SECTION is never
#defined anywhere). Hmm. The comment there says "Critical Sections used
instead of mutexes: lightweight, but can't be communicated to child
processes ...". I wonder if the other case in that #ifndef might be
worth trying, although that wouldn't be the default build option so we
shouldn't need to do that... Perhaps Jan can assist here?


NTDLL! 7c918fea()
NTDLL! 7c90104b()
PerlIOUnix_setfd(interpreter * 0x003f6e88, _PerlIO * * 0x00823594, int
0, int 0) line 2548 + 9 bytes
PerlIOUnix_open(interpreter * 0x003f6e88, _PerlIO_funcs * 0x281f9988
_PerlIO_unix, PerlIO_list_s * 0x008237e0, long 0, const char *
0x281eb39d, int 0, int 0, int 0, _PerlIO * * 0x00823594, int 0, sv * *
0x00000000) line 2625 + 21 bytes
PerlIOBuf_open(interpreter * 0x003f6e88, _PerlIO_funcs * 0x281f9b48
_PerlIO_crlf, PerlIO_list_s * 0x008237e0, long 1, const char *
0x281eb39c `string', int 0, int 0, int 0, _PerlIO * * 0x00000000, int 0,
sv * * 0x00000000) line 3685 + 53 bytes
PerlIO_openn(interpreter * 0x003f6e88, const char * 0x00000000, const
char * 0x281eb39c `string', int 0, int 0, int 0, _PerlIO * * 0x00000000,
int 0, sv * * 0x00000000) line 1597 + 50 bytes
PerlIO_fdopen(int 0, const char * 0x281eb39c `string') line 4988 + 29
bytes
PerlIO_stdstreams(interpreter * 0x003f6e88) line 1204 + 12 bytes
PerlIO_resolve_layers(interpreter * 0x003f6e88, const char * 0x00000000,
const char * 0x281d43ac `string', int 1, sv * * 0x0012dabc) line 1486 +
9 bytes
PerlIO_openn(interpreter * 0x003f6e88, const char * 0x00000000, const
char * 0x281d43ac `string', int -1, int 0, int 0, _PerlIO * *
0x00000000, int 1, sv * * 0x0012dabc) line 1568 + 25 bytes
PerlIO_open(const char * 0x00823930, const char * 0x281d43ac `string')
line 4997 + 29 bytes
S_open_script(interpreter * 0x003f6e88, const char * 0x00823930, char 0,
sv * 0x003fb920, int * 0x0012db4c, _PerlIO * * * 0x0012dba0) line 3704 +
14 bytes
S_parse_body(interpreter * 0x003f6e88, char * * 0x00000000, void
(interpreter *)* 0x10026810 mod_perl_xs_init(interpreter *)) line 2053 +
29 bytes
perl_parse(interpreter * 0x003f6e88, void (interpreter *)* 0x10026810
mod_perl_xs_init(interpreter *), int 4, char * * 0x0012dd0c, char * *
0x00000000) line 1650 + 17 bytes
perl_startup(server_rec * 0x009a7040, pool * 0x009a7018) line 704 + 27
bytes
perl_cmd_require(cmd_parms * 0x0012fe78, void * 0x009a8ae8, char *
0x009a8c78) line 621 + 28 bytes
invoke_cmd(const command_struct * 0x10097c20, cmd_parms * 0x0012fe78,
void * 0x009a8ae8, const char * 0x0012de30) line 877 + 18 bytes
ap_handle_command(cmd_parms * 0x0012fe78, void * 0x009a7be0, const char
* 0x0012de18) line 988 + 21 bytes
ap_srm_command_loop(cmd_parms * 0x0012fe78, void * 0x009a7be0) line 1002
+ 20 bytes
ap_process_resource_config(server_rec * 0x009a7040, char * 0x009a8768,
pool * 0x009a7018, pool * 0x009ab0c8) line 1294 + 16 bytes
ap_read_config(pool * 0x009a7018, pool * 0x009ab0c8, char * 0x6ffc76c0
_ap_server_confname) line 1579
apache_main(int 3, char * * 0x009a2698) line 7880 + 24 bytes
main(int 3, char * * 0x009a2698) line 33 + 13 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 7c816fd7()

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message