AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 41 Bitcoin

contrib: "set -e" behaves weird in subshells followed by OR. don't use.

Public commit record

What the developer wrote

Authored by SomberNight

93/100 · Strong
contrib: "set -e" behaves weird in subshells followed by OR. don't use.

This exits as expected:
```
$ cat s1.sh
#!/bin/bash
set -e
(
echo "a"
false
echo "b"
)

$ ./s1.sh
a
```
This does NOT exit, seemingly because of the outer context?!
```
$ cat s2.sh
#!/bin/bash
set -e
(
echo "a"
false
echo "b"
) || echo "c"

$ ./s2.sh
a
b
```

ref https://unix.stackexchange.com/questions/65532/why-does-set-e-not-work-inside-subshells-with-parenthesis-followed-by-an-or
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a subtle shell-script bug in Electrum's build scripts. Because of how Bash handles 'set -e' inside subshells followed by '||', errors inside those build steps were silently ignored instead of stopping the build. That could let a broken or incomplete build continue, potentially producing a bad release binary. The fix removes the '|| fail' wrappers so the scripts now correctly abort on failure.

Recommended action

Review build logs from recent releases to confirm no prior silently-failed build steps produced artifacts. Ensure CI captures non-zero exits from these scripts. Consider adding explicit error checks or 'set -euo pipefail' consistently across build scripts. No runtime user action is required.

Security signals we found

01

Build-pipeline failure-handling defect

02

Silent ignore of build errors could lead to incomplete or tampered release artifacts

03

Supply-chain integrity risk if broken binaries are packaged and distributed

04

No direct code injection or memory corruption vulnerability

Risk score

Why this scored 41/100

Our methodology →
Potential impact 12/30
Exploitability 5/25
Stealth signal 8/15
Affected reach 6/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.