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

Stop-hooks sometimes fail to fire on Linux and FreeBSD #15409

Open
llvmbot opened this issue Jan 22, 2013 · 10 comments
Open

Stop-hooks sometimes fail to fire on Linux and FreeBSD #15409

llvmbot opened this issue Jan 22, 2013 · 10 comments
Labels
bugzilla Issues migrated from bugzilla lldb

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 22, 2013

Bugzilla Link 15037
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @emaste

Extended Description

LLDB stop-hooks occasionally (but not always) fail to fire on Linux, which causes a timeout in one of the test cases (and for users of the python API that depend on being notified when the inferior process has stopped).

To reproduce, remove the @​expectedFailureLinux decorator from TestStopHookMechanism.py and run:

python dotest.py --executable functionalities/stop-hook

It should be noted that the above intermittently fails (so re-run if it passes). It seems likely that a race condition is the root-cause, but I have not confirmed this.

@emaste
Copy link
Member

emaste commented Nov 22, 2013

Also on FreeBSD - e.g. http://llvm-amd64.freebsd.your.org:8010/builders/lldb-amd64-freebsd/builds/1593/steps/check-lldb.1/logs/stdio

ERROR: test_with_dwarf (TestStopHookMechanism.StopHookMechanismTestCase)
Test the stop-hook mechanism.

Traceback (most recent call last):
File "/data/buildslave/lldb-amd64-freebsd/src-llvm/tools/lldb/test/lldbtest.py", line 709, in wrapper
func(*args, **kwargs)
File "/data/buildslave/lldb-amd64-freebsd/src-llvm/tools/lldb/test/lldbtest.py", line 370, in wrapper
return func(self, *args, **kwargs)
File "/data/buildslave/lldb-amd64-freebsd/src-llvm/tools/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py", line 27, in test_with_dwarf
self.stop_hook_firing()
File "/data/buildslave/lldb-amd64-freebsd/src-llvm/tools/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py", line 79, in stop_hook_firing
child.expect_exact('at main.cpp:%d'%self.correct_step_line)
File "/data/buildslave/lldb-amd64-freebsd/src-llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1348, in expect_exact
return self.expect_loop(searcher_string(pattern_list), timeout, searchwindowsize)
File "/data/buildslave/lldb-amd64-freebsd/src-llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1414, in expect_loop
raise TIMEOUT (str(e) + '\n' + str(self))
TIMEOUT: Timeout exceeded in read_nonblocking().

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 28, 2014

Verified this still happens for us on top of tree svn r202456, on Ubuntu 12.04 LTS x86_64, with lldb built with gcc 4.8.2 and July 2013 libedit.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 28, 2014

Marked this bug as expected failure (XFAIL) in lldb svn r202506. I ran the test 10 times in a row and it always failed.

This is part of a test code coverage analysis effort for Linux.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 28, 2014

r202506 marked TestStopHookMultipleThreads as XFAIL on Linux.
r202507 marked TestStopHookMechanism as XFAIL on Linux.

@emaste
Copy link
Member

emaste commented Jul 31, 2014

Started consistently failing again on FreeBSD after r214319 - most likely it has just perturbed a long-standing timing issue.

http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140728/012113.html

@emaste
Copy link
Member

emaste commented Oct 14, 2014

It seems the expectedFailure* decorator does not work on this test as the pexpect timeout raises an exception that isn't caught in TestBase::tearDown, in lldbtest.py, so that the test returns ERROR instead of XFAIL.

ERROR: test_stop_hook_multiple_threads_with_dwarf (TestStopHookMultipleThreads.StopHookForMultipleThreadsTestCase)
Test that lldb stop-hook works for multiple threads.

Traceback (most recent call last):
File "/tank/emaste/src/llvm/tools/lldb/test/lldbtest.py", line 1639, in tearDown
Base.tearDown(self)
File "/tank/emaste/src/llvm/tools/lldb/test/lldbtest.py", line 1017, in tearDown
self.child.expect(pexpect.EOF)
File "/tank/emaste/src/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1316, in expect
return self.expect_list(compiled_pattern_list, timeout, searchwindowsize)
File "/tank/emaste/src/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1330, in expect_list
return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
File "/tank/emaste/src/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1414, in expect_loop
raise TIMEOUT (str(e) + '\n' + str(self))

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 15, 2014

It seems reasonable that an XFAIL could also consume test errors (as opposed to test failures). If that is generally acceptable, we should be able to adjust the test framework to catch timeouts as (essentially) test failures for the purpose of the decorator handling of xfail.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 25, 2015

On FreeBSD, the two tests decorated @​expectedFlakeyFreeBSD - TestStopHookMultipleThreads.py and TestStopHookMechanism.py -are passing consistently without any (FreeBSD) decorator.

@labath
Copy link
Collaborator

labath commented Sep 26, 2016

*** Bug llvm/llvm-bugzilla-archive#20352 has been marked as a duplicate of this bug. ***

@labath
Copy link
Collaborator

labath commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#20352

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla lldb
Projects
None yet
Development

No branches or pull requests

3 participants