You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Daniel Little <da...@metrex.net> on 2000/11/07 17:47:05 UTC

Apache::ASP/Solaris 2.7 - session locking issues

Has anyone had any problems with failure to write locks on Apache:ASP 
under Solaris or any other platform? Getting quite a number of the 
following in the log files...

[Tue Nov  7 10:23:11 2000] [error] [asp] [6708] [error] can't write 
lock /usr/apache/asp.global/.state/57/57d8991eb40ed4d6e886304ac5806101.l
ock: Bad file 
number, /usr/local/lib/perl5/site_perl/5.6.0/Apache/ASP.pm line 4670

...but not very consistent. Most of the time, it works just fine. 

When it does fail, it seems to trigger a bug in the UnLock module in 
that the global $UNLOCK value gets set to LOCK_SH|LOCK_EX (which is 
invalid) in the code that is commented as being written for QNX. For 
some reason, Fcntl::FUNLCK is returning LOCK_SH|LOCK_EX on Solaris, and 
the next time the module attempts to unlock a lock file, the call to 
flock($file, ($UNLOCK || LOCK_UN)) [line 4687 or thereabouts] fails 
with an 'Invalid argument' error. 

Anyway, ending up with some really weird issues using ASP on Solaris. 
We have one code base for a client that is used on both NT and Solaris 
(spent a fair bit of time getting that to work). But now, even some 
form values in the Solaris version appear to be getting corrupted 
somehow. For some unknown reason, a form that is submitted is getting a 
key value that is not at all what is in the form - it almost appears to 
be coming from another instance of the same form from another user on 
the system at the time.

We're using the latest version of the ASP code so if anyone has any 
ideas, it would be most useful. Thanks in advance!

Daniel.

Re: Apache::ASP/Solaris 2.7 - session locking issues

Posted by Joshua Chamas <jo...@chamas.com>.
Daniel Little wrote:
> 
> Has anyone had any problems with failure to write locks on Apache:ASP
> under Solaris or any other platform? Getting quite a number of the
> following in the log files...
> 
> [Tue Nov  7 10:23:11 2000] [error] [asp] [6708] [error] can't write
> lock /usr/apache/asp.global/.state/57/57d8991eb40ed4d6e886304ac5806101.l
> ock: Bad file
> number, /usr/local/lib/perl5/site_perl/5.6.0/Apache/ASP.pm line 4670
> 
> ...but not very consistent. Most of the time, it works just fine.
> 

There are a few race conditions that could contribute to this state. 
One is fixed by the Apache::ASP v2.0x releases, and another 2
is covered by my development version 2.07 which I am about to release.
If you would like to test this ahead of time, before it reaches CPAN
in the next couple days, that would be great.  Just let me know and
I'll send it separately.

--Joshua

> When it does fail, it seems to trigger a bug in the UnLock module in
> that the global $UNLOCK value gets set to LOCK_SH|LOCK_EX (which is
> invalid) in the code that is commented as being written for QNX. For
> some reason, Fcntl::FUNLCK is returning LOCK_SH|LOCK_EX on Solaris, and
> the next time the module attempts to unlock a lock file, the call to
> flock($file, ($UNLOCK || LOCK_UN)) [line 4687 or thereabouts] fails
> with an 'Invalid argument' error.
> 
> Anyway, ending up with some really weird issues using ASP on Solaris.
> We have one code base for a client that is used on both NT and Solaris
> (spent a fair bit of time getting that to work). But now, even some
> form values in the Solaris version appear to be getting corrupted
> somehow. For some unknown reason, a form that is submitted is getting a
> key value that is not at all what is in the form - it almost appears to
> be coming from another instance of the same form from another user on
> the system at the time.
> 
> We're using the latest version of the ASP code so if anyone has any
> ideas, it would be most useful. Thanks in advance!
> 
> Daniel.

Re: Apache::ASP/Solaris 2.7 - session locking issues

Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi there,

On Tue, 7 Nov 2000, Daniel Little wrote:

> Has anyone had any problems with failure to write locks on Apache:ASP 
> under Solaris or any other platform?

I just grepped one of my logfiles (a small one, about 70 megabytes:)
and there was no occurrence of this message.  Linux 2.2.16, Perl
5.6.0, Apache 1.3.12, mod_perl 1.24, ASP 0.19 (yes, 0.19).  I did it
on this log because it's the only server (in development) I've got
which is running 5.6.0.

Solaris does funny things sometimes, but I think Josh might have
something to say about this one if you're patient.

73,
Ged.