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/sys: fsnotify module demo cannot recv sysevents on mips64le #40633

Closed
stan1334 opened this issue Aug 7, 2020 · 19 comments
Closed

x/sys: fsnotify module demo cannot recv sysevents on mips64le #40633

stan1334 opened this issue Aug 7, 2020 · 19 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@stan1334
Copy link

stan1334 commented Aug 7, 2020

What version of Go are you using (go version)?

1.13.9/mips64le and 1.14.4

$ go version

Does this issue reproduce with the latest release?

The new version does not reappear
golang.org/x/sys@v0.0.0-20200805065543-0cf7623e9dbd

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="mips64le"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="mips64le"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/home/golang1.13.9"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/golang1.13.9/pkg/tool/linux_mips64le"
GCCGO="gccgo"
GOMIPS64="hardfloat"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -mabi=64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build378991297=/tmp/go-build -gno-record-gcc-switches"

What did you do?

write go.demo and test -v ./touchoff

  1 package touchoff
  2 
  3 import (
  4         "testing"
  5         "fmt"
  6         "github.com/fsnotify/fsnotify"
  7 )
  8 
  9 func TestTouchOff(t *testing.T){
 10 
 11         fmt.Printf("here is test over\n")
 12         fsWatcher, err := fsnotify.NewWatcher()
 13         if err != nil {
 14                 fmt.Println(err)
 15         }
 16 
 17         err1 := fsWatcher.Add("/home/tmp/")
 18         if err1 != nil {
 19                 fmt.Printf("1111111111111111111111111111111-----------------error is--------%v\n", err1)
 20         }
 21 
 22         fmt.Printf("0000000000000000000000000000000000000\n")
 23 
 24         for {
 25                 select{
 26                 case event := <-fsWatcher.Events:
 27                         fmt.Printf("222222%v\n", event.Op)
 28                 }
 29         }
 30 }

What did you expect to see?

What can I do to receive system events

What did you see instead?

goroutine 8 [syscall]:
syscall.Syscall6(0x1459, 0x6, 0xc0000efbd8, 0x7, 0xffffffffffffffff, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/golang1.13.9/src/syscall/asm_linux_mips64x.s:40 +0x10
k8s.io/kubernetes/vendor/golang.org/x/sys/unix.EpollWait(0x6, 0xc0000efbd8, 0x7, 0x7, 0xffffffffffffffff, 0x0, 0x0, 0x0)
	/root/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go:1760 +0x70
k8s.io/kubernetes/vendor/github.com/fsnotify/fsnotify.(*fdPoller).wait(0xc000016300, 0x0, 0x0, 0x0)
	/root/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/fsnotify/fsnotify/inotify_poller.go:86 +0x7c
k8s.io/kubernetes/vendor/github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc0000b8050)
@stan1334
Copy link
Author

stan1334 commented Aug 7, 2020

@evanphx please help me, What should I do to get system catalog monitoring events in this version。 golang.org/x/sys@v0.0.0-20200805065543-0cf7623e9dbd

@stan1334 stan1334 changed the title mips64le fsnotify moudle cannot recv sysevent fsnotify moudle demo cannot recv sysevents on mips64le Aug 7, 2020
@toothrot toothrot changed the title fsnotify moudle demo cannot recv sysevents on mips64le x/sys: fsnotify module demo cannot recv sysevents on mips64le Aug 7, 2020
@gopherbot gopherbot added this to the Unreleased milestone Aug 7, 2020
@toothrot
Copy link
Contributor

toothrot commented Aug 7, 2020

Do you have the full error output?

@stan1334
Copy link
Author

Do you have the full error output?
detail error info:

goroutine 8 [syscall]:
syscall.Syscall6(0x1459, 0x6, 0xc0000efbd8, 0x7, 0xffffffffffffffff, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/golang1.13.9/src/syscall/asm_linux_mips64x.s:40 +0x10
k8s.io/kubernetes/vendor/golang.org/x/sys/unix.EpollWait(0x6, 0xc0000efbd8, 0x7, 0x7, 0xffffffffffffffff, 0x0, 0x0, 0x0)
/root/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go:1760 +0x70
k8s.io/kubernetes/vendor/github.com/fsnotify/fsnotify.(*fdPoller).wait(0xc000016300, 0x0, 0x0, 0x0)
/root/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/fsnotify/fsnotify/inotify_poller.go:86 +0x7c
k8s.io/kubernetes/vendor/github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc0000b8050)

demo test error:
when i create or delete file on watch dir,cannot recv anything sys events

@andybons
Copy link
Member

@ianlancetaylor

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 10, 2020
@ianlancetaylor
Copy link
Contributor

What kernel version are you using?

You are not showing us the complete error output. The program is printing something before goroutine 8 [syscall]:. Show us that. Thanks.

@andybons andybons added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 10, 2020
@stan1334
Copy link
Author

What kernel version are you using?

You are not showing us the complete error output. The program is printing something before goroutine 8 [syscall]:. Show us that. Thanks.

3.10 kernel version
The above error message is kubernetes unit test。 i test on local golang demo,No error details, unable to wait until the event, you can test it locally on mips64le。

@ianlancetaylor
Copy link
Contributor

@duchuanLX According to https://golang.org/wiki/MinimumRequirements, little-endian MIPS requires Linux kernel version newer than 4.1. Linux kernel version 3.10 is not supported. Sorry.

@stan1334
Copy link
Author

stan1334 commented Aug 11, 2020

@duchuanLX According to https://golang.org/wiki/MinimumRequirements, little-endian MIPS requires Linux kernel version newer than 4.1. Linux kernel version 3.10 is not supported. Sorry.

Thank you very much, why did the 3.10 kernel pass the test in the sys2020 version?
golang.org/x/sys@v0.0.0-20200805065543-0cf7623e9dbd

@ianlancetaylor
Copy link
Contributor

Probably because the x/sys tests are not very good.

@stan1334
Copy link
Author

Probably because the x/sys tests are not very good.

Do you mean the test case

@ianlancetaylor
Copy link
Contributor

I'm sorry, I do not understand the question.

When you asked "why did the 3.10 kernel pass the test in the sys2020 version?" what did you mean by "the test"?

@stan1334
Copy link
Author

I'm sorry, I do not understand the question.

When you asked "why did the 3.10 kernel pass the test in the sys2020 version?" what did you mean by "the test"?
I rearranged the problem. I tested a fsnotify module under the 3.10 kernel golang/sys2019 version on the mips64le loongson3A machine, and wrote a demo file to monitor the file directory. Once the monitored directory has file changes: such as file creation and file deletion, related information will be printed, but I did not receive the information.
In the same environment, I passed the test under X86.
When I updated the golang/sys 2020 version on the MIPS platform, the test passed.
I am replacing the 4.19 kernel on the MIPS platform.

sys version platfrom kernelversion res
2019 X86 3.10- PASS
2020 X86 3.10- PASS
2019 MIPS 3.10- FAIL
2020 MIPS 3.10- PASS
2019 MIPS 4.19 testing

@ianlancetaylor
Copy link
Contributor

As it says on the wiki page I mentioned, https://golang.org/wiki/MinimumRequirements, the minimum kernel version required for MIPS is 4.8. The minimum kernel version for x86 is 2.6.23. So it is not surprising that x86 passes.

In your little table, I don't know what "sys" means, and I don't know what 2019 and 2020 mean. I assume that 2020 is newer, so it sounds like it passes. That seems good.

The fact that the minimum requirement for MIPS is 4.8 doesn't mean that all earlier versions will always fail. It only means that programs may fail on earlier versions, and we won't try to fix them. Whether they fail or not depends on exactly what they do.

@stan1334
Copy link
Author

As it says on the wiki page I mentioned, https://golang.org/wiki/MinimumRequirements, the minimum kernel version required for MIPS is 4.8. The minimum kernel version for x86 is 2.6.23. So it is not surprising that x86 passes.

In your little table, I don't know what "sys" means, and I don't know what 2019 and 2020 mean. I assume that 2020 is newer, so it sounds like it passes. That seems good.

The fact that the minimum requirement for MIPS is 4.8 doesn't mean that all earlier versions will always fail. It only means that programs may fail on earlier versions, and we won't try to fix them. Whether they fail or not depends on exactly what they do.

golang.org/x/sys version platfrom kernelversion res
2019 X86 3.10- PASS
2020 X86 3.10- PASS
2019 MIPS64LE 3.10- FAIL(cannot recv any os events)
2020 MIPS64LE 3.10- PASS
2019 MIPS64LE 4.19 FAIL(os crush,i trying install new kernel again)

@stan1334
Copy link
Author

As it says on the wiki page I mentioned, https://golang.org/wiki/MinimumRequirements, the minimum kernel version required for MIPS is 4.8. The minimum kernel version for x86 is 2.6.23. So it is not surprising that x86 passes.

In your little table, I don't know what "sys" means, and I don't know what 2019 and 2020 mean. I assume that 2020 is newer, so it sounds like it passes. That seems good.

The fact that the minimum requirement for MIPS is 4.8 doesn't mean that all earlier versions will always fail. It only means that programs may fail on earlier versions, and we won't try to fix them. Whether they fail or not depends on exactly what they do.

As it says on the wiki page I mentioned, https://golang.org/wiki/MinimumRequirements, the minimum kernel version required for MIPS is 4.8. The minimum kernel version for x86 is 2.6.23. So it is not surprising that x86 passes.

In your little table, I don't know what "sys" means, and I don't know what 2019 and 2020 mean. I assume that 2020 is newer, so it sounds like it passes. That seems good.

The fact that the minimum requirement for MIPS is 4.8 doesn't mean that all earlier versions will always fail. It only means that programs may fail on earlier versions, and we won't try to fix them. Whether they fail or not depends on exactly what they do.

golang.org/x/sys-version platfrom kernelversion res appearance
golang.org/x/sys@v0.0.0-20190813064441-fde4db37ae7a X86 3.10- PASS
golang.org/x/sys@v0.0.0-20200805065543-0cf7623e9dbd X86 3.10- PASS
golang.org/x/sys@v0.0.0-20190813064441-fde4db37ae7a MIPS 3.10- FAIL cannot recv any os events about file,such as create file or delete file
golang.org/x/sys@v0.0.0-20200805065543-0cf7623e9dbd MIPS 3.10- PASS
golang.org/x/sys@v0.0.0-20190813064441-fde4db37ae7a MIPS 4.19- FAIL cannot recv any os events about file,such as create file or delete file
golang.org/x/sys@v0.0.0-20200805065543-0cf7623e9dbd MIPS 4.19- PASS

@ianlancetaylor
Copy link
Contributor

I'm sorry, I don't understand. Is there still a bug here? Is there something to fix?

@stan1334
Copy link
Author

I'm sorry, I don't understand. Is there still a bug here? Is there something to fix?

golang.org/x/sys@v0.0.0-20190813064441-fde4db37ae7a MIPS64 cannot recv os event。

unix/zsyscall_linux_mips64le.go:1790

func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
1784 var _p0 unsafe.Pointer
1785 if len(events) > 0 {
1786 _p0 = unsafe.Pointer(&events[0])
1787 } else {
1788 _p0 = unsafe.Pointer(&_zero)
1789 }
1790 r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
1791 n = int(r0)
1792 if e1 != 0 {
1793 err = errnoErr(e1)
1794 }
1795 return
1796 }

@ianlancetaylor
Copy link
Contributor

From what you say above it sounds like that problem is already fixed in a later version of golang.org/x/sys.

@mvdan
Copy link
Member

mvdan commented Jun 15, 2021

Closing old issues that still have the WaitingForInfo label where enough details to investigate weren't provided. Feel free to leave a comment with more details and we can reopen.

@mvdan mvdan closed this as completed Jun 15, 2021
@golang golang locked and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants