Skip to content

Conversation

duiniuluantanqin
Copy link
Member

@duiniuluantanqin duiniuluantanqin commented Mar 14, 2025

Problem

The valgrind?check=new API parameter uses VALGRIND_DO_NEW_LEAK_CHECK which is only available in Valgrind 3.21+. On older versions like CentOS's default Valgrind 3.16, this causes undefined behavior since the macro is not defined.

Solution

  • Check for VALGRIND_DO_NEW_LEAK_CHECK availability before processing the request
  • Return ERROR_NOT_SUPPORTED with version information when unsupported
  • Move the version check before thread creation to avoid unnecessary resource allocation

Changes

  • Early validation of check=new parameter compatibility
  • Proper error response with current Valgrind version details
  • Prevents undefined behavior on older Valgrind installations

Fixes compatibility issues with older Valgrind versions commonly found in enterprise Linux distributions.


Co-authored-by: Jacob Su suzp1984@gmail.com

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Mar 14, 2025
@winlinvip winlinvip force-pushed the develop branch 2 times, most recently from 195435d to 97e2b64 Compare July 1, 2025 14:39
@duiniuluantanqin duiniuluantanqin changed the title Fallback to valgrind?check=full when valgrind?check=new is unavailable. Fallback to valgrind?check=full when valgrind?check=new is unavailable. Aug 12, 2025
@winlinvip winlinvip changed the title Fallback to valgrind?check=full when valgrind?check=new is unavailable. Fix: Return error for unsupported valgrind?check=new on older Valgrind versions Aug 12, 2025
@winlinvip winlinvip changed the title Fix: Return error for unsupported valgrind?check=new on older Valgrind versions Valgrind: Return error for unsupported check=new on Valgrind < 3.22 Aug 12, 2025
@winlinvip winlinvip changed the title Valgrind: Return error for unsupported check=new on Valgrind < 3.22 Valgrind: Return error for unsupported check=new on Valgrind < 3.21 Aug 12, 2025
@winlinvip winlinvip changed the title Valgrind: Return error for unsupported check=new on Valgrind < 3.21 Valgrind: Return error for unsupported check=new on Valgrind < 3.21. v7.0.52 Aug 12, 2025
@winlinvip winlinvip added the RefinedByAI Refined by AI/GPT. label Aug 12, 2025
@winlinvip winlinvip merged commit db5e439 into ossrs:develop Aug 12, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EnglishNative This issue is conveyed exclusively in English. RefinedByAI Refined by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants