Skip to content
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

x/tools/go/pointer: failure with Entering directory and no other output #52824

Closed
bcmills opened this issue May 10, 2022 · 7 comments
Closed
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented May 10, 2022

Entering directory `/workdir/gopath/src/golang.org/x/tools/go/pointer'
Entering directory `/workdir/gopath/src/golang.org/x/tools/go/pointer'
FAIL	golang.org/x/tools/go/pointer	121.027s

greplogs -l -e '^Entering directory .*\nFAIL\s+golang\.org/x/tools/go/pointer'
2022-05-09T19:54:59-b87ceec-f088f49/linux-amd64-longtest

@bcmills bcmills added this to the Backlog milestone May 10, 2022
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label May 10, 2022
@gopherbot gopherbot modified the milestones: Backlog, Unreleased May 10, 2022
@bcmills
Copy link
Contributor Author

bcmills commented May 10, 2022

(attn @timothy-king @zpavlinovic)

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 10, 2022
@bcmills
Copy link
Contributor Author

bcmills commented May 10, 2022

The lack of output could possibly be due to an unexpected call to os.Exit from within the Example test.

(The testing package buffers example output for comparison, so if the process exits during an Example its output may be stuck in the buffer.)

@zpavlinovic zpavlinovic added the Analysis Issues related to static analysis (vet, x/tools/go/analysis) label May 10, 2022
@zpavlinovic
Copy link
Contributor

Does this issue still appear? I was not able to reproduce it locally (go test) or on slowbot builders (TRY=linux-amd64-longtest).

I've tried creating some illustrative examples where Example abruptly ends using return, panic, and os.Exit. I've always got some output, even for os.Exit.

panic: unexpected call to os.Exit(0) during test [recovered]
        panic: unexpected call to os.Exit(0) during test

It is possible that the issue appears under certain timing conditions (or that I am missing something obvious).

I've also went through callees of Example to see if they use os.Exit. I wasn't able to find anything, but my search wasn't exhaustive tbh.

Any other suggestions for reproducing this?

@bcmills
Copy link
Contributor Author

bcmills commented May 18, 2022

Does this issue still appear?

There is only one occurrence so far in the logs. This is probably a nondeterministic failure of some sort, or perhaps a bad failure mode of some subprocess being terminated due to memory exhaustion.

@zpavlinovic
Copy link
Contributor

If any action is needed atm, should we somehow change this from Example to Test* where we check for string equality rather than relying on Output?

@bcmills
Copy link
Contributor Author

bcmills commented May 24, 2022

The Example failure mode that I suspect looks something like this:

$ cat main_test.go
package main

import (
        "fmt"
        "os"
)

func Example() {
        fmt.Println("hah!")
        os.Exit(1)

        // Output:
        // hah!
}

$ go test
exit status 1
FAIL    example 0.008s

But it's also entirely possible that the failure was caused by something else in the process. 🤔

Probably the thing to do for now is just wait for clues from any similar failures.

@adonovan
Copy link
Member

Strange. I don't see any calls to os.Exit (except indirectly via log.Fatal or similar, which prints an error), and in any case the test driver now detects and reports this mistake. The only calls to t.Fail (which prints no message) are after calls to doOneInput, which maintains the invariant that a false result is never returned without an error being printed.

The "Entering directory" message doesn't mean the failure is necessarily in that Test function (as your discussion of Example implicitly acknowledges), but none of the other tests looks suspicious.

I think it's "impossible", which suggests an external event killed the process. I don't think the go/pointer package itself has a fault. Closing this for now. Feel free to reopen if it recurs.

@golang golang locked and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants