Skip to content

cmd/compile: GOSSAHASH debugging switch needs to be accessible outside SSA #53937

Closed

Description

@dr2chase

From time to time when debugging the compiler, it is helpful to use the GOSSAHASH environment variable to switch modified code on/off to search for exactly where a bug has its effect. However, this is currently limited to the ssa package. In the past I've edited the code to make it accessible outside of ssa when I needed it, and then discarded the edit. This seems like a waste of time, I've done this more than once, so it should be refactored into base.

Activity

  1. self-assigned this
    on Jul 18, 2022
  2. gopherbot commented on Jul 18, 2022

    @gopherbot
    Contributor

    Change https://go.dev/cl/418015 mentions this issue: cmd/compile: refactor GOSSAHASH debugging to make it usable outside ssa package.

  3. laboger commented on Jul 18, 2022

    @laboger
    Contributor

    Is there any documentation on how GOSSAHASH can be used? I see GOSSAFUNC mentioned in cmd/compile/internal/ssa/README.md.

  4. dr2chase commented on Jul 18, 2022

    @dr2chase
    ContributorAuthor

    Common case for me is to use it in conjunction with a program I wrote that uses it to implement a search (github.com/dr2chase/gossahash which could itself use better documentation). I added a comment to the new source code that might work for you, if it needs more, this is a good time to ask:

    https://go-review.googlesource.com/c/go/+/418015/2/src/cmd/compile/internal/base/hashdebug.go

    Oh, right away (checking my shell history for examples) I see a missing tweak GOMAXPROCS=1 gossahash -- ./make.bash, got to run the compiler single threaded if that is what is failing, if you want a good search.

  5. added this to the Go1.20 milestone on Jul 20, 2022
  6. Repository owner moved this from In Progress to Done in Go Compiler / Runtime / Commandon Aug 10, 2022
  7. locked and limited conversation to collaborators on Aug 10, 2023
  8. added a commit that references this issue on Feb 10, 2024
    522f0fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions