-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Swift Target Crashes with Multi-Threading #3271
Comments
Hello @rmehta33, I fear that I'm bumping in the same issue, but I did not yet have a reproduction path, does you Backtrace look a bit like this:
If so that would be awesome I'm already looking at this for days without a reproduction path, I did not think I was running multiple threads but there might also be a small issue there. Thanks for your input. |
Thinking out loud I think I see (part of) the problem.
antlr4/runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift Lines 71 to 73 in 5e5b6d3
antlr4/runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift Lines 99 to 106 in 5e5b6d3
antlr4/tool/resources/org/antlr/v4/tool/templates/codegen/Swift/Swift.stg Lines 357 to 362 in 5e5b6d3
antlr4/tool/resources/org/antlr/v4/tool/templates/codegen/Swift/Swift.stg Lines 238 to 246 in 5e5b6d3
antlr4/runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift Lines 712 to 723 in 5e5b6d3
antlr4/runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift Lines 76 to 84 in 5e5b6d3
I do believe that this is likely to be the cause of the issue, but please correct me if I'm wrong! @ewanmellor, @ericvergnaud, and/or other (Swift) maintainers your opinion is greatly appreciated Edit ---- I did a quick comparison with Java which has comparable code, however, the synchronized works there on top of the object reference so similar problem do not occur there, I fear we have to pass in the mutex-es externally as well. |
Yes! |
Reproducing Error
Running via Xcode for iOS 13
Project Swift Version: 4.2
Compiled swift target from 4.9.2 release
Grammar
Swift Code
What Happened
The program crashes in LexerATNSimulator.swift on line 721 with EXC_BAD_ACCESS. There was a double free at some point in the stack.
Any help is greatly appreciated! Hopefully this is just user error.
The text was updated successfully, but these errors were encountered: