Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't close file descriptors in .target.bash calls (bsc#1218064) #166

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

mvidner
Copy link
Member

@mvidner mvidner commented Jan 8, 2024

Problem

With Ruby 3.3, yast2.rpm build fails with "[ASYNC BUG] rb_thread_wakeup_timer_thread: write(3) EBADF"
See: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:I/yast2/standard/x86_64

It's because in .target.bash implementation we close file descriptors numbered 3 and above, not to leak them to daemons we start (bsc#223602)

Solution

Don't close those FDs.

The original problem is meanwhile likely solved by starting daemons via systemd, which

A better solution would be to call Ruby's rb_reserved_fd_p(fd) API to avoid precisely its internal FDs, but yast-core technically doesn't depend on Ruby.

Testing

Tested building yast-core and yast-yast2 in Staging:I, no error

Screenshots

N/A

Martin Vidner and others added 2 commits January 10, 2024 17:26
because Ruby uses some FDs for thread communication and closing that one
results in abort(3) later, saying:

> [ASYNC BUG] rb_thread_wakeup_timer_thread: write(3)
> EBADF

Alternatively we could query Ruby's rb_reserved_fd_p(fd)
@mvidner mvidner marked this pull request as ready for review January 10, 2024 16:42
Copy link
Member

@jreidinger jreidinger left a comment

Choose a reason for hiding this comment

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

thanks

@jreidinger jreidinger merged commit 4ad226b into master Jan 10, 2024
2 checks passed
@jreidinger jreidinger deleted the async-bug-ebadf branch January 10, 2024 20:19
@yast-bot
Copy link
Contributor

✔️ Internal Jenkins job #27 successfully finished
✔️ Created OBS submit request #1137997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants