11 Commits

Author SHA1 Message Date
Michael Cho
896edb4451
os/linux/ld: add support for using system ld.so 2025-09-05 09:04:21 -04:00
Xuehai Pan
b2d621ce6f os/linux/ld: do not crash the program if the ld.so.conf entry is not readable 2025-08-11 19:40:41 +08:00
Mike McQuaid
23971854b0
Fix file descriptor leak in Linux LD library path parsing
The library_paths method was using readlines which could leave file
descriptors open due to Ruby's garbage collection behavior. When
processing many packages during 'brew upgrade' or 'brew linkage',
this caused "Too many open files" errors on Linux systems.

Changes:
- Replace readlines with explicit file.open block to ensure proper closure
- Add caching to avoid repeatedly reading /etc/ld.so.conf during a session
- Cache included files as well to optimize recursive include processing

Fixes: #19866, #20302, #19177, #20223

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 15:19:07 +01:00
Carlo Cabrera
65731faf1d
os/linux/ld: handle nonexistent ld.so.conf more gracefully
Fixes #18458
2024-09-30 22:33:09 +08:00
Carlo Cabrera
1656d08629
os/linux/ld: drop retry logic
This is a hack, so let's see if we can get away with skipping it for
now.
2024-09-17 11:51:27 +08:00
Carlo Cabrera
70ab4932d3
Add link to issue with context 2024-09-17 01:03:34 +08:00
Carlo Cabrera
bb20b3c720
os/linux/ld: harden brewed_ld_so_diagnostics against TypeError
I think this is a bug in Ruby, but I've no idea how to track it down. I
can reproduce it intermittently in a codespace when `brew install`ing a
large number of formulae.

To work around this:
- cache the return value of `brewed_ld_so_diagnostics` so that we can
  limit the number of calls to `IO.popen`
- retry once when we see a `TypeError`

Closes #17828.
2024-09-16 20:26:35 +08:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Ruoyu Zhong
916b37388d
Revert "Revert "os/linux/elf: avoid using ldd for listing dynamic dependencies"" 2024-04-24 02:23:13 +08:00
Ruoyu Zhong
852c5acb65
Revert "os/linux/elf: avoid using ldd for listing dynamic dependencies" 2024-04-16 02:50:12 +08:00
Caleb Xu
c6b98d0b8c
os/linux/ld: add functions for querying dynamic linker 2024-04-13 19:35:29 -04:00