klei/gulp-inject

Gulp inject: Segmentation Fault

Closed this issue · 1 comments

j1cs commented

I have manjaro linux and I installed nodejs and npm from official repositories
node version: v6.2.1
npm version: 3.9.5

I have the follow configuration:

gulp.task('inject', ['scripts', 'styles'], function () {
  var injectStyles = gulp.src([
    path.join(conf.paths.tmp, '/serve/app/**/*.css'),
    path.join('!' + conf.paths.tmp, '/serve/app/vendor.css')
  ], { read: false });

  var injectScripts = gulp.src([
      path.join(conf.paths.src, '/app/**/*.module.js'),
      path.join(conf.paths.src, '/app/**/*.js'),
      path.join('!' + conf.paths.src, '/app/**/*.spec.js'),
      path.join('!' + conf.paths.src, '/app/**/*.mock.js'),
    ])
    .pipe($.angularFilesort()).on('error', conf.errorHandler('AngularFilesort'));

  var injectOptions = {
    ignorePath: [conf.paths.src, path.join(conf.paths.tmp, '/serve')],
    addRootSlash: false
  };

  return gulp.src(path.join(conf.paths.src, '/*.html'))
    .pipe($.inject(injectStyles, injectOptions))
    .pipe($.inject(injectScripts, injectOptions))
    .pipe(wiredep(_.extend({}, conf.wiredep)))
    .pipe(gulp.dest(path.join(conf.paths.tmp, '/serve')));
});

When I run

$ gulp serve

It display me

[21:36:37] Using gulpfile /home/jics/Documents/Proyect/gulpfile.js
[21:36:37] Starting 'config'...
[21:36:37] Starting 'styles'...
[21:36:37] Finished 'config' after 236 ms
[21:36:37] Starting 'scripts'...
[21:36:37] gulp-inject 30 files into index.scss.
[21:36:39] Finished 'styles' after 2.36 s
[21:36:40] all files 211.97 kB
[21:36:40] Finished 'scripts' after 2.84 s
[21:36:40] Starting 'inject'...
[21:36:40] gulp-inject 1 files into index.html.
Segmentation fault

My coredumctl display me:

           PID: 29909 (gulp)
           UID: 1000 (jics)
           GID: 1000 (jics)
        Signal: 11 (SEGV)
     Timestamp: lun 2016-06-13 18:03:49 CLT (3h 37min ago)
  Command Line: gulp                    
    Executable: /usr/bin/node
 Control Group: /user.slice/user-1000.slice/session-c2.scope
          Unit: session-c2.scope
         Slice: user-1000.slice
       Session: c2
     Owner UID: 1000 (jics)
       Boot ID: 857cb1e6f9134beb91d172fc85f05f36
    Machine ID: 50f47fe8f80b4f92829b61933e8b309e
      Hostname: jics-pc
      Coredump: /var/lib/systemd/coredump/core.gulp.1000.857cb1e6f9134beb91d172fc85f05f36.29909.1465
       Message: Process 29909 (gulp) of user 1000 dumped core.

                Stack trace of thread 29909:
                #0  0x00002080c7ca188c n/a (n/a)

The only why I can run gulp serve with success is deleting de follow line from de configuration file .pipe($.inject(injectScripts, injectOptions))

What if you instead comment out the angularFilesort line? I think it's that plugin that's causing the segmentation fault, and not this one...