New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 620010 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Jun 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

battor_agent crashes if it receives input immediately after it begins execution

Project Member Reported by aschulman@chromium.org, Jun 14 2016

Issue description

On windows in a cygwin terminal the following command will cause a segfault.

echo "StartTracing | ./battor_agent.exe --battor-path=COM4

This is important to fix because it is the same bug that is preventing us
from running stable battor_agent runs on the FYI bot https://github.com/catapult-project/catapult/issues/2381.
 
I forced the battor_agent to run BattOrAgent::StartTracing() as soon as RunNextCommand() is run so I could get a reproducible stack trace of the crash. It looks like some of the threading bugs that we've seen in the past.

(gdb) r --battor-path=COM6
Starting program: /home/BattOr/chromium/src/out/Debug_x64/battor_agent.exe --battor-path=COM6
[New Thread 7252.0x1ae8]
[New Thread 7252.0x1440]
[New Thread 7252.0x1ba4]
[New Thread 7252.0x22c4]
[New Thread 7252.0x23f0]
[New Thread 7252.0x13cc]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 7252.0x23f0]
0x00007ffc4fabda73 in ntdll!RtlAcquireSRWLockExclusive ()
   from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
(gdb) bt
#0  0x00007ffc4fabda73 in ntdll!RtlAcquireSRWLockExclusive ()
   from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#1  0x00000001414da017 in battor_agent!GetHandleVerifier ()
#2  0x000000014018e06a in battor_agent!GetHandleVerifier ()
#3  0x00000001401b80c8 in battor_agent!GetHandleVerifier ()
#4  0x000000014149627b in battor_agent!GetHandleVerifier ()
#5  0x00000001414961b3 in battor_agent!GetHandleVerifier ()
#6  0x000000014014251f in battor_agent!GetHandleVerifier ()
#7  0x000000014011f5a9 in battor_agent!GetHandleVerifier ()
#8  0x000000014011f297 in battor_agent!GetHandleVerifier ()
#9  0x0000000140126b37 in battor_agent!GetHandleVerifier ()
#10 0x0000000140141978 in battor_agent!GetHandleVerifier ()
#11 0x00000001415d2aba in battor_agent!GetHandleVerifier ()
#12 0x0000000141484d59 in battor_agent!GetHandleVerifier ()
#13 0x0000000141481f4c in battor_agent!GetHandleVerifier ()
#14 0x0000000141482819 in battor_agent!GetHandleVerifier ()
#15 0x0000000141558957 in battor_agent!GetHandleVerifier ()
#16 0x000000014155a4fd in battor_agent!GetHandleVerifier ()
#17 0x0000000141484956 in battor_agent!GetHandleVerifier ()
#18 0x000000014148e76d in battor_agent!GetHandleVerifier ()
#19 0x0000000141484809 in battor_agent!GetHandleVerifier ()
#20 0x00000001414905b8 in battor_agent!GetHandleVerifier ()
#21 0x0000000141491426 in battor_agent!GetHandleVerifier ()
#22 0x0000000141499641 in battor_agent!GetHandleVerifier ()
#23 0x00007ffc4d8b8102 in KERNEL32!BaseThreadInitThunk ()
   from /cygdrive/c/WINDOWS/system32/KERNEL32.DLL
#24 0x00007ffc4faec5b4 in ntdll!RtlUserThreadStart ()
   from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#25 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
Labels: -Pri-3 Pri-1
Components: Internals>Tracing
Labels: BattOr
Status: Assigned (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/52328d3bf192548208dd14181f76dc63ba2b7512

commit 52328d3bf192548208dd14181f76dc63ba2b7512
Author: charliea <charliea@chromium.org>
Date: Wed Jun 15 15:55:34 2016

[battor agent] Make BattOr agent block until the BattOrAgent is created

This fixes a crash that would be triggered when a command was sent to
the agent very quickly after it started. In this case, battor_agent_bin
would try to use the BattOrAgent before it was initialized, resulting
in a segfault.

BUG= 620010 

Review-Url: https://codereview.chromium.org/2062393002
Cr-Commit-Position: refs/heads/master@{#399906}

[modify] https://crrev.com/52328d3bf192548208dd14181f76dc63ba2b7512/tools/battor_agent/battor_agent_bin.cc

Status: Verified (was: Assigned)
Cc: alexandermont@chromium.org charliea@chromium.org
 Issue 602266  has been merged into this issue.

Sign in to add a comment