Skip to content

Conversation

@delcypher
Copy link

The tests were failing with:

/home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:32: error: a parameter list without types is only allowed in a function definition
    5 | int bad_call(int *__counted_by(count) ptr, int count) {}
      |                                ^
/home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:39: error: expected ')'
    5 | int bad_call(int *__counted_by(count) ptr, int count) {}
      |                                       ^
/home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:13: note: to match this '('
    5 | int bad_call(int *__counted_by(count) ptr, int count) {}
      |             ^
2 errors generated.

This is happening because __counted_by is a macro but the ptrcheck.h
header that defines it is not included. This wasn't caught on macOS
because the Libc headers on that platform automatically include that
header.

I don't have a Linux VM to hand so this is a speculative fix that should
fix the include issue.

rdar://165202129

…son` tests on Linux

The tests were failing with:

```
/home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:32: error: a parameter list without types is only allowed in a function definition
    5 | int bad_call(int *__counted_by(count) ptr, int count) {}
      |                                ^
/home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:39: error: expected ')'
    5 | int bad_call(int *__counted_by(count) ptr, int count) {}
      |                                       ^
/home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:13: note: to match this '('
    5 | int bad_call(int *__counted_by(count) ptr, int count) {}
      |             ^
2 errors generated.
```

This is happening because `__counted_by` is a macro but the `ptrcheck.h`
header that defines it is not included. This wasn't caught on macOS
because the Libc headers on that platform automatically include that
header.

I don't have a Linux VM to hand so this is a speculative fix that should
fix the include issue.

rdar://165202129
@delcypher delcypher self-assigned this Nov 21, 2025
@delcypher delcypher requested a review from a team as a code owner November 21, 2025 18:21
@delcypher delcypher added the clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang label Nov 21, 2025
@delcypher
Copy link
Author

@swift-ci test

@delcypher
Copy link
Author

macOS test failures:

[2025-11-21T20:09:04.710Z] ========= END =========
[2025-11-21T20:09:04.710Z] FAIL: LLDB (/Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-swift/release/6.3/build/Ninja-RelWithDebInfoAssert+stdlib-RelWithDebInfo/llvm-macosx-x86_64/bin/clang-x86_64) :: test_breakpoint_events (TestDAP_breakpointEvents.TestDAP_breakpointEvents)
[2025-11-21T20:09:04.710Z] ======================================================================
[2025-11-21T20:09:04.710Z] FAIL: test_breakpoint_events (TestDAP_breakpointEvents.TestDAP_breakpointEvents)
[2025-11-21T20:09:04.710Z]    This test sets a breakpoint in a shared library and runs and stops
[2025-11-21T20:09:04.710Z] ----------------------------------------------------------------------
[2025-11-21T20:09:04.710Z] Traceback (most recent call last):
[2025-11-21T20:09:04.710Z]   File "/Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-swift/release/6.3/llvm-project/lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py", line 100, in test_breakpoint_events
[2025-11-21T20:09:04.710Z]     self.assertIn(main_bp_id, unverified_breakpoint_ids)
[2025-11-21T20:09:04.710Z] AssertionError: 2 not found in [3]
[2025-11-21T20:09:04.710Z] Config=x86_64-/Users/ec2-user/jenkins/workspace/apple-llvm-project-pr-macos/branch-swift/release/6.3/build/Ninja-RelWithDebInfoAssert+stdlib-RelWithDebInfo/llvm-macosx-x86_64/bin/clang
[2025-11-21T20:09:04.710Z] ----------------------------------------------------------------------
[2025-11-21T20:09:04.710Z] Ran 1 test in 12.227s
[2025-11-21T20:09:04.710Z] 
[2025-11-21T20:09:04.710Z] FAILED (failures=1)

@JDevlieghere
Copy link

@swift-ci test macos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants