Skip to content
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

All debuginfo-lldb tests fail (TypeError: expected string or buffer) #45086

Closed
jacwah opened this issue Oct 7, 2017 · 1 comment
Closed

All debuginfo-lldb tests fail (TypeError: expected string or buffer) #45086

jacwah opened this issue Oct 7, 2017 · 1 comment

Comments

@jacwah
Copy link
Contributor

jacwah commented Oct 7, 2017

All (non-ignored) debuginfo tests fail when I run

$ ./x.py test src/test/debuginfo

Below is the message for one of the tests. They all seem to be the same.

---- [debuginfo-lldb] debuginfo/vec.rs stdout ----
	NOTE: compiletest thinks it is using LLDB version 900

error: Error while running LLDB
status: exit code: 1
command: "/usr/bin/python" "/Users/jacob/Code/rust/src/etc/lldb_batchmode.py" "/Users/jacob/Code/rust/build/x86_64-apple-darwin/test/debuginfo/vec.stage2-x86_64-apple-darwin" "/Users/jacob/Code/rust/build/x86_64-apple-darwin/test/debuginfo/vec.debugger.script"
stdout:
------------------------------------------
LLDB batch-mode script
----------------------
Debugger commands script is '/Users/jacob/Code/rust/build/x86_64-apple-darwin/test/debuginfo/vec.debugger.script'.
Target executable is '/Users/jacob/Code/rust/build/x86_64-apple-darwin/test/debuginfo/vec.stage2-x86_64-apple-darwin'.
Current working directory is '/Users/jacob/Code/rust'
Creating a target for '/Users/jacob/Code/rust/build/x86_64-apple-darwin/test/debuginfo/vec.stage2-x86_64-apple-darwin'
settings set auto-confirm true

------------------------------------------
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/Users/jacob/Code/rust/src/etc/lldb_batchmode.py", line 211, in <module>
    execute_command(command_interpreter, command)
  File "/Users/jacob/Code/rust/src/etc/lldb_batchmode.py", line 84, in execute_command
    print(normalize_whitespace(res.GetOutput()), end='\n')
  File "/Users/jacob/Code/rust/src/etc/lldb_batchmode.py", line 48, in normalize_whitespace
    return re.sub("\s+", " ", s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 155, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or buffer

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

thread '[debuginfo-lldb] debuginfo/vec.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:2433:8

Adding a print call to debug the Python traceback reveals that normalize_whitespace is called with None as argument.

I'm on the current master (cce9343) running macOS 10.12.6 and /usr/bin/python --version is 2.7.10.

@kennytm
Copy link
Member

kennytm commented Oct 7, 2017

Repro-ed. Looks like an issue in newer version of LLDB when the output is empty (see snare/voltron#197). I'll just add an or '' to fix it.

kennytm added a commit to kennytm/rust that referenced this issue Oct 7, 2017
LLDB's output may be None instead of '', and that will cause type
mismatch when normalize_whitespace() expects a string instead of
None. This commit simply ensures we do pass '' even if the output
is None.
kennytm added a commit to kennytm/rust that referenced this issue Oct 9, 2017
debuginfo-test: Fix rust-lang#45086.

Fixes rust-lang#45086, where all debuginfo-lldb fails when using LLDB from Xcode 9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants