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

(RHEL-18302) Avoid memory allocation in freeze() #419

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

msekletar
Copy link
Member

@msekletar msekletar commented Dec 22, 2023

No description provided.

Copy link

github-actions bot commented Dec 22, 2023

Tracker - RHEL-18302

The following commits meet all requirements

commit upstream
3d0a4d2 - fd-util: rework how we determine highest possible fd systemd/systemd@498e265
922bd45 - basic/fd-util: refuse "infinite" loop in close_all_fds() systemd/systemd@6a461d1
cb9eea3 - fd-util: split out inner fallback loop of close_all_fds() as close_all… systemd/systemd@1196655
d8c98a3 - exec-util: use close_all_fds_without_malloc() from freeze() systemd/systemd@ab27b2f

@github-actions github-actions bot added pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review tracker/missing Formerly needs-bz labels Dec 22, 2023
(cherry picked from commit 498e265)

Related: RHEL-18302
keszybz and others added 3 commits December 22, 2023 18:36
I had a test machine with ulimit -n set to 1073741816 through pam
("session required pam_limits.so set_all", which copies the limits from PID 1,
left over from testing of #10921).

test-execute would "hang" and then fail with a timeout when running
exec-inaccessiblepaths-proc.service. It turns out that the problem was in
close_all_fds(), which would go to the fallback path of doing close()
1073741813 times. Let's just fail if we hit this case. This only matters
for cases where both /proc is inaccessible, and the *soft* limit has been
raised.

  (gdb) bt
  #0  0x00007f7e2e73fdc8 in close () from target:/lib64/libc.so.6
  redhat-plumbers#1  0x00007f7e2e42cdfd in close_nointr ()
     from target:/home/zbyszek/src/systemd-work3/build-rawhide/src/shared/libsystemd-shared-241.so
  redhat-plumbers#2  0x00007f7e2e42d525 in close_all_fds ()
     from target:/home/zbyszek/src/systemd-work3/build-rawhide/src/shared/libsystemd-shared-241.so
  redhat-plumbers#3  0x0000000000426e53 in exec_child ()
  redhat-plumbers#4  0x0000000000429578 in exec_spawn ()
  redhat-plumbers#5  0x00000000004ce1ab in service_spawn ()
  redhat-plumbers#6  0x00000000004cff77 in service_enter_start ()
  redhat-plumbers#7  0x00000000004d028f in service_enter_start_pre ()
  redhat-plumbers#8  0x00000000004d16f2 in service_start ()
  redhat-plumbers#9  0x00000000004568f4 in unit_start ()
  redhat-plumbers#10 0x0000000000416987 in test ()
  redhat-plumbers#11 0x0000000000417632 in test_exec_inaccessiblepaths ()
  redhat-plumbers#12 0x0000000000419362 in run_tests ()
  redhat-plumbers#13 0x0000000000419632 in main ()

(cherry picked from commit 6a461d1)

Related: RHEL-18302
…l_fds_without_malloc()

(cherry picked from commit 1196655)

Related: RHEL-18302
(cherry picked from commit ab27b2f)

Resolves: RHEL-18302
@jamacku jamacku added this to the RHEL-8.10 milestone Dec 22, 2023
@github-actions github-actions bot added tracker/missing Formerly needs-bz and removed pr/needs-ci Formerly needs-ci tracker/missing Formerly needs-bz labels Dec 22, 2023
@jamacku jamacku requested a review from dtardon January 8, 2024 08:37
Copy link
Member

@dtardon dtardon left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot removed the pr/needs-review Formerly needs-review label Jan 8, 2024
@github-actions github-actions bot merged commit 140e598 into redhat-plumbers:main Jan 8, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants