llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.8k stars 11.45k forks source link

Assertion failed: (byte_size > 0 && byte_size <= 8 && "GetMaxU64 invalid byte_size!") #99382

Closed b5i closed 3 weeks ago

b5i commented 1 month ago

Hello! I was debugging a Swift app for iOS on a remote device connected by a cable to my Mac and got this error.

error: Assertion failed: (byte_size > 0 && byte_size <= 8 && "GetMaxU64 invalid byte_size!"), function GetMaxU64, file DataExtractor.cpp, line 527
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  LLDB                    0x0000000114cee904 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  LLDB                    0x000000011484fe54 lldb_private::lldb_assert(bool, char const*, char const*, char const*, unsigned int) + 148
2  LLDB                    0x00000001148494d4 lldb_private::DataExtractor::GetMaxU64(unsigned long long*, unsigned long) const + 72
3  LLDB                    0x0000000114753708 lldb_private::CompilerType::GetValueAsScalar(lldb_private::DataExtractor const&, unsigned long long, unsigned long, lldb_private::Scalar&, lldb_private::ExecutionContextScope*) const + 304
4  LLDB                    0x000000011468f3d4 lldb_private::Value::ResolveValue(lldb_private::ExecutionContext*, lldb_private::Module*) + 388
5  LLDB                    0x0000000114692174 lldb_private::ValueObject::ResolveValue(lldb_private::Scalar&) + 104
6  LLDB                    0x000000011469504c lldb_private::ValueObject::GetValueAsSigned(long long, bool*) + 140
7  LLDB                    0x000000011452585c lldb::SBValue::GetValueAsSigned(long long) + 160
8  lldb-rpc-server         0x000000010066be70 rpc_server::_ZN4lldb7SBValue16GetValueAsSignedEx::HandleRPCCall(rpc_common::Connection&, rpc_common::RPCStream&, rpc_common::RPCStream&) + 92
9  lldb-rpc-server         0x00000001006762b8 rpc_common::Connection::PrivateHandleRPCPacket(rpc_common::RPCPacket&, rpc_common::RPCPacket&, bool&) + 628
10 lldb-rpc-server         0x0000000100679e8c Packets::ProcessPackets() + 564
11 lldb-rpc-server         0x0000000100679bf4 Packets::ReadThread() + 276
12 lldb-rpc-server         0x0000000100679ad4 Packets::RunReadThread(void*) + 12
13 libsystem_pthread.dylib 0x000000019b9242e4 _pthread_start + 136
14 libsystem_pthread.dylib 0x000000019b91f0fc thread_start + 8
Please file a bug report against lldb reporting this failure log, and as many details as possible
llvmbot commented 1 month ago

@llvm/issue-subscribers-lldb

Author: Antoine Bollengier (b5i)

Hello! I was debugging a Swift app for iOS on a remote device connected by a cable to my Mac and got this error. ``` error: Assertion failed: (byte_size > 0 && byte_size <= 8 && "GetMaxU64 invalid byte_size!"), function GetMaxU64, file DataExtractor.cpp, line 527 Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0 LLDB 0x0000000114cee904 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 LLDB 0x000000011484fe54 lldb_private::lldb_assert(bool, char const*, char const*, char const*, unsigned int) + 148 2 LLDB 0x00000001148494d4 lldb_private::DataExtractor::GetMaxU64(unsigned long long*, unsigned long) const + 72 3 LLDB 0x0000000114753708 lldb_private::CompilerType::GetValueAsScalar(lldb_private::DataExtractor const&, unsigned long long, unsigned long, lldb_private::Scalar&, lldb_private::ExecutionContextScope*) const + 304 4 LLDB 0x000000011468f3d4 lldb_private::Value::ResolveValue(lldb_private::ExecutionContext*, lldb_private::Module*) + 388 5 LLDB 0x0000000114692174 lldb_private::ValueObject::ResolveValue(lldb_private::Scalar&) + 104 6 LLDB 0x000000011469504c lldb_private::ValueObject::GetValueAsSigned(long long, bool*) + 140 7 LLDB 0x000000011452585c lldb::SBValue::GetValueAsSigned(long long) + 160 8 lldb-rpc-server 0x000000010066be70 rpc_server::_ZN4lldb7SBValue16GetValueAsSignedEx::HandleRPCCall(rpc_common::Connection&, rpc_common::RPCStream&, rpc_common::RPCStream&) + 92 9 lldb-rpc-server 0x00000001006762b8 rpc_common::Connection::PrivateHandleRPCPacket(rpc_common::RPCPacket&, rpc_common::RPCPacket&, bool&) + 628 10 lldb-rpc-server 0x0000000100679e8c Packets::ProcessPackets() + 564 11 lldb-rpc-server 0x0000000100679bf4 Packets::ReadThread() + 276 12 lldb-rpc-server 0x0000000100679ad4 Packets::RunReadThread(void*) + 12 13 libsystem_pthread.dylib 0x000000019b9242e4 _pthread_start + 136 14 libsystem_pthread.dylib 0x000000019b91f0fc thread_start + 8 Please file a bug report against lldb reporting this failure log, and as many details as possible ```
EugeneZelenko commented 1 month ago

Could you please provide version information and reproducer?

b5i commented 1 month ago

Version information: Xcode 16.0 beta 3 with llvm version 17.0.6. And the reproduce steps are:

  1. Compile and run Atwy (branch llvm-issue) for an iPhone with iOS 18.0 beta 3
  2. Set a breakpoint to SettingsMenu.swift:125
  3. In the app, go to the top right button -> Private APIs and the breakpoint should be fired.
  4. While fetching the local variables the above error appears.
asl commented 1 month ago

Neither clang nor lldb shipped by Apple are from LLVM mainline. These are from their downstream forks. I would suggest you to report issue to Apple unless you can reproduce the issue with LLVM mainline tools.

Michael137 commented 1 month ago

Neither clang nor lldb shipped by Apple are from LLVM mainline. These are from their downstream forks. I would suggest you to report issue to Apple unless you can reproduce the issue with LLVM mainline tools.

I don't think we should encourage issues to be raised on the Apple fork, unless they're Swift related (CC @JDevlieghere @adrian-prantl)

EDIT: Oh but this is Swift related, nvm then, that would be something to report through Xcode/feedback assistant (I had only looked at the backtrace)