Skip to content

llvm-reduce: Fix assert if call type mismatches function type #131981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Mar 19, 2025

This fixes asserting on IR with undefined behavior from calls
with a type that does not match the type of the target function.

Just ignore callsites which already didn't match the function
signature. This is the most straightforward fix, the reference
to the global will be replaced later anyway. A better implementation
would try to pad out unused arguments, particularly in the cases where
the signatures only differ in type and not count.

Fixes #69312, fixes #100880

Copy link
Contributor Author

arsenm commented Mar 19, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm arsenm requested review from aeubanks and regehr March 19, 2025 07:35
@arsenm arsenm marked this pull request as ready for review March 19, 2025 07:35
This fixes asserting on IR with undefined behavior from calls
with a type that does not match the type of the target function.

Just ignore callsites which already didn't match the function
signature. This is the most straightforward fix, the reference
to the global will be replaced later anyway. A better implementation
would try to pad out unused arguments, particularly in the cases where
the signatures only differ in type and not count.

Fixes #69312, fixes #100880
@arsenm arsenm force-pushed the users/arsenm/llvm-reduce/issue69312/fix-assert-on-call-signature-mismatch branch from c1232e9 to f7ef7ea Compare March 19, 2025 07:56
@arsenm arsenm merged commit 896df5c into main Mar 21, 2025
9 of 11 checks passed
@arsenm arsenm deleted the users/arsenm/llvm-reduce/issue69312/fix-assert-on-call-signature-mismatch branch March 21, 2025 21:19
@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 21, 2025

LLVM Buildbot has detected a new failure on builder lldb-remote-linux-ubuntu running on as-builder-9 while building llvm at step 16 "test-check-lldb-api".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/195/builds/6536

Here is the relevant piece of the build log for the reference
Step 16 (test-check-lldb-api) failure: Test just built components: check-lldb-api completed (failure)
...
PASS: lldb-api :: types/TestCharType.py (1235 of 1244)
PASS: lldb-api :: types/TestCharTypeExpr.py (1236 of 1244)
PASS: lldb-api :: types/TestRecursiveTypes.py (1237 of 1244)
PASS: lldb-api :: types/TestIntegerType.py (1238 of 1244)
PASS: lldb-api :: types/TestIntegerTypeExpr.py (1239 of 1244)
PASS: lldb-api :: types/TestShortType.py (1240 of 1244)
PASS: lldb-api :: types/TestShortTypeExpr.py (1241 of 1244)
PASS: lldb-api :: types/TestLongTypes.py (1242 of 1244)
PASS: lldb-api :: types/TestLongTypesExpr.py (1243 of 1244)
TIMEOUT: lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py (1244 of 1244)
******************** TEST 'lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py' FAILED ********************
Script:
--
/usr/bin/python3.12 /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin --libcxx-include-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include/c++/v1 --libcxx-include-target-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include/aarch64-unknown-linux-gnu/c++/v1 --libcxx-library-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib/aarch64-unknown-linux-gnu --arch aarch64 --build-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin/lldb --compiler /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang --dsymutil /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin --lldb-obj-root /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb --lldb-libs-dir /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib --platform-url connect://jetson-agx-2198.lab.llvm.org:1234 --platform-working-dir /home/ubuntu/lldb-tests --sysroot /mnt/fs/jetson-agx-ubuntu --env ARCH_CFLAGS=-mcpu=cortex-a78 --platform-name remote-linux --skip-category=lldb-server /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/python_api/process/cancel_attach -p TestCancelAttach.py
--
Exit Code: -9
Timeout: Reached timeout of 600 seconds

Command Output (stdout):
--
lldb version 21.0.0git (https://github.com/llvm/llvm-project.git revision 896df5c4bf77a9a8933c0a5cfdcabccad4c50471)
  clang revision 896df5c4bf77a9a8933c0a5cfdcabccad4c50471
  llvm revision 896df5c4bf77a9a8933c0a5cfdcabccad4c50471

--
Command Output (stderr):
--
WARNING:root:Custom libc++ is not supported for remote runs: ignoring --libcxx arguments
FAIL: LLDB (/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang-aarch64) :: test_scripted_implementation (TestCancelAttach.AttachCancelTestCase.test_scripted_implementation)

--

********************
Slowest Tests:
--------------------------------------------------------------------------
600.04s: lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py
180.98s: lldb-api :: commands/command/script_alias/TestCommandScriptAlias.py
70.40s: lldb-api :: commands/process/attach/TestProcessAttach.py
40.66s: lldb-api :: functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
34.78s: lldb-api :: functionalities/completion/TestCompletion.py
33.80s: lldb-api :: functionalities/single-thread-step/TestSingleThreadStepTimeout.py
21.01s: lldb-api :: python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
20.82s: lldb-api :: commands/statistics/basic/TestStats.py
20.69s: lldb-api :: functionalities/gdb_remote_client/TestPlatformClient.py
18.73s: lldb-api :: functionalities/thread/state/TestThreadStates.py
18.27s: lldb-api :: commands/dwim-print/TestDWIMPrint.py
14.76s: lldb-api :: functionalities/data-formatter/data-formatter-stl/generic/set/TestDataFormatterGenericSet.py
14.68s: lldb-api :: commands/expression/expr-in-syscall/TestExpressionInSyscall.py
14.35s: lldb-api :: functionalities/inline-stepping/TestInlineStepping.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants