Skip to content

[bug] EXIT trap fires on exec — GNU bash does not run it #1012

Closed

Description

@caomengxuan666

[bug] EXIT trap fires on exec — GNU bash does not run it (image replaced, no exit path)

trap "echo TRAPPED" EXIT; exec echo REPLACED
# GNU bash 5.3:  prints REPLACED only
# rubash:        prints REPLACED + TRAPPED

Scripts that rely on cleanup-NOT-running under exec (e.g. re-exec'ing into another program) will double-cleanup under rubash.

Env: niubash 1.4.1 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle. Repro via both niu -c and script-file mode.

Activity

  1. caomengxuan666 commented on Oct 22, 2026

    @caomengxuan666
    MemberAuthor

    Env note: reporter wrote niubash 1.4.1 but the repro environment is 1.4.4 (current). Verification for the fix will run on current master + 1.4.4.

  2. added
    bug
    gnu-baseline
    area:jobs
    family:S9
    P2-medium
    on Oct 22, 2026
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

    P2-mediumarea:jobsbugfamily:S9gnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions