FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » totally WEIRD bug? Firefox caching?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
totally WEIRD bug? Firefox caching? [message #185339] Wed, 19 March 2014 17:25 Go to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
I have TWO IDENTICAL PHP FILES.

They are supposed to display an image got from a database.

One does. The other does not.

It persistently tells me the image is corrupted.

I have even copied one file that works directly over the other. It still
doesn't work.


I have debugged it, got it to output the image to a file and read the
file successfully.

Something on firefox now just assumes its corrupted and won't clear its
cache. I've shut down firefox, Ive changed its name I've clearded its cache.

WTF is going on??



--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185341 is a reply to message #185339] Wed, 19 March 2014 19:06 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
On 19/03/14 18:25, The Natural Philosopher wrote:
> I have TWO IDENTICAL PHP FILES.
>
> They are supposed to display an image got from a database.
>
> One does. The other does not.
>
> It persistently tells me the image is corrupted.
>
> I have even copied one file that works directly over the other. It still
> doesn't work.
>
>
> I have debugged it, got it to output the image to a file and read the
> file successfully.
>
> Something on firefox now just assumes its corrupted and won't clear its
> cache. I've shut down firefox, Ive changed its name I've clearded its
> cache.
>
> WTF is going on??

Could it be charset issues?

--

//Aho
Re: totally WEIRD bug? Firefox caching? [message #185342 is a reply to message #185341] Wed, 19 March 2014 19:32 Go to previous messageGo to next message
Robert Heller is currently offline  Robert Heller
Messages: 60
Registered: December 2010
Karma: 0
Member
At Wed, 19 Mar 2014 20:06:36 +0100 "J.O. Aho" <user(at)example(dot)net> wrote:

>
> On 19/03/14 18:25, The Natural Philosopher wrote:
>> I have TWO IDENTICAL PHP FILES.
>>
>> They are supposed to display an image got from a database.
>>
>> One does. The other does not.
>>
>> It persistently tells me the image is corrupted.
>>
>> I have even copied one file that works directly over the other. It still
>> doesn't work.
>>
>>
>> I have debugged it, got it to output the image to a file and read the
>> file successfully.
>>
>> Something on firefox now just assumes its corrupted and won't clear its
>> cache. I've shut down firefox, Ive changed its name I've clearded its
>> cache.
>>
>> WTF is going on??
>
> Could it be charset issues?

Same or different servers? If different servers, it could be a Apache or PHP
config issue (the 'bad' server would have an incorrect setting somewhere),
probably causing an incorrect content-type: heading or something like that.
(By 'different' servers I am including different *virtual* servers -- eg
something could be wrong in a <VirtualHost>...</VirtualHost> container.)

>

--
Robert Heller -- 978-544-6933 / heller(at)deepsoft(dot)com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments
Re: totally WEIRD bug? Firefox caching? [message #185345 is a reply to message #185339] Wed, 19 March 2014 21:39 Go to previous messageGo to next message
Gabriel is currently offline  Gabriel
Messages: 11
Registered: March 2014
Karma: 0
Junior Member
On 19/03/2014 17:25, The Natural Philosopher wrote:
> I have TWO IDENTICAL PHP FILES.
>
> They are supposed to display an image got from a database.
>
> One does. The other does not.
>
> It persistently tells me the image is corrupted.
>
> I have even copied one file that works directly over the other. It still
> doesn't work.
>
>
> I have debugged it, got it to output the image to a file and read the
> file successfully.
>
> Something on firefox now just assumes its corrupted and won't clear its
> cache. I've shut down firefox, Ive changed its name I've clearded its
> cache.
>
> WTF is going on??
>
>
>

Check the response headers sent for each request, are they both set to
image/jpg or at least the same?

Cheers

Gabe
Re: totally WEIRD bug? Firefox caching? [message #185348 is a reply to message #185341] Wed, 19 March 2014 23:42 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 19/03/14 19:06, J.O. Aho wrote:
> On 19/03/14 18:25, The Natural Philosopher wrote:
>> I have TWO IDENTICAL PHP FILES.
>>
>> They are supposed to display an image got from a database.
>>
>> One does. The other does not.
>>
>> It persistently tells me the image is corrupted.
>>
>> I have even copied one file that works directly over the other. It still
>> doesn't work.
>>
>>
>> I have debugged it, got it to output the image to a file and read the
>> file successfully.
>>
>> Something on firefox now just assumes its corrupted and won't clear its
>> cache. I've shut down firefox, Ive changed its name I've clearded its
>> cache.
>>
>> WTF is going on??
>
> Could it be charset issues?
>
nope. same data, same code.

--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185349 is a reply to message #185342] Wed, 19 March 2014 23:42 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 19/03/14 19:32, Robert Heller wrote:
> At Wed, 19 Mar 2014 20:06:36 +0100 "J.O. Aho" <user(at)example(dot)net> wrote:
>
>>
>> On 19/03/14 18:25, The Natural Philosopher wrote:
>>> I have TWO IDENTICAL PHP FILES.
>>>
>>> They are supposed to display an image got from a database.
>>>
>>> One does. The other does not.
>>>
>>> It persistently tells me the image is corrupted.
>>>
>>> I have even copied one file that works directly over the other. It still
>>> doesn't work.
>>>
>>>
>>> I have debugged it, got it to output the image to a file and read the
>>> file successfully.
>>>
>>> Something on firefox now just assumes its corrupted and won't clear its
>>> cache. I've shut down firefox, Ive changed its name I've clearded its
>>> cache.
>>>
>>> WTF is going on??
>>
>> Could it be charset issues?
>
> Same or different servers? If different servers, it could be a Apache or PHP
> config issue (the 'bad' server would have an incorrect setting somewhere),
> probably causing an incorrect content-type: heading or something like that.
> (By 'different' servers I am including different *virtual* servers -- eg
> something could be wrong in a <VirtualHost>...</VirtualHost> container.)
>
same server, same code, same data

>>
>


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185350 is a reply to message #185345] Wed, 19 March 2014 23:43 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 19/03/14 21:39, Gabe wrote:
> On 19/03/2014 17:25, The Natural Philosopher wrote:
>> I have TWO IDENTICAL PHP FILES.
>>
>> They are supposed to display an image got from a database.
>>
>> One does. The other does not.
>>
>> It persistently tells me the image is corrupted.
>>
>> I have even copied one file that works directly over the other. It still
>> doesn't work.
>>
>>
>> I have debugged it, got it to output the image to a file and read the
>> file successfully.
>>
>> Something on firefox now just assumes its corrupted and won't clear its
>> cache. I've shut down firefox, Ive changed its name I've clearded its
>> cache.
>>
>> WTF is going on??
>>
>>
>>
>
> Check the response headers sent for each request, are they both set to
> image/jpg or at least the same?
>
they are. Image/png
same headers, same code, same data, same website, same server.

> Cheers
>
> Gabe


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185351 is a reply to message #185339] Thu, 20 March 2014 01:34 Go to previous messageGo to next message
Richard Yates is currently offline  Richard Yates
Messages: 86
Registered: September 2013
Karma: 0
Member
On Wed, 19 Mar 2014 17:25:56 +0000, The Natural Philosopher
<tnp(at)invalid(dot)invalid> wrote:

> I have TWO IDENTICAL PHP FILES.
>
> They are supposed to display an image got from a database.
>
> One does. The other does not.
>
> It persistently tells me the image is corrupted.
>
> I have even copied one file that works directly over the other. It still
> doesn't work.
>
>
> I have debugged it, got it to output the image to a file and read the
> file successfully.
>
> Something on firefox now just assumes its corrupted and won't clear its
> cache. I've shut down firefox, Ive changed its name I've clearded its cache.
>
> WTF is going on??

Have you directly compared them with something like CSDiff?

[ http://www.componentsoftware.com/products/CSDiff/ ]
Re: totally WEIRD bug? Firefox caching? [message #185353 is a reply to message #185351] Thu, 20 March 2014 03:10 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 20/03/14 01:34, Richard Yates wrote:
> On Wed, 19 Mar 2014 17:25:56 +0000, The Natural Philosopher
> <tnp(at)invalid(dot)invalid> wrote:
>
>> I have TWO IDENTICAL PHP FILES.
>>
>> They are supposed to display an image got from a database.
>>
>> One does. The other does not.
>>
>> It persistently tells me the image is corrupted.
>>
>> I have even copied one file that works directly over the other. It still
>> doesn't work.
>>
>>
>> I have debugged it, got it to output the image to a file and read the
>> file successfully.
>>
>> Something on firefox now just assumes its corrupted and won't clear its
>> cache. I've shut down firefox, Ive changed its name I've clearded its cache.
>>
>> WTF is going on??
>
> Have you directly compared them with something like CSDiff?
>
> [ http://www.componentsoftware.com/products/CSDiff/ ]
>
I dont run windoes

--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185357 is a reply to message #185353] Thu, 20 March 2014 04:26 Go to previous messageGo to next message
Richard Yates is currently offline  Richard Yates
Messages: 86
Registered: September 2013
Karma: 0
Member
On Thu, 20 Mar 2014 03:10:32 +0000, The Natural Philosopher
<tnp(at)invalid(dot)invalid> wrote:

> On 20/03/14 01:34, Richard Yates wrote:
>> On Wed, 19 Mar 2014 17:25:56 +0000, The Natural Philosopher
>> <tnp(at)invalid(dot)invalid> wrote:
>>
>>> I have TWO IDENTICAL PHP FILES.
>>>
>>> They are supposed to display an image got from a database.
>>>
>>> One does. The other does not.
>>>
>>> It persistently tells me the image is corrupted.
>>>
>>> I have even copied one file that works directly over the other. It still
>>> doesn't work.
>>>
>>>
>>> I have debugged it, got it to output the image to a file and read the
>>> file successfully.
>>>
>>> Something on firefox now just assumes its corrupted and won't clear its
>>> cache. I've shut down firefox, Ive changed its name I've clearded its cache.
>>>
>>> WTF is going on??
>>
>> Have you directly compared them with something like CSDiff?
>>
>> [ http://www.componentsoftware.com/products/CSDiff/ ]
>>
> I dont run windoes

Is there nothing like it for your OS?
Re: totally WEIRD bug? Firefox caching? [message #185359 is a reply to message #185350] Thu, 20 March 2014 08:29 Go to previous messageGo to next message
Gabriel is currently offline  Gabriel
Messages: 11
Registered: March 2014
Karma: 0
Junior Member
On 19/03/2014 23:43, The Natural Philosopher wrote:
> On 19/03/14 21:39, Gabe wrote:
>> On 19/03/2014 17:25, The Natural Philosopher wrote:
>>> I have TWO IDENTICAL PHP FILES.
>>>
>>> They are supposed to display an image got from a database.
>>>
>>> One does. The other does not.
>>>
>>> It persistently tells me the image is corrupted.
>>>
>>> I have even copied one file that works directly over the other. It still
>>> doesn't work.
>>>
>>>
>>> I have debugged it, got it to output the image to a file and read the
>>> file successfully.
>>>
>>> Something on firefox now just assumes its corrupted and won't clear its
>>> cache. I've shut down firefox, Ive changed its name I've clearded its
>>> cache.
>>>
>>> WTF is going on??
>>>
>>>
>>>
>>
>> Check the response headers sent for each request, are they both set to
>> image/jpg or at least the same?
>>
> they are. Image/png
> same headers, same code, same data, same website, same server.
>
>> Cheers
>>
>> Gabe
>

You seem pretty certain it is firefox's issue. Did you try another
browser or completely deleting your user profile from Firefox?

How about outputting cache control headres like the following that I
ripped off the PHP site?
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
Re: totally WEIRD bug? Firefox caching? [message #185361 is a reply to message #185339] Thu, 20 March 2014 09:13 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Am 19.03.2014 18:25, schrieb The Natural Philosopher:

> I have TWO IDENTICAL PHP FILES.
>
> They are supposed to display an image got from a database.
>
> One does. The other does not.
>
> It persistently tells me the image is corrupted.
>
> I have even copied one file that works directly over the other. It still
> doesn't work.
>
>
> I have debugged it, got it to output the image to a file and read the
> file successfully.

What means "read successfully"? Is it a valid image? Is the response
from the server valid?

> Something on firefox now just assumes its corrupted and won't clear its
> cache. I've shut down firefox, Ive changed its name I've clearded its cache.

Firefox offers to option to clear the cache - no need to shut it down or
to rename the file.

> WTF is going on??

Either Firefox once got an invalid image and cached the response or the
server does not respond the way you think. Maybe a BOM in the PHP file?
This may not be visible in your editor, but it can cause all sort of
problems.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: totally WEIRD bug? Firefox caching? [message #185365 is a reply to message #185357] Thu, 20 March 2014 11:13 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 20/03/14 04:26, Richard Yates wrote:
> On Thu, 20 Mar 2014 03:10:32 +0000, The Natural Philosopher
> <tnp(at)invalid(dot)invalid> wrote:
>
>> On 20/03/14 01:34, Richard Yates wrote:
>>> On Wed, 19 Mar 2014 17:25:56 +0000, The Natural Philosopher
>>> <tnp(at)invalid(dot)invalid> wrote:
>>>
>>>> I have TWO IDENTICAL PHP FILES.
>>>>
>>>> They are supposed to display an image got from a database.
>>>>
>>>> One does. The other does not.
>>>>
>>>> It persistently tells me the image is corrupted.
>>>>
>>>> I have even copied one file that works directly over the other. It still
>>>> doesn't work.
>>>>
>>>>
>>>> I have debugged it, got it to output the image to a file and read the
>>>> file successfully.
>>>>
>>>> Something on firefox now just assumes its corrupted and won't clear its
>>>> cache. I've shut down firefox, Ive changed its name I've clearded its cache.
>>>>
>>>> WTF is going on??
>>>
>>> Have you directly compared them with something like CSDiff?
>>>
>>> [ http://www.componentsoftware.com/products/CSDiff/ ]
>>>
>> I dont run windoes
>
> Is there nothing like it for your OS?
>
diff



--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185366 is a reply to message #185361] Thu, 20 March 2014 11:26 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 20/03/14 09:13, Arno Welzel wrote:
> Am 19.03.2014 18:25, schrieb The Natural Philosopher:
>
>> I have TWO IDENTICAL PHP FILES.
>>
>> They are supposed to display an image got from a database.
>>
>> One does. The other does not.
>>
>> It persistently tells me the image is corrupted.
>>
>> I have even copied one file that works directly over the other. It still
>> doesn't work.
>>
>>
>> I have debugged it, got it to output the image to a file and read the
>> file successfully.
>
> What means "read successfully"? Is it a valid image? Is the response
> from the server valid?

Thanks for all the replies because finally I found a permissions
difference and although I dont completely understand why it is
happening, I know WHAT is happening.

What is happning - and oddly running it against a test version of IE6 in
my XP VM showed it up, was that it was outputting a '404 file not found'
text BEFORE outputting perfectly valid PNG.

Why this is happening is a bug somewhere else completely.

IE 6 simply showed the text and the binary gobbledygook which was the
clue I needed.

How this has happened will take me some time to understand because the
line that says '404 not found' is followed - or I thought it was - by
an exit(); statement.

> Either Firefox once got an invalid image and cached the response or the
> server does not respond the way you think. Maybe a BOM in the PHP file?
> This may not be visible in your editor, but it can cause all sort of
> problems.
>
>
Firefox makes it hard to debug because it DOES cache bad results: I
usually fix that by sending random nonsensical GET parameters which are
ignored to ensure it thinks its a different URL each time.

It a huge minus against firefox that it didn't - even using the
debugging console - show me what was really going on, whereas IE6 did.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185368 is a reply to message #185366] Thu, 20 March 2014 12:43 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 3/20/2014 7:26 AM, The Natural Philosopher wrote:
> On 20/03/14 09:13, Arno Welzel wrote:
>> Am 19.03.2014 18:25, schrieb The Natural Philosopher:
>>
>>> I have TWO IDENTICAL PHP FILES.
>>>
>>> They are supposed to display an image got from a database.
>>>
>>> One does. The other does not.
>>>
>>> It persistently tells me the image is corrupted.
>>>
>>> I have even copied one file that works directly over the other. It still
>>> doesn't work.
>>>
>>>
>>> I have debugged it, got it to output the image to a file and read the
>>> file successfully.
>>
>> What means "read successfully"? Is it a valid image? Is the response
>> from the server valid?
>
> Thanks for all the replies because finally I found a permissions
> difference and although I dont completely understand why it is
> happening, I know WHAT is happening.
>
> What is happning - and oddly running it against a test version of IE6 in
> my XP VM showed it up, was that it was outputting a '404 file not found'
> text BEFORE outputting perfectly valid PNG.
>
> Why this is happening is a bug somewhere else completely.
>
> IE 6 simply showed the text and the binary gobbledygook which was the
> clue I needed.
>
> How this has happened will take me some time to understand because the
> line that says '404 not found' is followed - or I thought it was - by
> an exit(); statement.
>
>> Either Firefox once got an invalid image and cached the response or the
>> server does not respond the way you think. Maybe a BOM in the PHP file?
>> This may not be visible in your editor, but it can cause all sort of
>> problems.
>>
>>
> Firefox makes it hard to debug because it DOES cache bad results: I
> usually fix that by sending random nonsensical GET parameters which are
> ignored to ensure it thinks its a different URL each time.
>
> It a huge minus against firefox that it didn't - even using the
> debugging console - show me what was really going on, whereas IE6 did.
>
>

Firefox with the web developer extensions will show you EXACTLY what's
going on. But you have to know enough to understand the request and
response headers.

Additionally, you can just clear the cache in Firefox. It's quite easy
to do.


--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
Re: totally WEIRD bug? Firefox caching? [message #185371 is a reply to message #185366] Thu, 20 March 2014 14:53 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Am 20.03.2014 12:26, schrieb The Natural Philosopher:

> On 20/03/14 09:13, Arno Welzel wrote:
>> Am 19.03.2014 18:25, schrieb The Natural Philosopher:
>>
>>> I have TWO IDENTICAL PHP FILES.
>>>
>>> They are supposed to display an image got from a database.
>>>
>>> One does. The other does not.
>>>
>>> It persistently tells me the image is corrupted.
>>>
>>> I have even copied one file that works directly over the other. It still
>>> doesn't work.
[...]
> What is happning - and oddly running it against a test version of IE6 in
> my XP VM showed it up, was that it was outputting a '404 file not found'
> text BEFORE outputting perfectly valid PNG.
>
> Why this is happening is a bug somewhere else completely.
>
> IE 6 simply showed the text and the binary gobbledygook which was the
> clue I needed.

Yes, because IE 6 assumes the user may not understand a server generated
error message and shows its own message as long as the reponse is below
a certain size limit (AFAIR less than 4000 bytes, but i may not remember
correctly). This is even more annoying - sometimes you see the message
from IE itself and sometimes

> How this has happened will take me some time to understand because the
> line that says '404 not found' is followed - or I thought it was - by
> an exit(); statement.
>
>> Either Firefox once got an invalid image and cached the response or the
>> server does not respond the way you think. Maybe a BOM in the PHP file?
>> This may not be visible in your editor, but it can cause all sort of
>> problems.
>>
>>
> Firefox makes it hard to debug because it DOES cache bad results: I
> usually fix that by sending random nonsensical GET parameters which are
> ignored to ensure it thinks its a different URL each time.
>
> It a huge minus against firefox that it didn't - even using the
> debugging console - show me what was really going on, whereas IE6 did.

You should learn to read HTTP response headers in the developer console
of Firefox. When I open <http://arnowelzel.de/wiki/en/tools/rwinfo>
there the developer console of Firefox tells me EXACTLY what is going on:

1) The server responded with a status code 404 (not found)

2) The response contains a number of headers which are also displayed




--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: totally WEIRD bug? Firefox caching? [message #185372 is a reply to message #185371] Thu, 20 March 2014 18:39 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 20/03/14 14:53, Arno Welzel wrote:
> Am 20.03.2014 12:26, schrieb The Natural Philosopher:
>
>> On 20/03/14 09:13, Arno Welzel wrote:
>>> Am 19.03.2014 18:25, schrieb The Natural Philosopher:
>>>
>>>> I have TWO IDENTICAL PHP FILES.
>>>>
>>>> They are supposed to display an image got from a database.
>>>>
>>>> One does. The other does not.
>>>>
>>>> It persistently tells me the image is corrupted.
>>>>
>>>> I have even copied one file that works directly over the other. It still
>>>> doesn't work.
> [...]
>> What is happning - and oddly running it against a test version of IE6 in
>> my XP VM showed it up, was that it was outputting a '404 file not found'
>> text BEFORE outputting perfectly valid PNG.
>>
>> Why this is happening is a bug somewhere else completely.
>>
>> IE 6 simply showed the text and the binary gobbledygook which was the
>> clue I needed.
>
> Yes, because IE 6 assumes the user may not understand a server generated
> error message and shows its own message as long as the reponse is below
> a certain size limit (AFAIR less than 4000 bytes, but i may not remember
> correctly). This is even more annoying - sometimes you see the message
> from IE itself and sometimes
>
>> How this has happened will take me some time to understand because the
>> line that says '404 not found' is followed - or I thought it was - by
>> an exit(); statement.
>>
>>> Either Firefox once got an invalid image and cached the response or the
>>> server does not respond the way you think. Maybe a BOM in the PHP file?
>>> This may not be visible in your editor, but it can cause all sort of
>>> problems.
>>>
>>>
>> Firefox makes it hard to debug because it DOES cache bad results: I
>> usually fix that by sending random nonsensical GET parameters which are
>> ignored to ensure it thinks its a different URL each time.
>>
>> It a huge minus against firefox that it didn't - even using the
>> debugging console - show me what was really going on, whereas IE6 did.
>
> You should learn to read HTTP response headers in the developer console
> of Firefox. When I open <http://arnowelzel.de/wiki/en/tools/rwinfo>
> there the developer console of Firefox tells me EXACTLY what is going on:
>
> 1) The server responded with a status code 404 (not found)
>

The problem is that it didn't send an error code in the header

It sent a valid header, the some error text, and then the PNG

I generate all my own headers so there's a strange bug somewhere, but at
least I know where to look.


> 2) The response contains a number of headers which are also displayed
>
>
>
>


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185380 is a reply to message #185372] Fri, 21 March 2014 07:33 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
The Natural Philosopher, 2014-03-20 19:39:

> On 20/03/14 14:53, Arno Welzel wrote:
>> Am 20.03.2014 12:26, schrieb The Natural Philosopher:
>>
>>> On 20/03/14 09:13, Arno Welzel wrote:
>>>> Am 19.03.2014 18:25, schrieb The Natural Philosopher:
>>>>
>>>> > I have TWO IDENTICAL PHP FILES.
>>>> >
>>>> > They are supposed to display an image got from a database.
>>>> >
>>>> > One does. The other does not.
>>>> >
>>>> > It persistently tells me the image is corrupted.
>>>> >
>>>> > I have even copied one file that works directly over the other. It still
>>>> > doesn't work.
>> [...]
>>> What is happning - and oddly running it against a test version of IE6 in
>>> my XP VM showed it up, was that it was outputting a '404 file not found'
>>> text BEFORE outputting perfectly valid PNG.
>>>
>>> Why this is happening is a bug somewhere else completely.
>>>
>>> IE 6 simply showed the text and the binary gobbledygook which was the
>>> clue I needed.
>>
>> Yes, because IE 6 assumes the user may not understand a server generated
>> error message and shows its own message as long as the reponse is below
>> a certain size limit (AFAIR less than 4000 bytes, but i may not remember
>> correctly). This is even more annoying - sometimes you see the message
>> from IE itself and sometimes
>>
>>> How this has happened will take me some time to understand because the
>>> line that says '404 not found' is followed - or I thought it was - by
>>> an exit(); statement.
>>>
>>>> Either Firefox once got an invalid image and cached the response or the
>>>> server does not respond the way you think. Maybe a BOM in the PHP file?
>>>> This may not be visible in your editor, but it can cause all sort of
>>>> problems.
>>>>
>>>>
>>> Firefox makes it hard to debug because it DOES cache bad results: I
>>> usually fix that by sending random nonsensical GET parameters which are
>>> ignored to ensure it thinks its a different URL each time.
>>>
>>> It a huge minus against firefox that it didn't - even using the
>>> debugging console - show me what was really going on, whereas IE6 did.
>>
>> You should learn to read HTTP response headers in the developer console
>> of Firefox. When I open <http://arnowelzel.de/wiki/en/tools/rwinfo>
>> there the developer console of Firefox tells me EXACTLY what is going on:
>>
>> 1) The server responded with a status code 404 (not found)
>>
>
> The problem is that it didn't send an error code in the header
> It sent a valid header, the some error text, and then the PNG

In this case you can't blame Firefox - Firefox behaved correctly. It got
a response but WITHOUT status 404. So it cached the response and
displayed the result. Even though the result was not a valid image -
it's not the fault of Firefox when the server sends garbish and declares
that garbish to be a PNG image without any hint that something went
wrong (HTTP status 4xx or 5xx etc.).

On the other hand it looks like IE6 handled the response from the server
as HTML even though a MIME header was present that clearly states the
content is an image.

Well - in that particular case it may helped to find the problem. But
technically IE6 is broken anyway. I assume IE6 did not see a ".png" etc.
in the URL and since the response contained some text which *may* be
HTML (or text) it decided to treat the content as HTML (or text) and
just ignore the MIME-Type in the header.

And finally - neither Firefox nor IE6 are debugging tools - they are
browsers. But Firefox still offers many helpful tools to find errors,
where IE6 doesn't.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: totally WEIRD bug? Firefox caching? [message #185385 is a reply to message #185372] Sat, 22 March 2014 06:24 Go to previous messageGo to next message
Nisse Engström is currently offline  Nisse Engström
Messages: 1
Registered: March 2014
Karma: 0
Junior Member
On Thu, 20 Mar 2014 18:39:10 +0000, The Natural Philosopher wrote:

> The problem is that it didn't send an error code in the header
>
> It sent a valid header, the some error text, and then the PNG
>
> I generate all my own headers so there's a strange bug somewhere, but at
> least I know where to look.

I don't know if it is relevant, but there's a long standing bug
in Apache where it sends its own HTTP response after the output
of an NPH-scipt. If I recall correctly.


/Nisse
Re: totally WEIRD bug? Firefox caching? [message #185387 is a reply to message #185385] Sat, 22 March 2014 12:10 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 22/03/14 06:24, Nisse Engström wrote:
> On Thu, 20 Mar 2014 18:39:10 +0000, The Natural Philosopher wrote:
>
>> The problem is that it didn't send an error code in the header
>>
>> It sent a valid header, the some error text, and then the PNG
>>
>> I generate all my own headers so there's a strange bug somewhere, but at
>> least I know where to look.
>
> I don't know if it is relevant, but there's a long standing bug
> in Apache where it sends its own HTTP response after the output
> of an NPH-scipt. If I recall correctly.
>

Mmm.

I took a break from coding after tearing my hair out on this one. So I
still haven't tracked it down to the bottom. I needed to step back and
look at the authorisation mechanisms which were getting so complicated
even I didn't entirely understand them, and write some documentation on
them and construct some state machine charts so that I could look at
them and construct the right conditional tests for a 2D matrix of
authorisation possibilities.

Because the problem had two aspects - firstly it was failing
authorisation when it shouldn't, and secondly it wasn't behaving
correctly for refused authorisation.


But I will bear that in mind.

And thanks to all those who prompted things that were in fact the wrong
answers, because in the end that led me to the right answer.




>
> /Nisse
>


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: totally WEIRD bug? Firefox caching? [message #185389 is a reply to message #185387] Sat, 22 March 2014 15:48 Go to previous messageGo to next message
Robert Heller is currently offline  Robert Heller
Messages: 60
Registered: December 2010
Karma: 0
Member
At Sat, 22 Mar 2014 12:10:00 +0000 The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:

>
> On 22/03/14 06:24, Nisse Engström wrote:
>> On Thu, 20 Mar 2014 18:39:10 +0000, The Natural Philosopher wrote:
>>
>>> The problem is that it didn't send an error code in the header
>>>
>>> It sent a valid header, the some error text, and then the PNG
>>>
>>> I generate all my own headers so there's a strange bug somewhere, but at
>>> least I know where to look.
>>
>> I don't know if it is relevant, but there's a long standing bug
>> in Apache where it sends its own HTTP response after the output
>> of an NPH-scipt. If I recall correctly.
>>
>
> Mmm.
>
> I took a break from coding after tearing my hair out on this one. So I
> still haven't tracked it down to the bottom. I needed to step back and
> look at the authorisation mechanisms which were getting so complicated
> even I didn't entirely understand them, and write some documentation on
> them and construct some state machine charts so that I could look at
> them and construct the right conditional tests for a 2D matrix of
> authorisation possibilities.
>
> Because the problem had two aspects - firstly it was failing
> authorisation when it shouldn't, and secondly it wasn't behaving
> correctly for refused authorisation.
>
>
> But I will bear that in mind.
>
> And thanks to all those who prompted things that were in fact the wrong
> answers, because in the end that led me to the right answer.

Standard scientific methology -- one learns as much from 'failed' experiments
as from successful experiments. Also: "Once you have eliminated the
impossible, whatever is left, however improbable, is the answer." (Or
something like that) -- quoted from a well know fictional character...

>
>
>
>
>>
>> /Nisse
>>
>
>

--
Robert Heller -- 978-544-6933 / heller(at)deepsoft(dot)com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments
Re: totally WEIRD bug? Firefox caching? [message #185390 is a reply to message #185389] Sat, 22 March 2014 18:08 Go to previous message
Doug Miller is currently offline  Doug Miller
Messages: 171
Registered: August 2011
Karma: 0
Senior Member
Robert Heller <heller(at)deepsoft(dot)com> wrote in news:
_aadnfFhz7t_LbDOnZ2dnUVZ_j2dnZ2d(at)giganews(dot)com:

> At Sat, 22 Mar 2014 12:10:00 +0000 The Natural Philosopher <tnp(at)invalid(dot)invalid> wrote:
>
>>
>> On 22/03/14 06:24, Nisse Engström wrote:
>>> On Thu, 20 Mar 2014 18:39:10 +0000, The Natural Philosopher wrote:
>>>
>>>> The problem is that it didn't send an error code in the header
>>>>
>>>> It sent a valid header, the some error text, and then the PNG
>>>>
>>>> I generate all my own headers so there's a strange bug somewhere, but at
>>>> least I know where to look.
>>>
>>> I don't know if it is relevant, but there's a long standing bug
>>> in Apache where it sends its own HTTP response after the output
>>> of an NPH-scipt. If I recall correctly.
>>>
>>
>> Mmm.
>>
>> I took a break from coding after tearing my hair out on this one. So I
>> still haven't tracked it down to the bottom. I needed to step back and
>> look at the authorisation mechanisms which were getting so complicated
>> even I didn't entirely understand them, and write some documentation on
>> them and construct some state machine charts so that I could look at
>> them and construct the right conditional tests for a 2D matrix of
>> authorisation possibilities.
>>
>> Because the problem had two aspects - firstly it was failing
>> authorisation when it shouldn't, and secondly it wasn't behaving
>> correctly for refused authorisation.
>>
>>
>> But I will bear that in mind.
>>
>> And thanks to all those who prompted things that were in fact the wrong
>> answers, because in the end that led me to the right answer.
>
> Standard scientific methology -- one learns as much from 'failed' experiments
> as from successful experiments. Also: "Once you have eliminated the
> impossible, whatever is left, however improbable, is the answer." (Or
> something like that) -- quoted from a well know fictional character...
>
When you have eliminated the impossible, whatever remains, however improbable, must
be the truth.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: sqlite2 vs sqlite3
Next Topic: willing to hire someone who knows both JS and PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 20:34:33 GMT 2024

Total time taken to generate the page: 0.02171 seconds