SequencedTaskRunnerHandle::IsSet() doesn't work correctly in debug mode after linker optimizations |
||||||||||||
Issue descriptionWhat steps will reproduce the problem? (1) Start Chromoting web-app. (2) Connect to any host. What is the expected output? Connection should succeed. What do you see instead? [0926/234105:FATAL:thread_task_runner_handle.cc(41)] Check failed: !SequencedTaskRunnerHandle::IsSet(). Bisect suggests that the culprit is https://codereview.chromium.org/2241703002 I've tried adding a call to RedirectToTaskSchedulerForProcess as suggested in that CL, but it fails with: [0926/235316:FATAL:sequenced_worker_pool.cc(1446)] Check failed: TaskScheduler::GetInstance(). From the comment in https://codereview.chromium.org/2241703002: "There must be a registered TaskScheduler when this is called." Could it be that our NaCl plugin doesn't have one?
,
Sep 27 2016
,
Sep 28 2016
This looks like a problem either in the compiler or PNaCl translator.
Problem is that SequencedTaskRunnerHandle::IsSet() returns true, when it should return false.
bool SequencedTaskRunnerHandle::IsSet() {
return lazy_tls_ptr.Pointer()->Get() ||
SequencedWorkerPool::GetSequenceTokenForCurrentThread().IsValid() ||
base::ThreadTaskRunnerHandle::IsSet();
}
When this code is executed each of these 3 conditions is false, but the function returns true.
Still investigating what the root cause is.
,
Sep 29 2016
The PNaCl code generated by the compiler seems correct, so it looks like the problem is in the PNaCl translator.
Just reordering the operands in the return statement makes issue go away:
return SequencedWorkerPool::GetSequenceTokenForCurrentThread().IsValid() ||
base::ThreadTaskRunnerHandle::IsSet() || lazy_tls_ptr.Pointer()->Get();
,
Sep 29 2016
Actually it appears the the issue is caused by optimizer in the PNaCl linker. The .o file contains correct code, but the optimized code in pexe is incorrect. I see the following code at the end of SequencedTaskRunnerHandle::IsSet() in the pexe file: cleanup.done: ; preds = %lor.end.cleanup.done_crit_edge, %_ZN4base19SequencedWorkerPool32GetSequenceTokenForCurrentThreadEv.exit, %_ZN4base18ThreadLocalPointerINS_25SequencedTaskRunnerHandleEE3GetEv.exit %.ret_ext = zext i1 true to i32, !dbg !1124856 ret i32 %.ret_ext, !dbg !1124856 I.e. the function always returns true. This is obviously wrong.
,
Sep 29 2016
The problem also goes away when I add __attribute__((optnone)) to SequencedTaskRunnerHandle::IsSet(), which disables all optimizations for that function.
,
Sep 29 2016
+bradnelson@ for triage. I'm going to land https://codereview.chromium.org/2384553002/ as a workaround for CRD.
,
Sep 29 2016
,
Sep 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f1f0af26d41c5119403b0781d804f7860e237871 commit f1f0af26d41c5119403b0781d804f7860e237871 Author: sergeyu <sergeyu@chromium.org> Date: Thu Sep 29 21:27:03 2016 Disable link-time optimization for remoting PNaCl plugin in Debug mode Optimization was enabled for the plugin to workaround an issue with linking libyuv. But that issue has been fixed, so it's not longer necessary to optimize debug builds. This also works around PNaCl link-time optimization bug that was breaking debug builds. That bug currently doesn't affect non-debug builds (if it breaks release builds in the future it's also possible to work it around by disabling optimization with per-function optnone attribute). BUG=650499 Review-Url: https://codereview.chromium.org/2384553002 Cr-Commit-Position: refs/heads/master@{#421938} [modify] https://crrev.com/f1f0af26d41c5119403b0781d804f7860e237871/remoting/client/plugin/BUILD.gn
,
Nov 7 2016
,
Nov 7 2016
Just stumbled on this, fixed?
,
Mar 29 2017
Assigning to bradnelson@chromium.org for triage. Maybe this is fixed now with the revert?
,
May 9 2018
ping? Please close if this is no longer an issue (and it definitely isn't a TaskScheduler implementation issue so I'm removing that label). Thanks!
,
Aug 3
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
,
Aug 23
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by jamiewa...@chromium.org
, Sep 27 2016