Skip to content

dd: simplify signal handling by removing Alarm timer thread#10768

Merged
Ecordonnier merged 3 commits intouutils:mainfrom
ChrisDryden:dd-simplify-signal-handling
Feb 7, 2026
Merged

dd: simplify signal handling by removing Alarm timer thread#10768
Ecordonnier merged 3 commits intouutils:mainfrom
ChrisDryden:dd-simplify-signal-handling

Conversation

@ChrisDryden
Copy link
Collaborator

@ChrisDryden ChrisDryden commented Feb 6, 2026

We have been experiencing intermittent failures in the dd unit tests, that are caused by the utility exiting with the SIGPIPE signal at the end of running and not returning an exit code. This is caused by the fact that this utility used pipes internally to handle signals and because it assumes that all rust programs ignore SIGPIPE.

When investigating the implementation of the signal handling, it appeared to me that the implementation was over-complicating things by having two separate threads involving pipes and atomic locks for timers that it could be very simplified by using the approach of just using a signal handler.

Fixes #10442
Fixes #10455
Fixes #10766

@ChrisDryden ChrisDryden force-pushed the dd-simplify-signal-handling branch from 5d85a25 to 6c9a81c Compare February 6, 2026 12:48
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

GNU testsuite comparison:

GNU test failed: tests/factor/t30. tests/factor/t30 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/factor/t31. tests/factor/t31 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/factor/t35. tests/factor/t35 is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 6, 2026

CodSpeed Performance Report

Merging this PR will improve performance by 7%

Comparing ChrisDryden:dd-simplify-signal-handling (54dfa0b) with main (da7ad84)

Summary

⚡ 8 improved benchmarks
✅ 276 untouched benchmarks
⏩ 38 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory dd_copy_default 105.9 KB 99 KB +7%
Memory dd_copy_separate_blocks 185.3 KB 177.3 KB +4.53%
Memory dd_copy_with_skip 109.6 KB 102.7 KB +6.75%
Memory dd_copy_8k_blocks 113.3 KB 106.3 KB +6.52%
Memory dd_copy_partial 109.3 KB 102.4 KB +6.77%
Memory dd_copy_64k_blocks 169.3 KB 162.3 KB +4.27%
Memory dd_copy_with_seek 109.6 KB 102.7 KB +6.75%
Memory dd_copy_4k_blocks 109.3 KB 102.3 KB +6.77%

Footnotes

  1. 38 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ChrisDryden
Copy link
Collaborator Author

Darn, the performance numbers are unfortunate, I'll have to see where this is coming from

@ChrisDryden
Copy link
Collaborator Author

Theres two changes here, one to remove the alarm thread and one to remove the pipe based signal handler, I can simplify this to just remove the pipe based signal handler.

@ChrisDryden ChrisDryden marked this pull request as draft February 6, 2026 15:17
@ChrisDryden ChrisDryden force-pushed the dd-simplify-signal-handling branch from 6c9a81c to d5c9c23 Compare February 6, 2026 20:34
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)

@ChrisDryden
Copy link
Collaborator Author

Sweet lower memory and no performance regressions.

@ChrisDryden ChrisDryden marked this pull request as ready for review February 6, 2026 21:06
@Ecordonnier
Copy link
Collaborator

While reviewing I've noticed we're missing macOS SIGINFO handling, so I've created #10776 as follow-up.

self_cell = "1.0.4"
selinux = "=0.6.0"
string-interner = "0.19.0"
signal-hook = "0.4.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also remove it from deny.toml AFAIU, since there are no version conflicts any more

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@Ecordonnier Ecordonnier merged commit 4861c94 into uutils:main Feb 7, 2026
156 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants