Git Product home page Git Product logo

Comments (5)

laverdet avatar laverdet commented on August 18, 2024

Not sure what the issue would be here.. It's impossible to move this line up, the checks are critical to run before loading the library or memory corruption will occur. If the build is out of date (first check in fibers.js) then require() will segfault.

Can you reproduce on the new node 0.3.7? What are the symptoms of the error?

from node-fibers.

lm1 avatar lm1 commented on August 18, 2024

The issue does not occur in 0.3.7 (recent HEAD), but I can reproduce it with 0.3.6 (current release), with the following test case:

It requires fibers-promise -- sorry.

var fs = require('fs');
var promise = require('fibers-promise');

promise.start(function() {
  //console.log('x');
  var t = promise.t();
  fs.readFile(__filename, 'utf8', t);
  console.log(t.get());
});

It's supposed to print out it's content. Should fail with node 0.3.6 and [email protected]. Failure is just a single line error print referring to run() call in promise.

I don't think it's a bug in promise, because each of the following resolves the issue:

  • Uncommenting console.log call
  • Removing the sanity check from fibers.js
  • Upgrade node to 0.3.7

I think for some reason in 0.3.6 the code gets executed before the fibers are loaded, due to being postponed by sync fs calls. Maybe native module load was scheduled in event loop?

Indeed I didn't consider the check should be performed before load, but from my experience change of node version occurred with failure only at use of fibers not load time.

from node-fibers.

laverdet avatar laverdet commented on August 18, 2024

I couldn't reproduce this, unfortunately. Same results on OS X, and Gentoo Linux (both 64-bit).

$ node -v
v0.3.6

$ cat a.js 
var fs = require('fs');
var promise = require('fibers-promise');

promise.start(function() {
 //console.log('x');
 var t = promise.t();
 fs.readFile(__filename, 'utf8', t);
 console.log(t.get());
});

$ node-fibers a.js 
var fs = require('fs');
var promise = require('fibers-promise');

promise.start(function() {
 //console.log('x');
 var t = promise.t();
 fs.readFile(__filename, 'utf8', t);
 console.log(t.get());
});

Since it doesn't happen anymore in 0.3.7 I'm ok leaving this alone unless you can find a case that reproduces in latest node.

Alternatively, if you have an environment where it reproduces and feel ok giving me access I could look at it on your system, because it's likely very sensitive to the platform, and may be a bug that will come up again.

from node-fibers.

lm1 avatar lm1 commented on August 18, 2024

I've sent login details to your e-mail address.

from node-fibers.

laverdet avatar laverdet commented on August 18, 2024

I believe ab87395 fixed this particular stability issue. Thanks lm1 for the troubleshooting!

from node-fibers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.