Landing: ddf645c09461

Project / Subsystem

gcc / libgomp

Date

2026-07-15

Author

Thomas Schwinge

Commit

ddf645c09461c6ebf444f27ebbcad8141f0dba56

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
libgomp
patch_id
commit_hash
ddf645c09461c6ebf444f27ebbcad8141f0dba56
source_type
github
headline
libgomp: Improve robustness of omp_get_numa_distance with getline
tldr
Fixes potential crashes and double-free issues in libgomp's NUMA distance calculation by robustifying getline usage.
author
Thomas Schwinge
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • libgomp
  • NUMA
  • memory
  • robustness
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-07-15T00:00:00.000Z

This commit enhances the robustness of libgomp’s omp_get_numa_distance function, specifically addressing issues related to parsing NUMA information from /sys/devices/system/node/online. It resolves a potential crash caused by freeing an uninitialized pointer (lineptr) when getline fails early and prevents a double-free in error handling paths. The code now correctly initializes lineptr and nline before calling getline and simplifies the error handling logic.