Re: SetCookie causing Server Error

From: Date: Wed, 24 Nov 1999 21:14:41 +0000
Subject: Re: SetCookie causing Server Error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-13088@lists.php.net to get a copy of this message
On 24 Nov 99, at 8:40, Joey Smith wrote: > What happens when you run this from the command line? Excellent question. I spent so much time trying to reliably reproduce the error that I didn't think to take that step once I had. The output looks like this: Set-Cookie: asdf=a%253A11%253A%257Bi%253A0%253Bs%253A2%253A%252211%2522%253Bi%25 3A22%253Bi%253A1%253Bi%253A17%253Bi%253A1%253Bi%253A20%253Bi%253A1%253Bi%253A24% 253Bi%253A1%253Bi%253A26%253Bi%253A1%253Bi%253A25%253Bi%253A1%253Bi%253A23%253Bi %253A1%253Bi%253A21%253Bi%253A1%253Bi%253A19%253Bi%253A1%253Bi%253A16%253Bi%253A 1%253B%257D Segmentation fault (core dumped) So it's actually sending the cookie, but crashing before returning from setcookie(). But why is it so sensitive the the name and contents of the cookie? I know just barely enough about gdb to get a backtrace, as follows: #0 0x400b73c2 in ?? () from /lib/libc.so.6 #1 0x4010f3fc in ?? () from /lib/libc.so.6 #2 0x400b7281 in ?? () from /lib/libc.so.6 #3 0x805fcc9 in _efree (ptr=0x80f2a38) at alloc.c:173 #4 0x806f0b4 in _php3_SetCookie (name=0x80f3240 "asdf", value=0x80f2d00 "a%3A11%3A%7Bi%3A0%3Bs%3A2%3A%2211%22%3Bi%3A22 %3Bi%3A1%3Bi%3A17%3Bi%3A1%3Bi%3A20%3Bi%3A1%3Bi% 3A24%3Bi%3A1%3Bi%3A26%3Bi%3A1%3Bi%3A25%3Bi%3A1% 3Bi%3A23%3Bi%3A1%3Bi%3A21%3Bi%3A1%3Bi%3A19%3Bi%3 A1%3Bi%3A16%3"..., expires=0, path=0x0, domain=0x0, secure=0) at functions/head.c:530 #5 0x806f1c7 in php3_SetCookie (ht=0x80e7188, return_value=0x80aee78, list=0x80bfd8c, plist=0x80bfd60) at functions/head.c:574 #6 0x80530a4 in phpparse () at control_structures_inline.h:934 #7 0x805988f in php3_parse (yyin=0x80d35d8) at main.c:1548 #8 0x805a04e in main (argc=3, argv=0xbffffd14) at main.c:1862 Now what? Thanks, Dave > > On Mon, 22 Nov 1999, Dave Walton wrote: > > > Hey folks... > > > > I've run into a nasty problem that I really need some help tracking > > down. In some cases, SetCookie is causing a Server Error. I'm > > running 3.0.12 as a CGI under Apache 1.3.9. error_log reports > > "Premature end of script headers". > > > > I've set up a test script at > > http://www.opelclub.com/badcookie.php3 > > to demonstrate the problem. That script does a show_source() on > > itself, and provides links to set cookies in a variety of different > > ways. It uses two different cookie names, two different cookie > > values, and two different methods of setting cookies, giving a total > > of eight tests. Exactly one of those tests (2a) causes a server > > error, even though every element of that test is used successfully > > in other tests. > > > > Oddly enough, test 2a was shown to work on another 1.3.9/3.0.12- > > CGI server. But for all I know, a slightly different set of options > > would have triggered the error on that server. > > > > Help? > > > > (Please CC: me, as I am not currently subscribed.) > > > > Dave > > > > > > > > ---------------------------------------------------------------------- > > Dave Walton > > Webmaster Opel Motorsport Club > > webmaster@opelclub.com > > http://www.opelclub.com > > ---------------------------------------------------------------------- > > > > -- > > PHP Development Mailing List <http://www.php.net/> > > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > > For additional commands, e-mail: php-dev-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > ---------------------------------------------------------------------- Dave Walton Webmaster Opel Motorsport Club webmaster@opelclub.com http://www.opelclub.com ----------------------------------------------------------------------

« previous php.dev (#13088) next »