Skip to content

setTimeout(function(){throw null},0) crashes toplevel #12373

Description

@DemiMarie
  • Version: v6.10.0
  • Platform: Linux localhost.hsd1.tn.comcast.net 4.10.8-200.fc25.x86_64 #1 SMP Fri Mar 31 13:20:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: timer

If I run

setTimeout(function() { throw null }, 0)

the REPL crashes with

TypeError: Cannot read property 'stack' of null
    at Domain.<anonymous> (repl.js:392:17)
    at emitOne (events.js:96:13)
    at Domain.emit (events.js:188:7)
    at Domain._errorHandler (domain.js:97:23)
    at process._fatalException (bootstrap_node.js:293:33)

Obviously such code is buggy (and would normally cause a crash). However, I don’t think that it should crash the toplevel, hence this report.

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    on Apr 12, 2017
  2. vsemozhetbyt commented on Apr 12, 2017

    @vsemozhetbyt
    Contributor

    Can reproduce on Windows with 8.0.0rc:

    > repl.js:291
        } else if (e.stack && self.replMode === exports.REPL_MODE_STRICT) {
                    ^
    
    TypeError: Cannot read property 'stack' of null
        at Domain.debugDomainError (repl.js:291:17)
        at emitOne (events.js:115:13)
        at Domain.emit (events.js:210:7)
        at Domain._errorHandler (domain.js:118:23)
        at process._fatalException (bootstrap_node.js:311:33)
    
  3. added
    confirmed-bugIssues and PRs for confirmed bugs.
    good first issueIssues that are suitable for first-time contributors.
    on Apr 12, 2017
  4. refack commented on Apr 12, 2017

    @refack
    Contributor

    repro on Windows with v4 v6, v7, v8, Ubuntu v7

  5. added
    domainIssues and PRs related to the domain subsystem.
    and removed
    good first issueIssues that are suitable for first-time contributors.
    on Apr 13, 2017
  6. Fishrock123 commented on Apr 13, 2017

    @Fishrock123
    Contributor

    Looks like a domain thing? I'm removing good first contrib because I feel like this won't be particularly clear.

  7. refack commented on Apr 13, 2017

    @refack
    Contributor

    Looks like a domain thing? I'm removing good first contrib because I feel like this won't be particularly clear

    IMHO just needs an e && as in

      repl.js:291
        } else if (e && e.stack && self.replMode === exports.REPL_MODE_STRICT) {
  8. XadillaX commented on Jun 16, 2017

    @XadillaX
    Contributor

    I think this issue should be closed?

  9. bnoordhuis commented on Jun 16, 2017

    @bnoordhuis
    Member

    I don't think this was actually fixed, #12400 wasn't merged.

  10. benjamingr commented on Jul 16, 2017

    @benjamingr
    Member

    Seeing as this is unhandled - I'll take a shot.

  11. self-assigned this
    on Jul 16, 2017
  12. added a commit that references this issue on Jul 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

confirmed-bugIssues and PRs for confirmed bugs.domainIssues and PRs related to the domain subsystem.replIssues and PRs related to the REPL subsystem.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions