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

Fix UTF8 string marshalling regression #69360

Merged
merged 3 commits into from
May 15, 2022
Merged

Fix UTF8 string marshalling regression #69360

merged 3 commits into from
May 15, 2022

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented May 14, 2022

We need to compensate for the differences in lifetime management patterns used by built-in marshalling system vs. the publicly explosed marshallers.

Fixes #69349

We need to compensate for the differences in lifetime management patterns used by built-in marshalling system vs. the publicly explosed marshallers.

Fixes dotnet#69349
@jkotas
Copy link
Member Author

jkotas commented May 14, 2022

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines bot May 14, 2022
@jkotas
Copy link
Member Author

jkotas commented May 14, 2022

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AaronRobinsonMSFT
Copy link
Member

Failure on Linux ARM is

Starting:    tracing.eventpipe.XUnitWrapper (parallel test collections = on, max threads = 4)
    tracing/eventpipe/eventsvalidation/ExceptionThrown_V1/ExceptionThrown_V1.sh [FAIL]
      
      Assert failure(PID 5146 [0x0000141a], Thread: 5148 [0x141c]): codeLength > 0
          File: /__w/1/s/src/coreclr/vm/eetwain.cpp Line: 5880
          Image: /root/helix/work/correlation/corerun
      
      /root/helix/work/workitem/e/tracing/eventpipe/eventsvalidation/ExceptionThrown_V1/ExceptionThrown_V1.sh: line 408:  5146 Aborted                 (core dumped) $LAUNCHER $ExePath "${CLRTestExecutionArguments[@]}"
      
      Return code:      1
      Raw output file:      /root/helix/work/workitem/uploads/Reports/tracing.eventpipe/eventsvalidation/ExceptionThrown_V1/ExceptionThrown_V1.output.txt
      Raw output:
      BEGIN EXECUTION
      /root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false ExceptionThrown_V1.dll ''
        0.0s: ==TEST STARTING==
        3.5s: Started sending sentinel events...
        3.6s: Connecting to EventPipe...
        5.2s: Creating EventPipeEventSource...
        5.2s: EventPipeEventSource created
        5.3s: Dynamic.All callback registered
        5.3s: Starting stream processing...
        6.1s: Saw new provider 'Microsoft-DotNETCore-SampleProfiler'
        6.2s: Saw sentinel event
        6.3s: Stopped sending sentinel events
        6.3s: Starting event generating action...
        6.3s: Thrown an excpetion 0 times...
        6.3s: Thrown an excpetion 100 times...
        6.4s: Thrown an excpetion 200 times...
        6.4s: Saw new provider 'Microsoft-Windows-DotNETRuntime'
        6.5s: Thrown an excpetion 300 times...
        6.5s: Thrown an excpetion 400 times...
        6.6s: Thrown an excpetion 500 times...
        6.6s: Thrown an excpetion 600 times...
        6.6s: Thrown an excpetion 700 times...
        6.7s: Thrown an excpetion 800 times...
        6.7s: Thrown an excpetion 900 times...
        6.8s: Stopping event generating action
        6.8s: Sending StopTracing command...
      [createdump] Gathering state for process 5146 corerun
      [createdump] Crashing thread 0000141c signal 00000006
      [createdump] Writing minidump with heap to file /home/helixbot/dotnetbuild/dumps/coredump.5146.dmp
      [createdump] Written 146190336 bytes (35691 pages) to core file
      [createdump] Dump successfully written
      Expected: 100
      Actual: 134
      END EXECUTION - FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=/root/helix/work/correlation
      > /root/helix/work/workitem/e/tracing/eventpipe/eventsvalidation/ExceptionThrown_V1/ExceptionThrown_V1.sh
      Expected: True
      Actual:   False
      Stack Trace:
           at tracing_eventpipe._eventsvalidation_ExceptionThrown_V1_ExceptionThrown_V1_._eventsvalidation_ExceptionThrown_V1_ExceptionThrown_V1_sh()
      Output:
        
        Assert failure(PID 5146 [0x0000141a], Thread: 5148 [0x141c]): codeLength > 0
            File: /__w/1/s/src/coreclr/vm/eetwain.cpp Line: 5880
            Image: /root/helix/work/correlation/corerun
        
        /root/helix/work/workitem/e/tracing/eventpipe/eventsvalidation/ExceptionThrown_V1/ExceptionThrown_V1.sh: line 408:  5146 Aborted                 (core dumped) $LAUNCHER $ExePath "${CLRTestExecutionArguments[@]}"
        
        Return code:      1
        Raw output file:      /root/helix/work/workitem/uploads/Reports/tracing.eventpipe/eventsvalidation/ExceptionThrown_V1/ExceptionThrown_V1.output.txt
        Raw output:
        BEGIN EXECUTION
        /root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false ExceptionThrown_V1.dll ''
          0.0s: ==TEST STARTING==
          3.5s: Started sending sentinel events...
          3.6s: Connecting to EventPipe...
          5.2s: Creating EventPipeEventSource...
          5.2s: EventPipeEventSource created
          5.3s: Dynamic.All callback registered
          5.3s: Starting stream processing...
          6.1s: Saw new provider 'Microsoft-DotNETCore-SampleProfiler'
          6.2s: Saw sentinel event
          6.3s: Stopped sending sentinel events
          6.3s: Starting event generating action...
          6.3s: Thrown an excpetion 0 times...
          6.3s: Thrown an excpetion 100 times...
          6.4s: Thrown an excpetion 200 times...
          6.4s: Saw new provider 'Microsoft-Windows-DotNETRuntime'
          6.5s: Thrown an excpetion 300 times...
          6.5s: Thrown an excpetion 400 times...
          6.6s: Thrown an excpetion 500 times...
          6.6s: Thrown an excpetion 600 times...
          6.6s: Thrown an excpetion 700 times...
          6.7s: Thrown an excpetion 800 times...
          6.7s: Thrown an excpetion 900 times...
          6.8s: Stopping event generating action
          6.8s: Sending StopTracing command...
        [createdump] Gathering state for process 5146 corerun
        [createdump] Crashing thread 0000141c signal 00000006
        [createdump] Writing minidump with heap to file /home/helixbot/dotnetbuild/dumps/coredump.5146.dmp
        [createdump] Written 146190336 bytes (35691 pages) to core file
        [createdump] Dump successfully written
        Expected: 100
        Actual: 134
        END EXECUTION - FAILED
        Test Harness Exitcode is : 1
        To run the test:
        > set CORE_ROOT=/root/helix/work/correlation
        > /root/helix/work/workitem/e/tracing/eventpipe/eventsvalidation/ExceptionThrown_V1/ExceptionThrown_V1.sh


str.CopyTo(new Span<char>(_nativeValue, str.Length));
_nativeValue[str.Length] = '\0'; // null-terminate
_nativeValue = (ushort*)Marshal.StringToCoTaskMemUni(str);
Copy link
Member

Choose a reason for hiding this comment

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

Note for other reviewers. The StringToCoTaskMemUni logic is almost identical to what is being replaced here.

@jkotas
Copy link
Member Author

jkotas commented May 15, 2022

Failure on Linux ARM

Opened #69375

The other outerloop failure is tracked by #61168

@jkotas jkotas merged commit e22c63e into dotnet:main May 15, 2022
@jkotas jkotas deleted the issue-69349 branch May 15, 2022 18:57
@ghost ghost locked as resolved and limited conversation to collaborators Jun 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interop\StringMarshalling\UTF8\UTF8Test failing in outerloop
2 participants