Skip to content

received SIGSEGV on rejecting a promise #13782

Closed
@ystskm

Description

@ystskm

I encountered the problem on my app.

Fact:
The sources (1) and (5) occurs SIGSEGV
But (2), (3), (4) hasn't the problem.

Option:
--max_old_space_size=1024 --expose-gc
and the process is forked process by forever.

(*) catch( ... ) part is written only in (1).
(1)

var when = Promise.resolve();
when = when.then(function() {
  return new Promise(function(rsl, rej) {
     rej('THROW ERROR');  // => SIGSEGV
  });
});
when['catch'](function(e){
  console.log(e);
});

(2)

var when = Promise.resolve();
when = when.then(function() {
  return new Promise(function(rsl, rej) {
     rsl();  // => OK
  });
});

(3)

var when = Promise.resolve();
when = when.then(function() {
  return new Promise(function(rsl, rej) {
     process.nextTick(rej);  // => OK
  });
});

(4)

var when = Promise.resolve();
when = when.then(function() {
  return new Promise(function(rsl, rej) {
     setImmediate(rej);  // => OK
  });
});

(5)

var when = Promise.resolve();
when = when.then(function() {
  return new Promise(function(rsl, rej) {
     throw 'THROW ERROR' // => SIGSEGV
  });
});

I wonder when this phenomena will reproduce in what condition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    promisesIssues and PRs related to ECMAScript promises.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions