Skip to content

Fix a host lookup SIGSEGV during the the xHAL client connection in multithreaded environments

Laurent Petre requested to merge bugfix/xhal-sigsegv into main

Description

This is the latest fix in the series of the SIGSEGV revealed by the update to AlmaLinux 9. This time due to the non-multithread-safe gethostbyname function used from multiple threads while establishing an xHAL connection from the client to the server. This MR replaces the function with the more modern, multithread-safe, and protocol-agnostic getaddrinfo.

Related Issue

How Has This Been Tested?

Tested on the GEx/1 production system at P5. Before the fix, the xHAL client crashed regularly while looking up the hots address. This could be triggered more easily by looking up the host multiple times (1,000) for each connection. After the fix, the xHAL client doesn't crash in similar conditions, even by repeating the lookup many times for each connection.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
Edited by Laurent Petre

Merge request reports