Can you replicate this Firefox bug?

Ovid on 2006-01-04T00:52:20

I've been working for hours trying to debug a problem under mod_perl and it's been stumping me. Basically, we have a pseudo-REST interface attempts to return JSON data. We return the JSON as one long string. Unfortunately, it never showed up in the browser even though "warn"ing the data made it show up in the error log.

After verifying that I could just $r->print('something');, I became even more confused. A bit of research revealed that short strings would work, long strings would not. So I came up with this:

# Usage:  http://www.example.com/?4095

sub handler {
    my $r = shift;
    $r->content_type('text/plain');
    my @args = $r->args;
    $r->print('x' x $args[0]);

    return Apache2::Const::OK;
}

That handler will print as many "X" characters as the first number in the query string. Most suspiciously, Firefox stopped rendering as soon as that number hit 2^12, or 4096. I finally created a file on my computer named "ff_test.html" and wrote out 4096 'x's to it. I opened it in Firefox and it rendered fine but the font was different. The I noticed the extension and renamed the file to "ff_test.txt" and reopened it. Bingo! No rendering. Removing a single 'x' allowed it to render.

I can't seem to find a mention of this bug on bugs.mozilla.org. Before I report it, I'm wondering if anyone else has this problem. If so, what platform are you running and what version of Firefox?


Tests OK here

VSarkiss on 2006-01-04T03:09:53

I don't have a problem with either 4095 or 4096 x's using Firefox 1.0.7 on Fedora Core 4

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Confirmed

mroch on 2006-01-04T03:44:41

I can confirm on Firefox 1.5 on Mac.

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

But it works fine on 1.5/Win!

Bugzilla

mroch on 2006-01-04T03:55:53

https://bugzilla.mozilla.org/show_bug.cgi?id=302294

One of the side effects is "invisible text" which appears to be what you ran into. I wonder if Javascript can still get to it, or if that how you found this problem in the first place?

Replicated

ChrisDolan on 2006-01-04T03:59:21

I have replicated the problem, but only if there are 4096 non-newline characters or more in a single line.

Succeeds:
perl -le'print "",("x" x 4095),"\n"' > ! test.txt

Fails:
perl -le'print "",("x" x 4096),"\n"' > ! test.txt

Succeeds:
perl -le'print "",(("x" x 4095),"\n")x2' > ! test.txt

Works here

tirwhan on 2006-01-04T10:51:28

perl -e 'print "X"x8192' > firefoxx.txt

File opens and renders fine in Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.10) Gecko/20050925 Firefox/1.0.4 (opened locally or downloaded from the web).

Re:

Aristotle on 2006-01-04T11:58:52

No. Whether I use 4,096 or 40,960 characters – it always renders.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7