laverdet/node-fibers — Issue #50: Error if fibers gets re-required
Author: scriby
Created: 2012-01-26 21:38:05+00:00
State: open

Hi,

A funny issue cropped up today. Someone had a node.js program set up that required asyncblock normally, and then had a place in code that required it with camel case (asyncBlock). It was on a mac, so the 2nd require worked, but it crashed the app because of a fibers error:

Assertion failed: (!stack_size), function set_stack_size, file coroutine.cc, line 45.

Looking through the fibers code, it looks like set_stack_size isn't happy when it gets called twice. It looks like init was getting called again from the asyncBlock require.

You can reproduce this issue with just fibers by the following on a mac / case insensitive file system:

require('fibers');
require('FIBERS');