[ic] Interesting Failure Reading Scratch Variables from Session

John Young interchange-users@icdevgroup.org
Thu Jul 18 19:40:01 2002


Kevin Walsh replied:
> I can't see anything that's done wrong there.  That 'corrected' Perl
> block does the same job as the original test code, but with a couple
> of extra lines of code and an unnecessary variable.  Of course, using
> [perl] in that context is an overkill anyway, but it's just a test
> after all.

Yes, I grabbed the $Scratch->{whatever}; from something I was doing
in bar_link (to use as just a bare bones test).

> Back to the reported problem:  As far as I can see, the only thing
> that would prevent the session being passed from one page to the next
> would be if cookies were disabled and the tester typed in the page
> names, such as "test_getvar.html", in turn and with no session ID.
> 
> I've not been able to recreate the session problem using the above
> code with cookies switched on.  With cookies switched off, a new
> session is created for every page, as would be expected.  Images,
> broken or otherwise, can't have any effect on Interchange sessions
> as they shouldn't be served by Interchange at all.

Thanks for taking a look at it, Kevin.  I appreciate you taking the
time to run the tests.

I've done some further testing, and this is what I believe is happening:
* The problem is only happening with Solaris as the server.  Linux is okay.
* The problem is only happening with mod_interchange - vlink seems okay.
* The session is being abandoned and a new one created due to a
  failed or prematurely closed socket connection managed within
  Server.pm (the accept() within server_both() in v4.8.5 Server.pm).
* In the case of my Solaris server, I think the socket may be closing
  on an EBADF (Bad file number), causing Server.pm to have to redo
  the socket connection and/or session.
* Why the old browser is immune is a mystery, but I perhaps it has
  something to do with the way it requests imbedded image links.
* I think the remedy lies in either:
  - patches for Solaris (although not as likely since I have the problem
     on both Solaris 8 and 9, and vlink works in it's socket handling).
  - compiling Apache and/or mod_interchange differently.
  - better patches from me for mod_interchange for Solaris.

In a nutshell, due to either my patches for mod_interchange for Solaris
lacking something in socket handling, possibly needed socket-related
patches for Solaris, or possibly needed patches or a different method of
compiling Apache, the socket IC is reading is prematurely closed when
Apache suffers an EBADF (bad file number) and IC establishes a new
connection and a new session.  That is, I think.  I could be wrong, of course.

Since I don't seem to have a problem without broken links, and since
my Solaris boxes are only for development (my Linux installations are
more important at the moment), I'm going to let this sit for now.  I'll check
on it again as I upgrade my Solaris versions and Apache.

If anyone else is using mod_interchange on Solaris, feel free to contact
me if you are interested in this.

Thanks,
John Young