oclif / oclif/test

@oclif/test v4 `runCommand` segFaults on linux node < 18.20.0 and < 20.8.0

Open
#556 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting for interest
Dominant language
TypeScript
Stars
23
Forks
12
Avg merge
11m
Merged PRs (30d)
2

Description

Describe the bug

Updated our internal cli to use @oclif/test@4.0.2 and the new runCommand segFaults on linux node < 18.20.0 and <20.8.0. I've replicated this on linux x86 and linux arm. This does not happen on macOS for any versions of 18.x or 20.x that I spot tested.

To Reproduce
Steps to reproduce the behavior:

  • I have a test that calls a command with the runCommand method: await expect(runCommand<{ name: string }>(['jira:watch', '-p', 'plat'])).resolves.not.toThrow(); and it segfaults when executed using any of the above node versions.
$ npm test jira

> @zephyr-ai/px@0.0.0 test
> npx projen test jira

👾 test | jest --passWithNoTests --ci jira

 RUNS  test/commands/jira/watch.test.ts
Segmentation fault (core dumped)

If I switch the test and execute the command directly, the test passes: await expect(JiraWatchIssues.run(['-p', 'plat'])).resolves.not.toThrow();

This is not command specific, it segFaults if I execute the default oclif help command: await expect(runCommand<{ name: string }>(['help'])).resolves.not.toThrow();

Environment (please complete the following information):

  • OS & version: [e.g. MacOS Monterey, Ubuntu 20.04.4 LTS, Windows 10]
    • Ubuntu 22.04 ARM and x86
    • Ubuntu 20.04 x86
    • node version < 18.20.0
    • node version < 20.8.0
  • Shell/terminal & version [e.g. bash-3.2, bash-5.0, zsh 5.8, powershell 7.2.4, cmd.exe, Windows Terminal w/ powershell, etc... ]
    • bash 5.1.16

Additional context
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the segfault with the reported runCommand calls on Ubuntu x86 and ARM using the affected Node versions, then inspect the @oclif/test v4 runCommand entry point. Compare it with direct command execution and the default help command; done means both runCommand cases complete without a segmentation fault on the affected Linux versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.