Skip to content

cmd/compile: unexpected NUL in input #26888

Closed

Description

@sjuliper7

Please answer these questions before submitting your issue. Thanks!

What did you do?

i have golang program like this code
package main

import "fmt"

func main() {
fmt.println("hello world")
}

but when i'm run.. "go run main.go"

C:\Go\src\fmt\print.go:10:2: read C:\Go\src\os\exec.go: unexpected NUL in input

What did you expect to see?

What did you see instead?

Does this issue reproduce with the latest release (go1.10.3)?

System details

go version go1.8.3 windows/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=".exe"
GOHOSTARCH="amd64"
GOHOSTOS="windows"
GOOS="windows"
GOPATH="D:\Internship\Golang\Go\"
GORACE=""
GOROOT="C:\Go"
GOTOOLDIR="C:\Go\pkg\tool\windows_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-m64 -mthreads -fmessage-length=0 -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
GOROOT/bin/go version: go version go1.8.3 windows/amd64
GOROOT/bin/go tool compile -V: compile version go1.8.3 X:framepointer
gdb --version: GNU gdb 5.2.1

Activity

  1. changed the title [-]unexpected NUL in input[/-] [+]cmd/compile: unexpected NUL in input[/+] on Aug 9, 2018
  2. mikioh commented on Aug 9, 2018

    @mikioh
    Contributor

    Just tried the snippet on play.golang.org and got the following:

    prog.go:6:1: cannot refer to unexported name fmt.println
    prog.go:6:1: undefined: fmt.println
    

    Is this what you want instead of "unexpected NUL in input"?

  3. cznic commented on Aug 9, 2018

    @cznic
    Contributor

    C:\Go\src\fmt\print.go:10:2: read C:\Go\src\os\exec.go: unexpected NUL in input

    Note that the code in the OP has only 7 lines but the error is reported for line 10. Perhaps there's something more to the source. Can you please paste the output of hexdump -C your-file.go or from any other equivalent program?

  4. agnivade commented on Aug 9, 2018

    @agnivade
    Contributor

    The error is reported from line 10 of fmt/print.go I believe. In any case, this does sound like the source file is messed up somehow.

  5. mvdan commented on Aug 9, 2018

    @mvdan
    Member

    @sjuliper7 are you positive that your Go installation isn't broken? It seems like the standard library source files cannot be read for some reason.

  6. added
    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
    on Aug 9, 2018
  7. cznic commented on Aug 9, 2018

    @cznic
    Contributor

    @agnivade You're right, and I'm sorry.

  8. gopherbot commented on Sep 9, 2018

    @gopherbot
    Contributor

    Timed out in state WaitingForInfo. Closing.

    (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

  9. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions