Re: mod_perl, mod_gzip, incredible suckage

2002-02-15 Thread Ryan Parr

Wow, I'm having a hell of a time with it too. I compiled it directly into
Apache. I don't get segfaults but I don't get compression either. After all
the time I've put into it (it's late, and now I'm drunk) I could compose a
lovely rant on this, but I'll keep that to myself.

No love. I get no love from mod_gzip.

-- Ryan


- Original Message -
From: Mithun Bhattacharya [EMAIL PROTECTED]
To: ModPerl List [EMAIL PROTECTED]
Sent: Thursday, February 14, 2002 10:10 PM
Subject: Re: mod_perl, mod_gzip, incredible suckage


 Robin Berjon wrote:


 
  I got it to work once, but I confirm this was painful. I don't use it
anymore
  though so I can't remember the magic that it took to get it to run. As
an
  alternative (probably incomplete) solution, you might want to look
inside one
  of the templating/publishing modules out there that support gzip output
  natively. I know AxKit does, and iirc TT does too (but I'm not sure).
 
 


 http://www.egurucool.com

 Works fine with mod_gzip as a DSO Dont even recall having to do anything
 fancy just followed the documentation.



 Mithun





[OT] Moving WYPUG

2002-02-15 Thread Jonathan M. Hollin

Hi gang,

After a few months of outrageous instability, I am now moving WYPUG on
to a Linux server (redhat 7.2).  Using ApacheToolbox
(http://www.apachetoolbox.com) I have managed to get Apache, mod_perl
and MySQL up and running, along with a few Apache modules.  At this
point everything is running perfectly.

I now need to install some Perl modules (DBD-MySql, Image-Magick, etc).
Under ActivePerl on WYPUG's current Win2K box, I would simply use the
Perl Package Manager (PPM) to download and install these modules.  Is
there an equivalent under Unix?  If not, what's the best way to install
modules?  In short, what do I need to know?

A step-by-step guide would be great (I'm a 100% Unix newbie), but I
would also be extremely grateful for pointers to the relevant docs,
URI's, etc.

Thank you all in advance.


Jonathan M. Hollin - WYPUG Co-ordinator
West Yorkshire Perl User Group
http://wypug.pm.org/ 




Re: [OT] Moving WYPUG

2002-02-15 Thread masta



On Fri, 15 Feb 2002, Jonathan M. Hollin wrote:

 Hi gang,
 
 After a few months of outrageous instability, I am now moving WYPUG on
 to a Linux server (redhat 7.2).  Using ApacheToolbox
Good idea ;))
(no i don't like redhat, but i like linux)

 I now need to install some Perl modules (DBD-MySql, Image-Magick, etc).
 Under ActivePerl on WYPUG's current Win2K box, I would simply use the
 Perl Package Manager (PPM) to download and install these modules.  Is
 there an equivalent under Unix?  If not, what's the best way to install
 modules?  In short, what do I need to know?
just type
perl -MCPAN -eshell
this will ask you some simple questions, about the nearest mirror to you,
and so on, if you are on the command-prompt, type install Your::Module and
it will fetch the module from cpan, and install it...

Nico




RE: [OT] Moving WYPUG

2002-02-15 Thread Jonathan M. Hollin

:: what's the best 
::  way to install modules?  In short, what do I need to know?
:: just type
:: perl -MCPAN -eshell
:: this will ask you some simple questions, about the nearest 
:: mirror to you, and so on, if you are on the command-prompt, 
:: type install Your::Module and it will fetch the module from 
:: cpan, and install it...

Nico thank you so much for your prompt reply.  I really appreciate it.
Cheers!


Jonathan M. Hollin - WYPUG Co-ordinator
West Yorkshire Perl User Group
http://wypug.pm.org/ 




Re: [OT] Moving WYPUG

2002-02-15 Thread Jean-Michel Hiver

 I now need to install some Perl modules (DBD-MySql, Image-Magick, etc).
 Under ActivePerl on WYPUG's current Win2K box, I would simply use the
 Perl Package Manager (PPM) to download and install these modules.  Is
 there an equivalent under Unix?  If not, what's the best way to install
 modules?  In short, what do I need to know?

You might be willing to spend some time setting up CPAN.pm. It's a bit
of a hassle to get it working right, but once you're done it feels just
like PPM :-)

Cheers,
-- 
IT'S TIME FOR A DIFFERENT KIND OF WEB

  Jean-Michel Hiver - Software Director
  [EMAIL PROTECTED]
  +44 (0)114 221 4968

  VISIT HTTP://WWW.MKDOC.COM



Re: [OT] Moving WYPUG

2002-02-15 Thread Mark Fowler

On Fri, 15 Feb 2002, Jonathan M. Hollin wrote:

 I now need to install some Perl modules (DBD-MySql, Image-Magick, etc).
 Under ActivePerl on WYPUG's current Win2K box, I would simply use the
 Perl Package Manager (PPM) to download and install these modules.  Is
 there an equivalent under Unix?

You can get ppm for Linux.  I don't think many people use it.

 If not, what's the best way to install modules?  In short, what do I
 need to know?

(as root)

$ perl -MCPAN -e shell; [1]

(answer loads of really simple config questions the first time you 
install - just accept the defaults)

cpan install Acme::Buffy;

installs Acme::Buffy from source, hopefully asking you about 
installing prerequisites first if it needs them (or just installs them 
automatically if you selected follow during the config)

Later.

Mark.

[1] The command 'cpan' is often set up as an alias for this on many 
systems

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




RE: mod_perl compile problem

2002-02-15 Thread Ged Haywood

Hi there,

On Thu, 14 Feb 2002, OCNS Consulting wrote:

 I Unzip/Untar the Apache tarball and change to the Apache top level
 distribution directory. I then Unzip/Untar the module dists and one by one
 prep each module for a static build and then finally build mod_perl as per
 my previous messages.

That's your problem.  Do it like I said in my last but one (?:) message.
You should finish up with the Apache and mod_perl directories at the
same level in the tree.

Hehe, it's the mistake I made when I first built mod_perl...

73,
Ged.




Re: [OT] Moving WYPUG

2002-02-15 Thread fliptop

Jonathan M. Hollin wrote:

 I now need to install some Perl modules (DBD-MySql, Image-Magick, etc).
 Under ActivePerl on WYPUG's current Win2K box, I would simply use the
 Perl Package Manager (PPM) to download and install these modules.  Is
 there an equivalent under Unix?  If not, what's the best way to install
 modules?  In short, what do I need to know?
 
 A step-by-step guide would be great (I'm a 100% Unix newbie), but I
 would also be extremely grateful for pointers to the relevant docs,
 URI's, etc.


i'll toss in my $0.02 here - if you're running redhat, you can use 
makerpm.pl to generate rpm's from your cpan source code.  i use this all 
the time and have never had a problem.

http://www.perl.com/cs/user/query/q/6?id_topic=61

the version of makerpm.pl you find may not work with rpm version 4.0 or 
higher, this will fix that:

572c572
   } elsif ($rpm_version =~ /rpm\s+version\s+3\.+/i) {
---
} elsif ($rpm_version =~ /rpm\s+version\s+3|4\.+/i) {




Re: Cookie as session store

2002-02-15 Thread Tatsuhiko Miyagawa


On Thu, 14 Feb 2002 11:35:14 -0500
Perrin Harkins [EMAIL PROTECTED] wrote:

 It's really a good idea to do this even when the cookie is nothing but a
 session ID.  A standard module for this like the one Jay mentioned would
 definitely be nice.

Apache::Cookie::Encrypted seems to be the one.
http://search.cpan.org/search?dist=ApacheCookieEncrypted

--
Tatsuhiko Miyagawa [EMAIL PROTECTED]




Re: inheritance and Apache::Request

2002-02-15 Thread Aaron Ross


 
 sub new {
  my ($class, $r) = @_;
 
  return bless { r  = Apache::Request-new($r),
}, $class;
 }


 or

 sub new { 
my ($class,$r) = @_;
my $self = $class-SUPER::new($r);
# do your own init ...
return $self
}

TMTOWTDI, aaron

-- 
aaron ross . alias i, inc
 email . [EMAIL PROTECTED]
 phone . 215 545 6428




Re: inheritance and Apache::Request

2002-02-15 Thread Joe Schaefer


Paul Lindner wrote:

 If you look you'll see that the new() method is written in C.  It
 should be blessing itself into the passed in class, not using
 Apache::Request.  

You're right- except that this is exactly how the Apache class,
from which Apache::Request is derived, expects to be subclassed.  

It requires all derived classes to override new().

 My XS is a little foggy, but it appears that these lines should be
 modified to use the passed in class:

CLEANUP:
apreq_add_magic(ST(0), robj, RETVAL);

 which ends up as:

ST(0) = sv_newmortal();
sv_setref_pv(ST(0), Apache::Request, (void*)RETVAL);

No- that code in Request.c comes from this line in the libapreq
typemap:

T_APROBJ
sv_setref_pv($arg, \${ntype}\, (void*)$var);

$ntype is converted to Apache::Request by xsubpp. We could
pull the package info from SvPV(class),  but then the same fix 
probably should be incorporated into modperl as well.

 In any case all you need to do to get around this is define your own
 new method and call the Apache::Request object directly and store it
 as the value 'r'..  Here's an example:

 sub new {
  my ($class, $r) = @_;

 return bless { r  = Apache::Request-new($r),
   }, $class;
 }

Yes, exactly.  sv_2apreq will look for an Apache::Request object
attribute in the r  or _r keys: the behavior is consistent
with the eagle's Chapter 7 section on Subclassing the Apache
Class:

  To be successful, the new subclass must add Apache (or another
  Apache subclass) to its @ISA array.  In addition, the subclass's
  new() method must return a blessed hash reference which contains
  either an r or _r key. This key must point to a bona fide Apache
  object.

The reason this also works OK with a derived class like 
Apache::Request is that an the ApacheRequest C struct has a 
request_rec pointer as its *first* attribute, so a cast from 
(ApacheRequest *) to (request_rec *) will be safe.

-- 
Joe Schaefer



Re: Mistaken identity problem with cookie

2002-02-15 Thread Perrin Harkins

 I have a mysterious mistaken identity problem that I have not been
 able to solve.

There are two common sources of this problem.  One is an ID generation
system that is not unique enough.  Another is a bug in your code with
globals (see the section of the Guide about debugging with httpd -X).

You could be having problems with a proxy on their end, but most proxies are
smart about this stuff.

- Perrin




Re: [OT] Moving WYPUG

2002-02-15 Thread Robert Landrum

At 7:44 AM -0500 2/15/02, fliptop wrote:

the version of makerpm.pl you find may not work with rpm version 4.0 
or higher, this will fix that:

572c572
   } elsif ($rpm_version =~ /rpm\s+version\s+3\.+/i) {
---
} elsif ($rpm_version =~ /rpm\s+version\s+3|4\.+/i) {

Actually I don't think that really fixes it...

That's going to search for

rpm\s+version\s+3

or

4\.+



You want

} elsif ($rpm_version =~ /rpm\s+version\s+(?:3|4)\.+/i) {


Rob

--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  



Re: Mistaken identity problem with cookie (fwd)

2002-02-15 Thread Rafiq Ismail (ADMIN)

Although all your cookies will be probably be going to the same proxy for
those requests from the same isp, the tcp-ip session will remain the same
and it is most likely that you'll still be connected to the same ip which
made the initial proxy connection.  My thought is possibly that you're
misuing global variables here, or that  you have name space issues?

Thus the variable which you are setting your cookie value with may not be
correctly reset.

Just a thought.

Fiq










Re: POST without any content - sometimes

2002-02-15 Thread Anders Knuts

Hi again!
No one got a clue to my problem? A hunch or just a feeling would do just
fine :-)

/Anders

Anders Knuts skrev:

 Hi!
 I have a board script to which users can post (of course)
 One IP-address has sometimes problems posting to that script, though.
 Look at the log's below.

 xxx.xxx.25.50 - - [10/Feb/2002:21:15:33 +0100] POST
 /cgi-bin/mboard/message.pl HTTP/1.1
 200 88 - Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

 xxx.xxx.25.50 - - [10/Feb/2002:21:15:36 +0100] POST
 /cgi-bin/mboard/message.pl HTTP/1.1
 200 1683 http://www.servern.nu/main.html; Mozilla/4.0 (compatible;
 MSIE 5.5; Windows NT 5.0)

 The first POST is erronuos as there is no content (-) and the script
 won't accept it as vaild.
 The scond POST is okay as it has content
 (http://www.servern.nu/main.html;).
 This happens ONLY to that IP-address. Since I havn't been able to find
 anything to do about the problem, and since it seems to come and go, and

 since it is only that IP-address, i draw the conclusion that the problem

 really isn't mine, but what causes it??? How can the POST loose it's
 content like that?
 I know who the user is so I know it's an actual post that he tried to
 make. The IP-address is an alias to a whole net with NAT (Linux). Could
 it be some kind of proxy-web-cache or something that causes the problem?

 Please excuse my poor english...

 Best Regards
 Anders, admin servern.nu

--
Anders Knuts
[EMAIL PROTECTED]

-Varför använda en massa främmande ord när det finns en adekvat svensk
vokabulär?-





Re: POST without any content - sometimes

2002-02-15 Thread Ged Haywood

Hi there,

On Fri, 15 Feb 2002, Anders Knuts wrote:

 Hi again!
 No one got a clue to my problem? A hunch or just a feeling would do just
 fine :-)

Didn't you get my reply?

73,
Ged.
--
From [EMAIL PROTECTED] Fri Feb 15 17:39:58 2002
Date: Tue, 12 Feb 2002 19:42:32 + (GMT)
From: Ged Haywood [EMAIL PROTECTED]
To: Anders Knuts [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: POST without any content - sometimes

Hi there,

On Tue, 12 Feb 2002, Anders Knuts wrote:

 I have a board script to which users can post (of course)
 One IP-address has sometimes problems posting to that script, though.
[snip]
 really isn't mine, but what causes it??? How can the POST loose it's
 content like that? [snip] Could it be some kind of proxy-web-cache or
 something that causes the problem?

No idea.  Sounds like a lot of fun though.  Time to dig out tcpdump?

 Please excuse my poor english...

It's fine.

73,
Ged.





[BUG] Memory Courruption (was: RE: [Q] SIGSEGV After fork())

2002-02-15 Thread Fister, Mark


 Dear mod_perl experts:
 
 Collectively, we've been at this for more than two weeks and have searched
 various mod_perl archives, all to no avail.
 
 Symptom:
 ===
 SIGSEGV after fork().  Very reproducible.  Memory corruption gets moved
 around if the codebase changes.

[ SNIP ]

The above is the key: moved around.  Therefore, I need Purify or similar
tool.  I'm going to have to go this route, since nobody has any ideas.
Go go gadget purchasing! :(

The only other way I can think of to solve this is to send my module list
to this audience.  Please find it, attached, with home-grown modules
deleted.

More info:

In speaking with Ged (who is very knowledgeable, thanks!), I was led down
a path that caused my server to start (setting PERL_DESTRUCT_LEVEL to 0),
but it doesn't solve the memory corruption that perl_destruct ends up
stumbling on, only hides it. For some reason, in my case, the address of
the PV_sv_undef symbol ends up being the target of my Perl_safesysfree,
below (the xpv_pv address was, for some reason, 0x4046cc18, and that is
the address of the PV_sv_undef symbol).

 Stack Trace:
 ===
 #0  __pthread_mutex_lock (mutex=0x8bf04999) at mutex.c:99
 #1  0x401b9cc8 in __libc_free (mem=0x4046cc18) at malloc.c:3152
 #2  0x403ce028 in Perl_safesysfree (where=0x4046cc18) at util.c:158
 #3  0x403f20d8 in Perl_sv_clear (sv=0x8198f60) at sv.c:3827
 #4  0x403f2473 in Perl_sv_free (sv=0x8198f60) at sv.c:3950
 #5  0x403f80e1 in do_clean_all (sv=0x8198f60) at sv.c:8411
 #6  0x403e9c5e in S_visit (f=0x403f8094 do_clean_all) at sv.c:162
 #7  0x403e9ce2 in Perl_sv_clean_all () at sv.c:193
 #8  0x4038594a in perl_destruct (my_perl=0x809a9a8) at perl.c:665
 #9  0x4035629c in perl_shutdown (s=0x0, p=0x0) at mod_perl.c:294
 #10 0x40356be6 in mp_dso_unload (data=0x808e714) at mod_perl.c:489
 #11 0x08050f34 in run_cleanups (c=0x809c8ac) at alloc.c:1713
 #12 0x0804f5fa in ap_clear_pool (a=0x808e714) at alloc.c:538
 #13 0x08062128 in standalone_main (argc=7, argv=0xb294) at
http_main.c:5014 
 #14 0x08062cb2 in main (argc=7, argv=0xb294) at http_main.c:5401
 #15 0x40155627 in __libc_start_main (main=0x80627d4 main, argc=7, 
 ubp_av=0xb294, init=0x804e3e4 _init, fini=0x807aa40 _fini, 
 rtld_fini=0x4000dcd4 _dl_fini, stack_end=0xb28c)
 at ../sysdeps/generic/libc-start.c:129
 
 ***NOTE***  the following gdb session was gleaned from sv.c and refers to
 the freed memory location (0x4046cc18) above:
 
 (gdb) p *((XPV*)(sv)-sv_any)
 $13 = {xpv_pv = 0x4046cc18 , xpv_cur = 135562488, xpv_len = 135617180} 

[ SNIP ]

-- 
\_/} Mark P. Fister Java, Java, everywhere, and all\_/}
\_/} eBay, Inc. the cups did shrink; Java, Java\_/}
\_/} Austin, TX everywhere, nor any drop to drink! \_/}




module_list_ulist.txt
Description: Binary data


Re: [BUG] Memory Courruption (was: RE: [Q] SIGSEGV After fork())

2002-02-15 Thread Perrin Harkins

 The only other way I can think of to solve this is to send my module list
 to this audience.  Please find it, attached, with home-grown modules
 deleted.

Have you tried debugging the old-fashioned way, i.e. remove things until it
works?  That's your best bet.  I suspect you will find that you have some
module doing something with XS or sockets or filehandles that can't deal
with being forked.

- Perrin




Re: [BUG] Memory Courruption (was: RE: [Q] SIGSEGV After fork())

2002-02-15 Thread Robert Landrum

At 11:44 AM -0600 2/15/02, Fister, Mark wrote:
  Dear mod_perl experts:

 Collectively, we've been at this for more than two weeks and have searched
 various mod_perl archives, all to no avail.

 Symptom:
 ===
 SIGSEGV after fork().  Very reproducible.  Memory corruption gets moved
 around if the codebase changes.

[ SNIP ]

The above is the key: moved around.  Therefore, I need Purify or similar
tool.  I'm going to have to go this route, since nobody has any ideas.
Go go gadget purchasing! :(


Are you running any XS stuff created with SWIG?  I had a very similar 
problem some time ago (RH 5.1, I think) with SWIG creating strange XS 
files that corrupted memory when used under mod_perl... There was no 
corruption when running as a perl script or cgi.

I eventually scrapped SWIG (a little too complicated for what I was 
doing) in favor of h2xs.  Just for fun, I tried using it with 
mod_perl and it worked perfectly.

After reviewing it with my father (who's a die hard C guy), he found 
a potential problem with

$var = undef;
call_xs_sub_to_populate($var);

Which might hose undef.

He suggested instead

$var = \0 x SIZE_OF_POPULATED_DATA;
call_xs_sub_to_populate($var);

Which I never actually tried.

Since I'm not a C guy, I don't really run into too many segfaults. 
Unfortunatly I no longer have the code I was testing this with or I'd 
give it another shot...

Hope that helps some...

Rob





--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  



Re: Mistaken identity problem with cookie

2002-02-15 Thread Dzuy Nguyen



Perrin Harkins wrote:
002801c1b63b$2563aea0$18020c0a@PerriHar">
  
I have a mysterious "mistaken identity" problem that I have not beenable to solve.

There are two common sources of this problem.  One is an ID generationsystem that is not unique enough.  Another is a bug in your code withglobals (see the section of the Guide about debugging with httpd -X).You could be having problems with a proxy on their end, but most proxies aresmart about this stuff.- Perrin

I've debugged the problem and I don't think these are the reasons. 

1. I've compared the ID's of the mistaken identity parties involved and they're
not the same.
2. I don't think it's a global vairable issue. Basically, I just grab the
cookie by $r-header_in('Cookie')
and decrypt it. Besides, if it's global then the "mistaken" ID's should
be from anywhere randomly.
There is this nagging fact that the parties involved are from the same ISP's
i.e. user A1 and A2 are
from foo.com, user B1 and B2 are from bar.com, etc. These ISP's are small
operations. I'm pretty
convinced that the problem is on their end. My theory is that these proxies
may have cached the
cookie with an IP address which they provide their clients.

Dzuy




Re: Mistaken identity problem with cookie

2002-02-15 Thread Perrin Harkins

 2. I don't think it's a global vairable issue.  Basically, I just grab
 the cookie by $r-header_in('Cookie')
 and decrypt it.

It's what you do after that that matters.

 Besides, if it's global then the mistaken ID's should
 be from anywhere randomly.

True, but random may not always look random.

 There is this nagging fact that the parties involved are from the same
 ISP's i.e. user A1 and A2 are
 from foo.com, user B1 and B2 are from bar.com, etc.

You aren't using IP or domain as part of your ID generation, are you?  That
would be bad.

- Perrin




Re: Mistaken identity problem with cookie

2002-02-15 Thread Rob Nagler

 small operations.  I'm pretty convinced that the problem is on their
 end.  My theory is that these proxies may have cached the cookie
 with an IP address which they provide their clients.

Have you tried capturing all ethernet packets and seeing if the raw
data supports this conclusion.  Checkout:

http://www.ethereal.com/

We have found that it is the bigger ISPs which have faulty caches.
Usually it is a DNS problem, not an HTTP caching problem.

Another trick is throwing a time stamp in every cookie.  This is
useful for other reasons, e.g. cookie expiration and validation.

Cheers,
Rob



Re: [BUG] Memory Courruption (was: RE: [Q] SIGSEGV After fork())

2002-02-15 Thread Paul Lindner

On Fri, Feb 15, 2002 at 11:44:03AM -0600, Fister, Mark wrote:
 
  Dear mod_perl experts:
  
  Collectively, we've been at this for more than two weeks and have searched
  various mod_perl archives, all to no avail.
  
  Symptom:
  ===
  SIGSEGV after fork().  Very reproducible.  Memory corruption gets moved
  around if the codebase changes.
 
 [ SNIP ]
 
 The above is the key: moved around.  Therefore, I need Purify or similar
 tool.  I'm going to have to go this route, since nobody has any ideas.
 Go go gadget purchasing! :(
 
 The only other way I can think of to solve this is to send my module list
 to this audience.  Please find it, attached, with home-grown modules
 deleted.

To further diagnose this problem you might consider using the sigtrap
module and paying careful attention to your logs...  This at least led
me to the portion of my perl that was causing the problem.

A simple

  use sigtrap;

The default signal handler used in this module gives you a stack trace
before the core dump..


-- 
Paul Lindner[EMAIL PROTECTED]   | | | | |  |  |  |   |   |

mod_perl Developer's Cookbook   http://www.modperlcookbook.org/
 Human Rights Declaration   http://www.unhchr.ch/udhr/index.htm



RE: [BUG] Memory Courruption (was: RE: [Q] SIGSEGV After fork())

2002-02-15 Thread Fister, Mark

  The only other way I can think of to solve this is to send my module
list
  to this audience.  Please find it, attached, with home-grown modules
  deleted.
 
 Have you tried debugging the old-fashioned way, i.e. remove things until
it
 works?  That's your best bet.  I suspect you will find that you have some
 module doing something with XS or sockets or filehandles that can't deal
 with being forked.

That's just the thing with memory corruption:

Adding or removing random code causes the SIGSEGV signature to change
(or causes the server to suddenly start working).  I am nearly
certain that the memory corruption is happening BEFORE the fork,
anyway, which is why I modified the subject line of this thread.
Thank you VERY, VERY much for your ideas, though - I will keep
looking while I wait for the powers that be to get my bounds checking
software!

 - Perrin

-- 
\_/} Mark P. Fister Java, Java, everywhere, and all\_/}
\_/} eBay, Inc. the cups did shrink; Java, Java\_/}
\_/} Austin, TX everywhere, nor any drop to drink! \_/}



RE: [BUG] Memory Courruption (was: RE: [Q] SIGSEGV After fork())

2002-02-15 Thread Fister, Mark

On Fri, Feb 15, 2002 at 12:17:07PM -0800, Paul Lindner wrote:
 On Fri, Feb 15, 2002 at 11:44:03AM -0600, Fister, Mark wrote:
  
   Dear mod_perl experts:
   
   Collectively, we've been at this for more than two weeks and have
searched
   various mod_perl archives, all to no avail.
   
   Symptom:
   ===
   SIGSEGV after fork().  Very reproducible.  Memory corruption gets
moved
   around if the codebase changes.
  
  [ SNIP ]
  
  The above is the key: moved around.  Therefore, I need Purify or similar
  tool.  I'm going to have to go this route, since nobody has any ideas.
  Go go gadget purchasing! :(
  
  The only other way I can think of to solve this is to send my module
list
  to this audience.  Please find it, attached, with home-grown modules
  deleted.
 
 To further diagnose this problem you might consider using the sigtrap
 module and paying careful attention to your logs...  This at least led
 me to the portion of my perl that was causing the problem.
 
 A simple
 
   use sigtrap;
 
 The default signal handler used in this module gives you a stack trace
 before the core dump..

Unless use sigtrap; itself causes a SIGSEGV, which invokes the
signal handler, which causes a SIGSEGV, which invokes... and all of
a sudden your httpd process goes to many thousands of stack levels
deep and consumes 1GB of memory... ;)

-- 
\_/} Mark P. Fister Java, Java, everywhere, and all\_/}
\_/} eBay, Inc. the cups did shrink; Java, Java\_/}
\_/} Austin, TX everywhere, nor any drop to drink! \_/}



Re: POST without any content - sometimes

2002-02-15 Thread Anders Knuts

Yes, of course i did, sorry.
I don't think I'm experienced enough to know how to use tcpdump in this case,
though...
Any hints?

/Anders

Ged Haywood skrev:

 Hi there,

 On Fri, 15 Feb 2002, Anders Knuts wrote:

  Hi again!
  No one got a clue to my problem? A hunch or just a feeling would do just
  fine :-)

 Didn't you get my reply?

 73,
 Ged.
 --
 From [EMAIL PROTECTED] Fri Feb 15 17:39:58 2002
 Date: Tue, 12 Feb 2002 19:42:32 + (GMT)
 From: Ged Haywood [EMAIL PROTECTED]
 To: Anders Knuts [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: POST without any content - sometimes

 Hi there,

 On Tue, 12 Feb 2002, Anders Knuts wrote:

  I have a board script to which users can post (of course)
  One IP-address has sometimes problems posting to that script, though.
 [snip]
  really isn't mine, but what causes it??? How can the POST loose it's
  content like that? [snip] Could it be some kind of proxy-web-cache or
  something that causes the problem?

 No idea.  Sounds like a lot of fun though.  Time to dig out tcpdump?

  Please excuse my poor english...

 It's fine.

 73,
 Ged.

--
Anders Knuts
[EMAIL PROTECTED]

-Varför använda en massa främmande ord när det finns en adekvat svensk
vokabulär?-





Re: Mistaken identity problem with cookie

2002-02-15 Thread Dzuy Nguyen





Perrin Harkins wrote:
009001c1b65b$068df3d0$18020c0a@PerriHar">
  
2. I don't think it's a global vairable issue.  Basically, I just grabthe cookie by $r-header_in('Cookie')and decrypt it.

It's what you do after that that matters.

All it does is get the user login info and displays it. The variable is
local to the short script.
009001c1b65b$068df3d0$18020c0a@PerriHar">
  
  
Besides, if it's global then the "mistaken" ID's shouldbe from anywhere randomly.

True, but random may not always look random.

What I meant was it would have happen to any user from any other ISP or domain.
In all cases,
the mistaken ID's originate from the same ISP ([EMAIL PROTECTED] appears as [EMAIL PROTECTED],
[EMAIL PROTECTED]
appears as [EMAIL PROTECTED] and so on).
009001c1b65b$068df3d0$18020c0a@PerriHar">
  
  
There is this nagging fact that the parties involved are from the sameISP's i.e. user A1 and A2 arefrom foo.com, user B1 and B2 are from bar.com, etc.

You aren't using IP or domain as part of your ID generation, are you?  Thatwould be bad.

No, just straight encrypt($user_id) as the value of the cookie and decrypt($cookie_str).
009001c1b65b$068df3d0$18020c0a@PerriHar">
  - Perrin
  
  
  
  


Re: Mistaken identity problem with cookie

2002-02-15 Thread Ask Bjoern Hansen

On Fri, 15 Feb 2002, Rob Nagler wrote:

  small operations.  I'm pretty convinced that the problem is on their
  end.  My theory is that these proxies may have cached the cookie
  with an IP address which they provide their clients.
 
 Have you tried capturing all ethernet packets and seeing if the raw
 data supports this conclusion.  Checkout:
 
 http://www.ethereal.com/

Much easier is to just use Apache::DumpHeaders.

I usually have stuff that suspects a weird transaction log it with 
DumpHeaders. Make a nice trail to investigate for patterns or 
whatevers.

http://search.cpan.org/search?dist=Apache-DumpHeaders


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: POST without any content - sometimes

2002-02-15 Thread Ged Haywood

Hello again,

On Fri, 15 Feb 2002, Anders Knuts wrote:

[snip,snip]
 to use tcpdump in this case, Any hints?

You can use tcpdump to record the entire conversation between the
browser and the server.  To find out how to use it you can just type
'man tcpdump'.  If it's a problem specific to one IP address then
first I would record the conversations between a browser from an IP
address that doesn't suffer from the problem and the host, then from
the IP address which does have the problem.  My guess is that you'll
see something different when you compare these which might give you 
a clue about the problem.  You might even try spoofing the bad IP to
see if you can repeat the problem on your own.

On the other hand you might not yet have exhausted the other debugging
possibilities.  There are lots of techniques that you might try before
you get as deep into TCP as this.  You could put oodles of 'print
STDERR' statements all through your code, things like

my $dateTime   = gmtime;
print STDERR [$dateTime] foo(): Line, __LINE__,  Calling sub bar REMOTE_IP=, 
$ENV{REMOTE_ADDR}, \n;
bar($ENV{REMOTE_IP});

which is the sort of thing I do to convince myself that I really don't
know what's going on when I think I don't know what's going on.  In
fact I do it routinely in most of my new code, just to assure myself
that what I think is happening really is happening - thinkgs like
executing subroutines, grabbing variables, reading and writing files,
they mostly get an entry in the error_log at first.  I tail the logs
during development but they make pretty dull reading after a while...

There are some good debugging tips in the Guide:

http://perl.apache.org/guide

73,
Ged.





Re: POST without any content - sometimes

2002-02-15 Thread jon schatz

On Fri, 2002-02-15 at 16:07, Ged Haywood wrote:
 [snip,snip]
  to use tcpdump in this case, Any hints?
 
 You can use tcpdump to record the entire conversation between the
 browser and the server.  To find out how to use it you can just type
 'man tcpdump'.  

although tcpdump output isn't very pretty, especially to someone who
isn't familiar with libpcap. you might have better luck with a front-end
to tcpdump. i personally reccomend ethereal (www.ethereal.com), which
runs on *nix and win32. using something like this makes it easier t
-- 
[EMAIL PROTECTED] || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus?: www.divisionbyzero.com/pgp.html
You are in a twisty little maze of Sendmail rules, all confusing. 



signature.asc
Description: This is a digitally signed message part


Re: POST without any content - sometimes

2002-02-15 Thread jon schatz

On Fri, 2002-02-15 at 16:20, jon schatz hit the send button to quickly:
 runs on *nix and win32. using something like this makes it easier t

meant to say makes it easier to see the actual HTTP conversation, not
just the tcp traffic. oops.

-jon

-- 
[EMAIL PROTECTED] || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus?: www.divisionbyzero.com/pgp.html
You are in a twisty little maze of Sendmail rules, all confusing. 



signature.asc
Description: This is a digitally signed message part


Re: POST without any content - sometimes

2002-02-15 Thread Tatsuhiko Miyagawa

On Tue, 12 Feb 2002 20:03:22 +0100
Anders Knuts [EMAIL PROTECTED] wrote:

 xxx.xxx.25.50 - - [10/Feb/2002:21:15:33 +0100] POST
 /cgi-bin/mboard/message.pl HTTP/1.1
 200 88 - Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
 
 xxx.xxx.25.50 - - [10/Feb/2002:21:15:36 +0100] POST
 /cgi-bin/mboard/message.pl HTTP/1.1
 200 1683 http://www.servern.nu/main.html; Mozilla/4.0 (compatible;
 MSIE 5.5; Windows NT 5.0)
 
 The first POST is erronuos as there is no content (-) and the script
 won't accept it as vaild.

If this log's LogFormat is combined,  the field you point means HTTP
Referer, not the content of the POST request. 

 The scond POST is okay as it has content
 (http://www.servern.nu/main.html;).

--
Tatsuhiko Miyagawa [EMAIL PROTECTED]




Re: Mistaken identity problem with cookie

2002-02-15 Thread Mithun Bhattacharya

Dzuy Nguyen wrote:



 I have been getting many reports from our users that they have been 
 mistakenly identified as someone else.
 I have tried to login as that user and just can't re-create the problem 
 and I can't be at their computer to
 diagnose it.  One thing I'm pretty sure about is that they must have 
 gotton someone else's cookie.  Another



Probably your ISP is using one of those buggy cisco cache server. I am 
unfortunate enuff to have faced this problem with one of the largest ISP 
in India which believes that if I dont send a expiry header it is static 
!! The only way around it is setting a $r-no_cache(1) for every HTML 
page. Even then it will take 2-3 days to see whether it worked or not.

http://www.geocrawler.com/mail/thread.php3?subject=%5BLIH%5D+VSNL%27s+transparent+proxylist=11286

http://www.geocrawler.com/mail/msg.php3?msg_id=7678747list=11286



Mithun




Re: POST without any content - sometimes

2002-02-15 Thread Anders Knuts

Yes of course it is referer, my mistake thanx
The _referer_ should be my own server, since it is from where the POST
originate, but in this particular case, from this IP-adress, the referer
disapears sometimes...

/Anders

Tatsuhiko Miyagawa skrev:

 On Tue, 12 Feb 2002 20:03:22 +0100
 Anders Knuts [EMAIL PROTECTED] wrote:

  xxx.xxx.25.50 - - [10/Feb/2002:21:15:33 +0100] POST
  /cgi-bin/mboard/message.pl HTTP/1.1
  200 88 - Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
 
  xxx.xxx.25.50 - - [10/Feb/2002:21:15:36 +0100] POST
  /cgi-bin/mboard/message.pl HTTP/1.1
  200 1683 http://www.servern.nu/main.html; Mozilla/4.0 (compatible;
  MSIE 5.5; Windows NT 5.0)
 
  The first POST is erronuos as there is no content (-) and the script
  won't accept it as vaild.

 If this log's LogFormat is combined,  the field you point means HTTP
 Referer, not the content of the POST request.

  The scond POST is okay as it has content
  (http://www.servern.nu/main.html;).

 --
 Tatsuhiko Miyagawa [EMAIL PROTECTED]