Strange behaviour with loops #45192, #45175

86 views
Skip to first unread message

sro...@gmail.com

unread,
Apr 7, 2021, 4:46:44 PM4/7/21
to golang-nuts
Is there a way to analyze a go program and determine whether it is susceptible to bug https://github.com/golang/go/issues/45175?
While the obvious solution is to upgrade to 1.15.11 or 1.16.3, it would still be useful to analyze existing programs, either as a compiled binary or source code.
Thank you. Sebastien

Ian Lance Taylor

unread,
Apr 7, 2021, 5:37:53 PM4/7/21
to sro...@gmail.com, golang-nuts
On Wed, Apr 7, 2021 at 1:47 PM sro...@gmail.com <sro...@gmail.com> wrote:
>
> Is there a way to analyze a go program and determine whether it is susceptible to bug https://github.com/golang/go/issues/45175?
> While the obvious solution is to upgrade to 1.15.11 or 1.16.3, it would still be useful to analyze existing programs, either as a compiled binary or source code.

There is no simple way to do this. It's an unfortunate bug, but it's
rare, and is dependent on the exact compilation process.

The simplest way to detect a possible problem might be to compile the
package with both 1.15.10 and 1.15.11 and compare the generated
output.

Ian

Keith Randall

unread,
Apr 7, 2021, 8:05:10 PM4/7/21
to golang-nuts
If you look at CL 304251, there's one place where we added "return false". Put a panic just before that line (in 1.15.11 or 1.16.3), rebuild the compiler, then rebuild your program and see if your program triggers that panic.

Sebastien Rosset

unread,
Apr 7, 2021, 10:19:56 PM4/7/21
to Keith Randall, golang-nuts
That's a great idea. Thank you! I am doing that right now.

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/28J9lE4yoHI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f3b69bbf-3a13-4786-924c-0e874c49ffd9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages