-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Compiler crash in HeapToStack optimization #4059
Comments
A more minimal example would help if possible. |
Here is the most minimal example I can make: actor Main
new create(env: Env) =>
let p: HtmlNode = P
p.apply()
class P is HtmlNode
var childlist: Array[HtmlNode] = []
fun ref get_childlist(): Array[HtmlNode] => childlist
interface HtmlNode
fun ref get_childlist(): Array[HtmlNode]
fun ref apply(): None =>
for f in get_childlist().values() do
None
end |
Is the interface required or does it still crash if all the interface functionality is moved into the class? |
Found the issue I think: If you modify Line 3 to be |
So, if I do that I have to leave at least a stub for apply() in the interface: actor Main
new create(env: Env) =>
let p: HtmlNode = P
p.apply()
class P is HtmlNode
var childlist: Array[HtmlNode] val = []
fun get_childlist(): Array[HtmlNode] val => childlist
fun apply(): None =>
for f in get_childlist().values() do
None
end
interface HtmlNode
fun apply(): None It's almost like in my |
My question was... does it crash without the interface or is the interface required. Leaving the interface doesn't answer that question. I'll check when I have time to see if the interface appears to be part of the issue. |
When I remove the interface the type HtmlNode no longer exists which means my assignment isn't valid - so I have to remove all references to it. actor Main
new create(env: Env) =>
let p: P = P
p.apply()
class P
var childlist: Array[P] val = []
fun get_childlist(): Array[P] val => childlist
fun apply(): None =>
for f in get_childlist().values() do
None
end Even if I leave the interface in and everything else hooked up, changing the type of p is sufficient to make it compile cleanly: actor Main
new create(env: Env) =>
let p: P = P
p.apply()
class P is HtmlNode
var childlist: Array[HtmlNode] val = []
fun get_childlist(): Array[HtmlNode] val => childlist
interface HtmlNode
fun get_childlist(): Array[HtmlNode] val
fun apply(): None =>
for f in get_childlist().values() do
None
end |
Does the interface-less version crash? It sounds like no, but you haven't explicitly said that it doesn't. |
It does not crash. |
More minimal example: actor Main
new create(env: Env) =>
let p: HtmlNode = P
p.apply()
class P is HtmlNode
fun apply(): None =>
for f in [as HtmlNode:].values() do
None
end
interface HtmlNode
fun apply(): None I feel like we either fixed a bug similar to this or still have an issue open for one that feels an awful lot like this. |
@SeanTAllen It does remind me of #3784 a bit. See this comment: #3784 (comment) It's not the same in the sense of having multiple messages, but in the fact that some optimization pass might be doing some unexpected things. |
There's a fix for this coming tomorrow. |
This is a good one. One the March 22, 2022 development sync, we collectively debugged issue #4059. We finally arrived at the conclusion that our call graph usage was incorrect. Originally during the call, Joe realized that while we were using, we weren't doing it correctly. The initial assumption was that the incorrect usage was innocous, however, it was determined shortly thereafter that something about the incorrect usage was in fact causing issue 4059. This commit removes the offending code. Gordon reported during the call that when the call graph code was added as part the (now years ago) addition of LLVM 4 support that the code was cribbed from the Dlang compiler and he posited, probably not correctly. Fixes #4059
This is a good one. One the March 22, 2022 development sync, we collectively debugged issue #4059. We finally arrived at the conclusion that our call graph usage was incorrect. Originally during the call, Joe realized that while we were using, we weren't doing it correctly. The initial assumption was that the incorrect usage was innocous, however, it was determined shortly thereafter that something about the incorrect usage was in fact causing issue 4059. This commit removes the offending code. Gordon reported during the call that when the call graph code was added as part the (now years ago) addition of LLVM 4 support that the code was cribbed from the Dlang compiler and he posited, probably not correctly. Fixes #4059
This is a good one. One the March 22, 2022 development sync, we collectively debugged issue #4059. We finally arrived at the conclusion that our call graph usage was incorrect. Originally during the call, Joe realized that while we were using, we weren't doing it correctly. The initial assumption was that the incorrect usage was innocous, however, it was determined shortly thereafter that something about the incorrect usage was in fact causing issue 4059. This commit removes the offending code. Gordon reported during the call that when the call graph code was added as part the (now years ago) addition of LLVM 4 support that the code was cribbed from the Dlang compiler and he posited, probably not correctly. Fixes #4059
This is a good one. One the March 22, 2022 development sync, we collectively debugged issue #4059. We finally arrived at the conclusion that our call graph usage was incorrect. Originally during the call, Joe realized that while we were using, we weren't doing it correctly. The initial assumption was that the incorrect usage was innocous, however, it was determined shortly thereafter that something about the incorrect usage was in fact causing issue 4059. This commit removes the offending code. Gordon reported during the call that when the call graph code was added as part the (now years ago) addition of LLVM 4 support that the code was cribbed from the Dlang compiler and he posited, probably not correctly. Fixes #4059
My offending code is in the following playground link: https://playground.ponylang.io/?gist=6e4fdaad3b062b9e8a1bffe457e5e422
It compiles when I call ponyc with the
-d
option. The compiler crashes (SEGV) when the-d
is absent.Here is the output from the compiler:
Here is the backtrace:
If there is any other information or help I can help provide, please let me know.
The text was updated successfully, but these errors were encountered: