Skip to content

command-not-found hook can invoke itself, leading to infinite recursion #11014

Closed

Description

@K900

Describe the bug

See below.

How to reproduce

~
❯ $env.config.hooks.command_not_found = {|cmd| lol}

~
❯ lol

thread 'main' has overflowed its stack
fatal runtime error: stack overflow

Expected behavior

No crash.

Screenshots

No response

Configuration

key value
version 0.86.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.72.1 (d5c2e9c34 2023-09-13) (built from a source tarball)
cargo_version cargo 1.72.0
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash, which, zip
installed_plugins

Additional context

Not really sure what to add.

Activity

  1. added
    status:needs-triage
    on Nov 9, 2023
  2. fdncred commented on Nov 9, 2023

    @fdncred
    Contributor

    That's a crazy test case, but you're right, even though it's invalid, it still shouldn't crash nushell.

  3. added and removed
    status:needs-triage
    on Nov 9, 2023
  4. sholderbach commented on Feb 14, 2024

    @sholderbach
    Member

    This problem appears to be still present after #11729

  5. added a commit that references this issue on Mar 21, 2024
    02a9203
  6. added this to the v0.92.0 milestone on Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions