Skip to content

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

Closed

Description

@stan1334

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)

Activity

  1. stan1334 commented on Aug 7, 2020

    @stan1334
    Author

    @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

  2. changed the title [-]mips64le fsnotify moudle cannot recv sysevent[/-] [+]fsnotify moudle demo cannot recv sysevents on mips64le[/+] on Aug 7, 2020
  3. changed the title [-]fsnotify moudle demo cannot recv sysevents on mips64le[/-] [+]x/sys: fsnotify module demo cannot recv sysevents on mips64le[/+] on Aug 7, 2020
  4. added this to the Unreleased milestone on Aug 7, 2020
  5. toothrot commented on Aug 7, 2020

    @toothrot
    Contributor

    Do you have the full error output?

  6. stan1334 commented on Aug 10, 2020

    @stan1334
    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

  7. andybons commented on Aug 10, 2020

    @andybons
    Member
  8. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Aug 10, 2020
  9. ianlancetaylor commented on Aug 10, 2020

    @ianlancetaylor
    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.

  10. added
    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
    on Aug 10, 2020
  11. stan1334 commented on Aug 11, 2020

    @stan1334
    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。

  12. ianlancetaylor commented on Aug 11, 2020

    @ianlancetaylor
    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.

  13. stan1334 commented on Aug 11, 2020

    @stan1334
    Author

    @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

  14. ianlancetaylor commented on Aug 11, 2020

    @ianlancetaylor
    Contributor

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

  15. stan1334 commented on Aug 12, 2020

    @stan1334
    Author

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

    Do you mean the test case

  16. ianlancetaylor commented on Aug 12, 2020

    @ianlancetaylor
    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"?

  17. stan1334 commented on Aug 12, 2020

    @stan1334
    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

  18. ianlancetaylor commented on Aug 12, 2020

    @ianlancetaylor
    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.

  19. stan1334 commented on Aug 12, 2020

    @stan1334
    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)

  20. stan1334 commented on Aug 13, 2020

    @stan1334
    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

  21. ianlancetaylor commented on Aug 13, 2020

    @ianlancetaylor
    Contributor

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

  22. stan1334 commented on Aug 14, 2020

    @stan1334
    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 }

  23. ianlancetaylor commented on Aug 14, 2020

    @ianlancetaylor
    Contributor

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

  24. mvdan commented on Jun 15, 2021

    @mvdan
    Member

    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.

  25. locked and limited conversation to collaborators on Jun 15, 2022
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

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions