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

[SR-13016] Investigate -emit-ir with -num-threads outputting interleaved content #55461

Open
keith opened this issue Jun 14, 2020 · 0 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@keith
Copy link
Collaborator

keith commented Jun 14, 2020

Previous ID SR-13016
Radar None
Original Reporter @keith
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: e27e438e45eafcd19d1f7828ca83e075

Issue Description:

When working on this change #32352 the windows tests failed unexpectedly. We tracked this down to the output containing these lines:

This valid one (that there should have been 2 of):

@__llvm_coverage_mapping = internal constant { { i32, i32, i32, i32 }, [1 x <{ i64, i32, i64 }>], [104 x i8] } { { i32, i32, i32, i32 } { i32 1, i32 94, i32 10, i32 2 }, [1 x <{ i64, i32, i64 }>] [<{ i64, i32, i64 }> <{ i64 346071021529087246, i32 9, i64 0 }>], [104 x i8] c"\01\\S:\\jenkins\\workspace\\swift-PR-windows\\swift\\test\\Profiler/Inputs/coverage_num_threads2.swift\01\00\00\01\01\01\0E\00\10\00" }, section ".lcovmap$M", align 8

And this invalid one where the `__ll` was cut off from the beginning:

@vm_coverage_mapping = internal constant { { i32, i32, i32, i32 }, [1 x <{ i64, i32, i64 }>], [104 x i8] } { { i32, i32, i32, i32 } { i32 1, i32 94, i32 10, i32 2 }, [1 x <{ i64, i32, i64 }>] [<{ i64, i32, i64 }> <{ i64 -8320429751471283630, i32 9, i64 0 }>], [104 x i8] c"\01\\S:\\jenkins\\workspace\\swift-PR-windows\\swift\\test\\Profiler/Inputs/coverage_num_threads1.swift\01\00\00\01\01\01\0E\00\10\00" }, section ".lcovmap$M", align 8

I found the missing `__ll` above in another line:

@__ll; ModuleID = '<swift-imported-modules>'

It seems like when using `-emit-ir` (and maybe other output methods) with `-num-threads` greater than 1, the output can become interleaved. I was never able to reproduce this on macOS, or my Windows VM, but it reproduced consistently on Windows CI.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

1 participant