Skip Menu |

This queue is for tickets about the CSS-Minifier-XS CPAN distribution.

Report information
The Basics
Id: 36557
Status: resolved
Priority: 0/
Queue: CSS-Minifier-XS

People
Owner: Nobody in particular
Requestors: rkrimen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.02
Fixed in: (no value)



Subject: Nasty segfault on minifying comment-only css input
I was integrating/testing CSS::Minifier::XS with File::Assets and stumbled onto a nasty bug. One of my test cases is a .css file with the simple content: /* Test file "/static/apple.css" */ (containing NO actual css) For some reason, the test was dying with no input. Well, long story short, it turns out CSS::Minifer::XS was segfaulting on comment-only input. Basically, CSS::Minifier::XS::minify("/* */"); segfaults on my machine (perl 5.8). Here is a test file I used: --- #!/usr/bin/perl -w use CSS::Minifier::XS qw/minify/; my $input; $input = <<_END_; /* block comments get removed */ /* comments containing the word "copyright" are left in, though */ /* but all other comments are removed */ _END_ $input = <<_END_; /* */ _END_ print "Before:\n", $input, "\n"; my $output = minify $input; print "After:\n", $output, "\n"; --- Let me know if you need more information Thanks, Rob
On Sat Jun 07 18:52:57 2008, RKRIMEN wrote: Show quoted text
> I was integrating/testing CSS::Minifier::XS with File::Assets and > stumbled onto a nasty bug. > > One of my test cases is a .css file with the simple content: > > /* Test file "/static/apple.css" */ > > (containing NO actual css) > > For some reason, the test was dying with no input. > > Well, long story short, it turns out CSS::Minifer::XS was segfaulting
on Show quoted text
> comment-only input. > > Basically, CSS::Minifier::XS::minify("/* */"); segfaults on my machine > (perl 5.8).
Rob, I've had a run through your test cases and was about to write back and say that I haven't (yet) been able to reproduce the segfault myself, but I then uploaded this to a different machine and tried it there (and *was* able to reproduce the segfault). With Perl-5.8.8 it segfaults, but it runs fine with Perl-5.10.0 (which is what I've got on my regular desktop). I'll have a deeper look into this and will let you know how things turn out.
After being able to reproduce the problem on multiple boxes w/Perl-5.8 installed, I've figured out the cause, fixed it, and rolled a new 0.03 release which I've uploaded to PAUSE. FYI, this bug _also_ affects JavaScript::Minifier::XS, and a new release has been rolled for that too. If you could fire up this new version and let me know if it works better for you, that'd be appreciated.
Subject: Re: [rt.cpan.org #36557] Nasty segfault on minifying comment-only css input
Date: Thu, 17 Jul 2008 11:16:11 -0700
To: bug-CSS-Minifier-XS [...] rt.cpan.org
From: "Robert Krimen" <robertkrimen [...] gmail.com>
Works great, thanks! On Wed, Jul 16, 2008 at 11:48 PM, Graham TerMarsch via RT < bug-CSS-Minifier-XS@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=36557 > > > After being able to reproduce the problem on multiple boxes w/Perl-5.8 > installed, I've figured out the cause, fixed it, and rolled a new 0.03 > release which I've uploaded to PAUSE. > > FYI, this bug _also_ affects JavaScript::Minifier::XS, and a new release > has been rolled for that too. > > If you could fire up this new version and let me know if it works better > for you, that'd be appreciated. >
Thanks for the feedback confirming that it works for you! w00t!