The generic-enum-with-different-disr-sizes test fails in LLDB

7082412
Opened by Alex Crichton at 2025-03-01 11:51:13

Add in https://github.com/rust-lang/rust/pull/27070 I merged the test in with https://github.com/rust-lang/rust/pull/27076 but ignored the LLDB failure to land the LLVM update ahead of time. This test fails in LLDB currently, and it'd be good to know why! For posterity the error is:

---- [debuginfo-lldb] debuginfo/generic-enum-with-different-disr-sizes.rs stdout ----
    NOTE: compiletest thinks it is using LLDB version 310

error: line not found in debugger output: [...]$1 = Variant1(101)
status: exit code: 0
command: "/usr/bin/python2.7" "/Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-opt/build/src/etc/lldb_batchmode.py" "x86_64-apple-darwin/test/debuginfo-lldb/generic-enum-with-different-disr-sizes.stage2-x86_64-apple-darwin" "x86_64-apple-darwin/test/debuginfo-lldb/generic-enum-with-different-disr-sizes.debugger.script"
stdout:
------------------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is 'x86_64-apple-darwin/test/debuginfo-lldb/generic-enum-with-different-disr-sizes.debugger.script'.
Target executable is 'x86_64-apple-darwin/test/debuginfo-lldb/generic-enum-with-different-disr-sizes.stage2-x86_64-apple-darwin'.
Current working directory is '/Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-opt/build/obj'
Creating a target for 'x86_64-apple-darwin/test/debuginfo-lldb/generic-enum-with-different-disr-sizes.stage2-x86_64-apple-darwin'
settings set auto-confirm true

version
lldb-310.2.37 
command script import /Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-opt/build/./src/etc/lldb_rust_formatters.py
type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
type category enable Rust

breakpoint set --line 88
Breakpoint 1: where = generic-enum-with-different-disr-sizes.stage2-x86_64-apple-darwin`generic_enum_with_different_disr_sizes::main + 151 at generic-enum-with-different-disr-sizes.rs:88, address = 0x0000000100000da7 
run
Hit breakpoint 1.1: where = generic-enum-with-different-disr-sizes.stage2-x86_64-apple-darwin`generic_enum_with_different_disr_sizes::main + 151 at generic-enum-with-different-disr-sizes.rs:88, address = 0x0000000100000da7, resolved, hit count = 1 
Process 55204 launched: '/Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-opt/build/obj/x86_64-apple-darwin/test/debuginfo-lldb/generic-enum-with-different-disr-sizes.stage2-x86_64-apple-darwin' (x86_64) 
print eight_bytes1
(generic_enum_with_different_disr_sizes::Enum<f64>) $0 = Variant1(100) 
print four_bytes1
(generic_enum_with_different_disr_sizes::Enum<i32>) $1 = { = Variant1(101) = Variant2(101) } 
print two_bytes1
(generic_enum_with_different_disr_sizes::Enum<i16>) $2 = Variant1(102) 
print one_byte1
(generic_enum_with_different_disr_sizes::Enum<u8>) $3 = { = Variant1('A') = Variant2('A') } 
print eight_bytes2
(generic_enum_with_different_disr_sizes::Enum<f64>) $4 = Variant2(100) 
print four_bytes2
(generic_enum_with_different_disr_sizes::Enum<i32>) $5 = { = Variant1(101) = Variant2(101) } 
print two_bytes2
(generic_enum_with_different_disr_sizes::Enum<i16>) $6 = Variant2(102) 
print one_byte2
(generic_enum_with_different_disr_sizes::Enum<u8>) $7 = { = Variant1('A') = Variant2('A') } 
continue
quit


------------------------------------------
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-opt/build/src/etc/lldb_rust_formatters.py", line 155, in print_val
    return print_val(lldb_val.GetChildAtIndex(discriminant_val), internal_dict)
  File "/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 10192, in GetChildAtIndex
    return _lldb.SBValue_GetChildAtIndex(self, *args)
NotImplementedError: Wrong number of arguments for overloaded function 'SBValue_GetChildAtIndex'.
  Possible C/C++ prototypes are:
    GetChildAtIndex(lldb::SBValue *,uint32_t)
    GetChildAtIndex(lldb::SBValue *,uint32_t,lldb::DynamicValueType,bool)

Traceback (most recent call last):
  File "/Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-opt/build/src/etc/lldb_rust_formatters.py", line 155, in print_val
    return print_val(lldb_val.GetChildAtIndex(discriminant_val), internal_dict)
  File "/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 10192, in GetChildAtIndex
    return _lldb.SBValue_GetChildAtIndex(self, *args)
NotImplementedError: Wrong number of arguments for overloaded function 'SBValue_GetChildAtIndex'.
  Possible C/C++ prototypes are:
    GetChildAtIndex(lldb::SBValue *,uint32_t)
    GetChildAtIndex(lldb::SBValue *,uint32_t,lldb::DynamicValueType,bool)


------------------------------------------

thread '[debuginfo-lldb] debuginfo/generic-enum-with-different-disr-sizes.rs' panicked at 'explicit panic', /Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-opt/build/src/compiletest/runtest.rs:1490



failures:
    [debuginfo-lldb] debuginfo/generic-enum-with-different-disr-sizes.rs

cc @michaelwoerister

  1. In the python pretty-printing engine used by the rust-lldb wrapper, to be precise.

    Anton Dyudin at 2016-03-26 10:26:20

  2. Triage: this bug is still ignored, not sure if it's fixed on its own by now or not https://github.com/rust-lang/rust/blob/e938c2b9aae7e0c37c382e4e22bdc360e9a4f0b6/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs#L1

    Steve Klabnik at 2019-12-25 16:06:53

  3. Triage: this bug is still ignored, not sure if it's fixed on its own by now or not

    I tried removing the ignore-lldb comment today, and the test still fails there.

    Tom Tromey at 2022-03-26 18:20:53