You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typefoostruct {
funcs []func()
}
func (ffoo) do() error {
for_, fn:=rangef.funcs {
fn()
}
returnnil
}
...// this code is initialized somewhere varffoo// this code is called from JSerr:=f.do() // <- this hangs AFTER the do function has returned COMPLETELYiferr!=nil {
returnerr
}
If I remove the call to fn it doesn't hang anymore.
It's really hard for me to simplify my code and give you a working example, I wasn't able to reproduce this bug outside of my actual code.
I compiled using the 0.13.1 docker image with the following params:
It's really hard for me to simplify my code and give you a working example, I wasn't able to reproduce this bug outside of my actual code.
Somebody will have to simplify it to fix the bug. Theoretically we could do it but you know the code better than we do.
What I usually do in such cases is simplify in small steps, in a copy of the code if needed because the changes will be big.
For example:
Eliminate external dependencies (imports). This is very important, as it massively reduces the area where the bug could be. If it seems to be in a dependency, try figuring out where in the dependency it is happening.
Simplify functions, perhaps starting by leaf functions (functions that don't call other functions). Try to inline functions when they become small, to make sure it isn't in the call somehow.
Remove every line that can be removed while not removing the bug.
Of the remaining code, try to simplify further. For example, replace an indirect call with a direct call. Use simpler control flow. Etc.
In this particular case, I suspect the problem may be in a blocking operation. You can create a trivially blocking operation using time.Sleep, which block but does not have side effects (apart from obviously waiting a bit).
Given this code:
If I remove the call to
fn
it doesn't hang anymore.It's really hard for me to simplify my code and give you a working example, I wasn't able to reproduce this bug outside of my actual code.
I compiled using the 0.13.1 docker image with the following params:
The text was updated successfully, but these errors were encountered: