Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Assertion failed: (handle->flags & UV_CLOSING), function uv__finish_close, file ../deps/uv/src/unix/core.c, line 209. #713

Closed
weichx opened this issue Feb 27, 2015 · 52 comments

Comments

@weichx
Copy link

weichx commented Feb 27, 2015

I am randomly seeing this error when using the importer function. My intention is to treat @import like require(). Here is the offending code:

importer: function (url, prev, done) {
               if(imported[url]) {
                    done({contents: ''});
                } else {
                    imported[url] = true;
                    done({file: url});
                }
            }
@am11
Copy link
Contributor

am11 commented Feb 27, 2015

Yes and I get it with io.js on TravisCI intermittently. There is a race condition in our binding code. On a bright side, it works well (mostly) and the vNext or vNext->Next will fix this issue permanently. Actually this is already fixed in this work-in-progress PR: #644.

@weichx
Copy link
Author

weichx commented Feb 27, 2015

I'll hang tight until that merges then, thanks.

@am11 am11 added this to the Unknown milestone Mar 4, 2015
@am11
Copy link
Contributor

am11 commented Mar 11, 2015

Status: v3.0.0-pre is out but this issue persists, since #644 isn't merged. Meanwhile try out the new API.

@haf
Copy link

haf commented Mar 23, 2015

I'm starting to become a regular in this repository, unwillingly! webpack/webpack#904 - related perhaps?

@jedwards1211
Copy link

Yes, it's related. I had to downgrade to sass-loader 0.5.0 and node-sass 2.0.1, then the error went away. I didn't have any luck with node-sass 3.0.0-alpha.0 either.

Thank you guys for tipping me off to this, I don't think I would have had a clue otherwise!

@jcreamer898
Copy link

Currently seeing this issue still in .beta4.

@wubenhe
Copy link

wubenhe commented Mar 31, 2015

+1 I have to downgrade my sass-loader to 0.3.0.
So that I can use Material UI for react.

@jcreamer898
Copy link

@wubenhe, you might actually be able to use 0.4.2 of the sass-loader that one worked for me. If you run npm info sass-loader you can see all the available versions. They're not all listed on the github site's tag list.

@ShMcK
Copy link

ShMcK commented Apr 1, 2015

@jcreamer898 Thanks! 0.4.2 worked for me!

@tyao1
Copy link

tyao1 commented Apr 1, 2015

+1 Have to downgrade the sass-loader now

@wubenhe
Copy link

wubenhe commented Apr 1, 2015

@jcreamer898 Thanks! 0.4.2 worked for me as well.

@jhnns
Copy link
Contributor

jhnns commented Apr 3, 2015

For all those using the sass-loader:

I've managed to write a version of sass-loader that provides the same features while depending on node-sass 2.1.1. It's on a separate branch and can be installed via npm i [email protected]. Please note, that sass-loader 0.6.0 is listing node-sass as peerDependency as well.

@tyao1
Copy link

tyao1 commented Apr 5, 2015

@jhnns Thank you! But I tried the sass-loader 0.6.0 and the same assertion failed error occurred. 0.4.2 works for me.

@jhnns
Copy link
Contributor

jhnns commented Apr 5, 2015

Seems to be caused by the custom importer feature 😞

@am11
Copy link
Contributor

am11 commented Apr 6, 2015

@jhnns, this is true it happens when using Custom Importers and Custom Functions.
IMO, this is due to one of the two reasons:

  • uv tries to close loop when the resource is still busy: renderSync() doesn't exit the node process if an importer() function is provided. #794 is one symptom. Given our setup, it is hard to spot the exact cause of random hang-ups and different versions of v8 (node -p process.versions.v8 && node -p process.versions.modules) present different behaviour in this regard.
  • Our GC de-allocates vector-of-pointers incorrectly (@matryo, even ctx_w->importers.emtpy() check does not help in such cases).
    • We were doing it wrong by iterating over vector and modifying its state in body.
    • I have changed the behavior using vector of C++11's "smart pointers".
      • I think it will fix most of the issues, but I can still see assertion aborts with MSVCR when compiled with debug configuration (node scripts/build -f -d). I think these assertion failures are related.
      • However, with release configuration it works fine.
    • I have planned few minor fixes after beta5, but can't figure out how to fix those vector related assertion failures for good.

Having said that, beta5 is much more stable as far as this issue is concerned. Please keep posting your experiences.

Note: v3.0.0-beta.5 will be published today shortly afterwards.

Beta5 has been released: https://github.com/sass/node-sass/releases/tag/v3.0.0-beta.5

@vegetableman
Copy link

Thanks @jcreamer898 for the downgrade suggestion. working version: node-sass: 2.0.1 && sass-loader: 0.4.2

@tyao1
Copy link

tyao1 commented Apr 7, 2015

node-sass: 2.1.1 works as well

@sarenji
Copy link

sarenji commented Apr 7, 2015

With beta.5 (and .4), I get either segfaults or these two errors:

Assertion failed: (handle->flags & UV_CLOSING), function uv__finish_close, file ../deps/uv/src/unix/core.c, line 171.
[1]    38326 abort      gulp scss
# or
Assertion failed: (0), function uv__finish_close, file ../deps/uv/src/unix/core.c, line 199.
[1]    38386 abort      gulp scss

Notably, these cease to be a problem the moment I tell gulp-sass to use node-sass's renderSync rather than render. Hope this is helpful!

@jhnns
Copy link
Contributor

jhnns commented Apr 7, 2015

renderSync doesn't use libuv's loop afaik, so yeah, using sync compilation probably solves mitigates the problem...

@quicksnap
Copy link

Also a sass-loader user, tried using 0.6, but still had intermittent failures (~50%). 0.4.2 is working well so far!

@xzyfer
Copy link
Contributor

xzyfer commented Apr 9, 2015

@am11 I've recently bumped into this in beta5 with https://github.com/at-import/node-sass-import-once

@chriseppstein
Copy link
Contributor

This error is making node-sass basically unusable for me.

@am11
Copy link
Contributor

am11 commented Apr 11, 2015

For the people who are seeing this issue in 2.1.1 and not in 2.0.1; both have ditto binaries. I didn't even recompile them! The only diff between two versions is that I moved nan from devDependencies to dependencies. The other advantage of having 2.1.1 over 2.0.1 is that 2.1.1 covers most versions of io.js. So either people are hallucinating or they haven't yet encountered the bug with 2.0.1.

@am11
Copy link
Contributor

am11 commented Apr 11, 2015

@xzyfer, I am unable to reproduce this issue on Windows after running tests suite back to back 10 times with this diff. Normally it chokes in first 3 attempts. It might be a luck thing or it might be the fix. :)

For the record, I reproduce it locally by running node-sass test suite over and over on Linux and Windows. It normally aborts the test runner with Assertion failure in first three four attempts. As far as I can tell, there are no known tangible repro steps for this issue, against which we can debug it properly.

@saper
Copy link
Member

saper commented Apr 13, 2015

Ah, yes. But #854 should fix it I hope.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 13, 2015

It has in my experience
On 13 Apr 2015 20:22, "Marcin Cieślak" [email protected] wrote:

Ah, yes. But #854 #854 should fix
it I hope.


Reply to this email directly or view it on GitHub
#713 (comment).

@hnqso
Copy link

hnqso commented Apr 13, 2015

Same here [email protected] did work with [email protected] but not with [email protected].

@saper
Copy link
Member

saper commented Apr 13, 2015

[email protected] does not seem to accept node-sass betas, but you can try taking #854 from git and see if it helps.Should be compatible with node-sass 3.0.

@hnqso
Copy link

hnqso commented Apr 13, 2015

Thanks @saper! I'll give it a try later.

@saper
Copy link
Member

saper commented Apr 14, 2015

What's interesting, I also noticed this bug on node-sass 2.1.1

@chriseppstein
Copy link
Contributor

This was affecting me about 80% of the time. I pulled the latest and built it and it seems to work great now. No crashes after 40 trial builds. Thank you 😍!

@mingfang
Copy link

This is still happening for me

@saper
Copy link
Member

saper commented Apr 19, 2015

@mingfang which git commit are you at? (Just check with git show HEAD).
Are you using some other module that has node-sass embedded into its own dependencies?

@xzyfer
Copy link
Contributor

xzyfer commented Apr 19, 2015

@mingfang this fix is not in a stable release yet. Please be patient.

@mingfang
Copy link

Thanks for the effort on this.
I've downgraded to a working combinations of node-sass 2.1.1 and sass-loader 0.4.2.

@saper
Copy link
Member

saper commented Apr 19, 2015

2.1.1 has this bug also but it occurs not so often

This was referenced Apr 20, 2015
coopy pushed a commit to coopy/react-quickstart that referenced this issue Apr 21, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Apr 22, 2015

This has been resolved in 3.0.0-beta.7.

npm install node-sass@beta

@jhnns
Copy link
Contributor

jhnns commented Apr 27, 2015

Awesome 👍

@krsmedlund
Copy link

Earlier versions.

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ webpack -c --progress --debug
 55% 231/305 build modules{ file: './_config.scss' }
 65% 302/326 build modules{ file: './_mixins.scss' }
 69% 461/463 build modules{ file: './_config.scss' }
 69% 462/463 build modules{ file: './_mixins.scss' }
Hash: dc1f3d29e0ec30a98d43
Version: webpack 1.8.10
Time: 12752ms
        Asset     Size  Chunks             Chunk Names
   js/main.js   4.7 MB       0  [emitted]  main
css/style.css  1.87 kB       0  [emitted]  main
   [0] multi main 52 bytes {0} [built]
    + 460 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules
Child extract-text-webpack-plugin:
        + 2 hidden modules

Current version

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ webpack -c --progress --debug
 55% 230/306 build modules{ file: './_config.scss' }
{ file: './_config.scss' }
 62% 267/308 build modulesnode: ../deps/uv/src/unix/core.c:209: uv__finish_close: Assertion `handle->flags & UV_CLOSING' failed.
Aborted (core dumped)

git master branch

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ webpack -c --progress --debug
 69% 458/461 build modulesvagrant@vagrant-ubuntu-trusty-64:/vagrant$

So with latest master of today it doesnt core dump just exits silently with no errors and no output, still doesnt produce any files. Removing sass-loader (and thus node-sass) from the build have webpack working as usual.

@saper
Copy link
Member

saper commented Apr 29, 2015

@krsmedlund How can I reproduce this? (no clue about webpack)

jackcompton added a commit to DevTech-ADVISE/react-step-wizard that referenced this issue May 13, 2015
@iroy2000
Copy link

Nice that I see this, I was using "sass-loader": "^0.6.0", and it sometimes work and sometimes not, and very inconsistent. But after bump down the version to "sass-loader": "^0.4.2",, it looks good now. Thanks.

@xzyfer
Copy link
Contributor

xzyfer commented May 15, 2015

This is a known issue in older version of node-sass which sass-loader is using. Unfortunately sass-loader doesn't currently support the stable ^3 release. This needs to be fixed on their end /cc @jhnns

@jhnns
Copy link
Contributor

jhnns commented May 15, 2015

I've just released v1.0.2 which uses [email protected]

@hnqso
Copy link

hnqso commented May 18, 2015

Nice one! Thanks @jhnns :)

vshjxyz added a commit to vshjxyz/es6-react-redux-universal-template that referenced this issue May 19, 2015
@digitalowlnyc
Copy link

Downgrading sass-loader to 0.4.2 worked for me, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests