Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Fix LargeArrayBuilder.CopyTo returning incorrect end-of-copy position #23865

Merged
merged 2 commits into from
Sep 9, 2017
Merged

Fix LargeArrayBuilder.CopyTo returning incorrect end-of-copy position #23865

merged 2 commits into from
Sep 9, 2017

Conversation

OmarTawfik
Copy link
Contributor

Porting #23817 to release 2.0 branch.
Fixes #23680

…#23817)

* Fix #23680

* PR Feedback

* More tests

* More tests
@OmarTawfik OmarTawfik added area-System.Linq bug Product bug (most likely) labels Sep 7, 2017
@OmarTawfik OmarTawfik added this to the 2.0.x milestone Sep 7, 2017
@OmarTawfik OmarTawfik self-assigned this Sep 7, 2017
@OmarTawfik OmarTawfik added the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Sep 7, 2017
@stephentoub
Copy link
Member

@dotnet-bot test this please

@Chrisboh
Copy link
Member

Chrisboh commented Sep 8, 2017

@dagood Do you mind taking a look into what is going on here?

@dagood
Copy link
Member

dagood commented Sep 8, 2017

I'm able to repro on my dev machine by checking out this branch (macOS 10.12.6). dotnet exits with code 134 (SIGABRT) when trying to compile the same three projects:

  • src/System.IO.FileSystem/src/System.IO.FileSystem.csproj
  • src/System.Collections/src/System.Collections.csproj
  • src/System.Private.Xml.Linq/src/System.Private.Xml.Linq.csproj

I'm not familiar with how to debug a SIGABRT, but it doesn't appear infra-related.


To get a bit more info, I tried a build on release/2.0.0 (using git clean -xdf) and that built cleanly. Checking port-toarray-fix out again, git cleaning, and building gave me another repro.

This is the command I'm using: ./build.sh -debug -framework:netcoreapp -os:OSX -buildArch:x64

column += copyCount;
}
}
int CopyToCore(T[] sourceBuffer, int sourceIndex)
Copy link
Member

@dagood dagood Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this to private int CopyToCore(T[], int, T[] array, int arrayIndex, int count) in the class lets the build command pass on my dev box. Seems like a product bug that compiling this crashes on OSX. (Edit: Now that other CI runs are coming in, it seems that this repros everywhere.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using different compiler versions in release/2.0 vs master?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at Tools/tool-runtime/project.csproj Microsoft.Net.Compilers.netcore:

  • release/2.0.0: 2.0.0-rc
  • master: 2.0.0-rc4

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dagood, do you know why we're still using old(er) preview bits? At the very least I would have thought we'd be using a shipped compiler, or if not, it'd be because we're using something cutting edge.

@OmarTawfik, in the name of moving this forward, can you avoid using the local function?

@agocke, you implemented local functions, right? Does this crash sound familiar at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dagood, do you know why we're still using old(er) preview bits?

There's an upgrade going on in dotnet/buildtools#1661, but I don't have any broader context on why certain versions are being used.

Copy link
Contributor Author

@OmarTawfik OmarTawfik Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephentoub I'll avoid the local function for now.

@OmarTawfik OmarTawfik added blocking-release and removed * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) labels Sep 8, 2017
@OmarTawfik
Copy link
Contributor Author

@stephentoub @dagood both NT builds are now failing because of this test System.Globalization.Tests.IdnMappingIdnaConformanceTests.GetAscii_Invalid.
It might be related to #21344. @tarekgh did you see this before? it is passing locally.

Copy link
Member

@VSadov VSadov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tarekgh
Copy link
Member

tarekgh commented Sep 8, 2017

System.Globalization.Tests.IdnMappingIdnaConformanceTests.GetAscii_Invalid.
It might be related to #21344. @tarekgh did you see this before? it is passing locally.

This 2.0 branch so this test expected to fail when running on Windows versions (I think rs2 or up). we fixed the test on the master branch. so you can ignore this failure

@OmarTawfik
Copy link
Contributor Author

cc @karelz @joshfree

@danmoseley
Copy link
Member

approved

@danmoseley danmoseley merged commit 6d38f59 into dotnet:release/2.0.0 Sep 9, 2017
@OmarTawfik OmarTawfik deleted the port-toarray-fix branch September 9, 2017 01:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Linq bug Product bug (most likely)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants