New issue
Advanced search Search tips

Issue 623209 link

Starred by 6 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 82385



Sign in to add a comment

clang/win: Assertion failed 'cannot emit delegate call arguments for inalloca arguments' in certain cases involving lambdas

Project Member Reported by thakis@chromium.org, Jun 24 2016

Issue description

https://build.chromium.org/p/chromium.fyi/builders/CrWinClngLLDdbg/builds/3730/steps/compile/logs/stdio

FAILED: obj/device/bluetooth/device_unittests.bluetooth_remote_gatt_characteristic_unittest.obj 
ninja -t msvc -e environment.x86 -- "..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m32 /nologo /showIncludes /FC @obj\device\bluetooth\device_unittests.bluetooth_remote_gatt_characteristic_unittest.obj.rsp /c ..\..\device\bluetooth\bluetooth_remote_gatt_characteristic_unittest.cc /Foobj\device\bluetooth\device_unittests.bluetooth_remote_gatt_characteristic_unittest.obj /Fdobj\device\device_unittests.cc.pdb 
Assertion failed: !isInAllocaArgument(CGM.getCXXABI(), type) && "cannot emit delegate call arguments for inalloca arguments!", file C:\b\build\slave\CrWinClngLLDdbg\build\src\third_party\llvm\tools\clang\lib\CodeGen\CGCall.cpp, line 2871
Wrote crash dump file "C:\Users\CHROME~1\AppData\Local\Temp\clang-cl.exe-1554e0.dmp"


The bot's been red for a very long time due to bug 622806, so not sure if this is a regression.


(sorry that so much is broken during your shift :-( )
 

Comment 2 by thakis@chromium.org, Jun 24 2016

Blocking: 621972
273689 good, 273708 bad. we need 273707 to fix a crash, but r273705 broke something and wasn't reverted until 273709, so this blocks the clang roll :-(

Comment 3 by p...@chromium.org, Jun 24 2016

Owner: p...@chromium.org
Looking

Comment 4 by p...@chromium.org, Jun 24 2016

Culprit is Chromium r401911 which triggered a pre-existing bug in the compiler.

Same problem is visible on the non-ToT bot: https://build.chromium.org/p/chromium.fyi/builders/CrWinClang/builds/10185/steps/compile/logs/stdio

Comment 5 by thakis@chromium.org, Jun 24 2016

Huh, that's pretty unfortunate :-(

I guess next step is to make a small repro, and then with that in hand maybe some simple temporary workaround we could land chromium becomes apparent?

Comment 6 by thakis@chromium.org, Jun 24 2016

https://codereview.chromium.org/2085293002

https://cs.chromium.org/chromium/src/device/bluetooth/bluetooth_adapter.h?q=NotifyGattCharacteristicValueChanged&sq=package:chromium&dr=CSs&l=463 takes a BluetoothRemoteGattCharacteristic*, `this` is a BluetoothRemoteGattCharacteristicWin.

Maybe doing

  BluetoothRemoteGattCharacteristic* arg = this;

and then passing arg works around the problem?
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 25 2016

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

commit 292962a4de3a928fbc25539ab557169b86e89e88
Author: pcc <pcc@chromium.org>
Date: Sat Jun 25 01:49:50 2016

bluetooth: Avoid use of lambda to work around clang bug.

Clang has a bug [1] that is exposed by the use of a lambda in this unit
test. Until that is fixed, work around it by turning the lambda into a static
function. Should help unblock the next clang roll.

[1] https://llvm.org/bugs/show_bug.cgi?id=28299

BUG=623209
R=ortuno@chromium.org,thakis@chromium.org

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

[modify] https://crrev.com/292962a4de3a928fbc25539ab557169b86e89e88/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc

Comment 9 by thakis@chromium.org, Jun 26 2016

Blocking: -621972
Doesn't block the roll, but let's keep this open so we'll remember to revert the workaround once clang-cl is able to do this.

Thanks, pcc!
Labels: -OS-Linux OS-Windows

Comment 11 Deleted

Comment 12 Deleted

Comment 13 by r...@chromium.org, Jun 30 2016

Cc: r...@chromium.org

Comment 14 by r...@chromium.org, Aug 25 2016

Labels: -Clang clang
I looked at this a while ago, and it's hard. Clang's lambda code assumes it can perfectly forward arguments, which is just not true with inalloca.
Looks like this is still a problem.

rnk: If the codegen part is hard to fix, could we at least emit a diagnostic when needing to forward an inalloca arg to a lambda instead of asserting?

Comment 16 by r...@chromium.org, Aug 2 2017

Summary: CrWinClngLLDdbg bot asserts about inalloca args (was: CrWinClngLLDdbg bot asserts about inallocal args)

Comment 17 by r...@chromium.org, Aug 2 2017

Owner: r...@chromium.org
Status: Assigned (was: Untriaged)
Cc: thakis@chromium.org
 Issue 757042  has been merged into this issue.
Summary: clang/win: Assertion failed 'cannot emit delegate call arguments for inalloca arguments' in certain cases involving lambdas (was: CrWinClngLLDdbg bot asserts about inalloca args)
Cc: h...@chromium.org
 Issue 905310  has been merged into this issue.
I turned the assertion into a codegen-time diagnostic, but fixing the actual bug is still hard. I worked on it, but I timed out and have to move onto something else.

Sign in to add a comment