Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Tuesday January 03, 2006
07:52 PM

Can you replicate this Firefox bug?

[ #28222 ]

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?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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
  • 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!
  • https://bugzilla.mozilla.org/show_bug.cgi?id=302294 [mozilla.org]

    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?
  • 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
  • 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).

  • 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