GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Segfault when spawning child with trace events enabled · Issue #22042 · nodejs/node

Segfault when spawning child with trace events enabled #22042

New issue
Copy link
New issue
Copy link
Closed
Closed
Segfault when spawning child with trace events enabled#22042
Copy link
Assignees
addaleax
Labels
confirmed-bugIssues and PRs for confirmed bugs.trace_eventsIssues and PRs related to trace events from V8, Node.js core, and user code.

Description

@kamil-mech
kamil-mech
opened on Jul 31, 2018
Issue body actions

Introduced in version 10.2.0 (found in versions 10.2.0..10.7.0)

Tiny snippet:

'use strict'

const { spawn } = require('child_process')

// Spawning a child with trace events enabled
// Segfaults when:
// - Destination file is missing OR
// - On any error thrown inside the file, like `throw new Error('foo')` or `require('module-not-found')`
const proc = spawn('node', ['non-existent.js'], {
  env: Object.assign({}, process.env, {
    NODE_OPTIONS: '--trace-events-enabled'
  })
})

proc.once('exit', function (code, signal) {
  console.log({ code, signal })
})

Execution:

km-mac:n-tmp km$ nvm use 10.7
Now using node v10.7.0 (npm v6.1.0)
km-mac:n-tmp km$ node segfault-issue.js
{ code: null, signal: 'SIGSEGV' }
# BROKEN

km-mac:n-tmp km$ nvm use 10.2
Now using node v10.2.0 (npm v5.6.0)
km-mac:n-tmp km$ node segfault-issue.js
{ code: null, signal: 'SIGSEGV' }
# BROKEN

km-mac:n-tmp km$ nvm use 10.1
Now using node v10.1.0 (npm v5.6.0)
km-mac:n-tmp km$ node segfault-issue.js
{ code: 1, signal: null }
# OK

km-mac:n-tmp km$ nvm use 10.2
Now using node v10.2.0 (npm v5.6.0)

km-mac:n-tmp km$ echo "throw new Error('foo')" > non-existent.js
km-mac:n-tmp km$ node segfault-issue.js
{ code: null, signal: 'SIGSEGV' }
# On error throw

km-mac:n-tmp km$ echo "require('foo')" > non-existent.js
km-mac:n-tmp km$ node segfault-issue.js
{ code: null, signal: 'SIGSEGV' }
# On ENOENT require

km-mac:n-tmp km$ echo "require('http')" > non-existent.js
km-mac:n-tmp km$ node segfault-issue.js
{ code: 0, signal: null }
# When contents are valid

km-mac:n-tmp km$ ls
node_trace.1.log	non-existent.js		segfault-issue.js
# Trace log was produced during one of these executions

Trace log file:
node_trace.1.log

OSX El Capitan 10.11.6

km-mac:n-tmp km$ uname -a
Darwin km-mac.local 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64 x86_64

Activity

  1. BridgeAR
    added
    confirmed-bugIssues and PRs for confirmed bugs.
    trace_eventsIssues and PRs related to trace events from V8, Node.js core, and user code.
    on Jul 31, 2018
  2. BridgeAR commented on Jul 31, 2018

    @BridgeAR
    BridgeAR
    on Jul 31, 2018
    Member
    More actions

    Ping @nodejs/trace-events

  3. addaleax commented on Jul 31, 2018

    @addaleax
    addaleax
    on Jul 31, 2018
    Member
    More actions

    This would be addressed by #21867 … I’ll try to get through with that one this week :/

    Reacted by Kamil Mech, Matteo Collina, James M Snell and GP
  4. addaleax
    self-assigned this
    on Aug 1, 2018
  5. addaleax
    closed this as completedin 281e5a3on Aug 1, 2018
  6. targos
    added a commit that references this issue on Aug 1, 2018

    src: clean up agent loop when exiting through destructor

    00c33a5
  7. sjarmak
    added a commit that references this issue on Jul 27, 2026

    src: clean up agent loop when exiting through destructor

    281e5a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @addaleax
    addaleax

Labels

confirmed-bugIssues and PRs for confirmed bugs.trace_eventsIssues and PRs related to trace events from V8, Node.js core, and user code.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.