Modernizr/gulp-modernizr

regularly seg faulting

Closed this issue · 3 comments

I'm running the gulp-webserver module with gulp-watch, as well. For some reason, when I run the modernizr task, it seg faults and all processes (server/watcher) stop. This happens about 80% of the time, unless i run the modernizr task separately and cache it (which I can't do if I also have a clean task). The output of the modernizr task, regardless of when the task is run, is sent to stdout after all gulp tasks have finished, and the segfault happens during what seems to be the actual build (the "Building your customized Modernizr" block). Here's the end of the typical output:

...

>> Ready to build using these settings:
>> setClasses, addTest, html5printshiv, testProp, fnBind

Building your customized Modernizr>> Local Npm module "grunt-contrib-connect" not f
ound. Is it installed?
>> Local Npm module "grunt-saucelabs" not found. Is it installed?
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed?
>> Local Npm module "grunt-contrib-nodeunit" not found. Is it installed?
..Segmentation fault: 11

when it works, the build completes, and instead of the two dots and "Segmentation fault" message, it says, as you know, ..........OK.

My gulp modernizr task is simply (in its own commonjs module):

var gulp = require('gulp'),
    modernizr = require('gulp-modernizr'),
    sources = require('./sources');

module.exports = (function() {
  gulp.task('modernizr', function() {
    gulp.src(sources.scripts.concat(sources.scss))
        .pipe(modernizr({
          cache: true,
          dest: './build/js/modernizr.js',
          quiet: true
        }));
  });
})();

If I remove the server and watch tasks but keep the modernizr task, I still segfault most of the time. Every so often I might get a seg fault with the gulp-sass task, but that's pretty rare. It really seems like this is the culprit. Can anyone shed a little bit of light as to why this might happen in this task, and what can be done about it?

Thank you, and let me know if you need any more information.

I got same issue sometimes. It happens rarely, maybe 1 to 10 runs. Pretty much same setup as above.

My build task looks like this:

gulp.task('build', function(cb) {
  runSequence(
    ['wiredep','clean'],
    ['styles','jade','jshint'],
    ['browserify:build'],
    ['useref', 'images', 'fonts', 'copy', 'extras', 'modernizr'],
    'buildSize',
    cb
  );
});

Styles task includes gulp-sass, but I never had seg fault there.

rejas commented

Could you to try out the newly released v2.0.0 and report back if this is still an issue for you?

i think you can probably close this issue; i believe ultimately the segfaulting was due to the gulp watcher with chokidar, iirc; changing it to use polling fixed the segfaulting. at this point in time i'm not longer using modernizr.