apache / mynewt-mcumgr-cli

MCU Manager CLI
https://mynewt.apache.org/
Apache License 2.0
63 stars 39 forks source link

Error: errno 0 when running cross-compiled executable on Yocto ARM system #1

Closed calumljohnston closed 5 years ago

calumljohnston commented 6 years ago

When trying to run the command: root@02c00081527f2ae6:~# ./mcumgr -c serial1 image list

The only output is the line: Error: errno 0

The program itself runs fine when browsing help, setting up serial1 etc.

Running: root@02c00081527f2ae6:~# ./mcumgr -c serial1 image list -l DEBUG

Outputs:

DEBU[2018-06-25 14:31:26.074] goroutine 1 [running]:
mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util.NewNewtError(0x10d0e3c0, 0x7, 0x7)
    /home/calum/go/src/mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:77 +0xc4
mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util.ChildNewtError(0x66e678, 0x93a448, 0x93a448)
    /home/calum/go/src/mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:103 +0x74
mynewt.apache.org/newtmgr/newtmgr/cli.GetXport(0x0, 0x0, 0x0, 0x0)
    /home/calum/go/src/mynewt.apache.org/newtmgr/newtmgr/cli/common.go:161 +0x228
mynewt.apache.org/newtmgr/newtmgr/cli.GetSesn(0x0, 0x0, 0x10c000e0, 0x10c4e460)
    /home/calum/go/src/mynewt.apache.org/newtmgr/newtmgr/cli/common.go:318 +0x198
mynewt.apache.org/newtmgr/newtmgr/cli.imageStateListCmd(0x10d50900, 0x10d08420, 0x0, 0x4)
    /home/calum/go/src/mynewt.apache.org/newtmgr/newtmgr/cli/image.go:90 +0x18
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).execute(0x10d50900, 0x10d08340, 0x4, 0x4, 0x10d50900, 0x10d08340)
    /home/calum/go/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:654 +0x1f4
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x10d50000, 0x10c3df88, 0x4, 0x10d0c030)
    /home/calum/go/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:729 +0x1ec
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).Execute(0x10d50000, 0x620f5c, 0x10c14a00)
    /home/calum/go/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:688 +0x1c
main.main()
    /home/calum/go/src/github.com/apache/mynewt-mcumgr-cli/mcumgr/mcumgr.go:94 +0xd4

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
    /usr/lib/go-1.10/src/runtime/sigqueue.go:139 +0x130
os/signal.loop()
    /usr/lib/go-1.10/src/os/signal/signal_unix.go:22 +0x14
created by os/signal.init.0
    /usr/lib/go-1.10/src/os/signal/signal_unix.go:28 +0x30

goroutine 7 [select, locked to thread]:
runtime.gopark(0x6220ac, 0x0, 0x5f9174, 0x6, 0x18, 0x1)
    /usr/lib/go-1.10/src/runtime/proc.go:291 +0xfc
runtime.selectgo(0x10c2a7a0, 0x10c6c240)
    /usr/lib/go-1.10/src/runtime/select.go:392 +0xe98
runtime.ensureSigM.func1()
    /usr/lib/go-1.10/src/runtime/signal_unix.go:549 +0x1c0
runtime.goexit()
    /usr/lib/go-1.10/src/runtime/asm_arm.s:1015 +0x4

goroutine 17 [chan receive]:
main.main.func1(0x10c14a00)
    /home/calum/go/src/github.com/apache/mynewt-mcumgr-cli/mcumgr/mcumgr.go:82 +0x30
created by main.main
    /home/calum/go/src/github.com/apache/mynewt-mcumgr-cli/mcumgr/mcumgr.go:80 +0xcc

Error: errno 0

Not hugely knowledgable in go so may be doing something wrong here but help would be appreciated.

carlescufi commented 6 years ago

CC @ccollins476ad @utzig

parinpatel commented 6 years ago

@calumljohnston @carlescufi @ccollins476ad @utzig Is there any update on this issue?

utzig commented 6 years ago

Is this ARM32 or ARM64? Could you post the contents of ~/.mcumgr.cp.json?

parinpatel commented 6 years ago

I used arm64, Currently I could not find the ".mcumgr.cp.json" file in my system. It may be not generated in my system.

parinpatel commented 6 years ago

@calumljohnston @carlescufi @ccollins476ad @utzig Hi all, I resolved the issue by some changes in "newtmgr" packages. I also attached the patch file. I am not sure this patch help to everyone with the same error but It was resolved my error.

0001-Resolved-the-Error-errno-0-when-running-cross-compile.zip

@utzig Thanks for your prompt response

KosingZhu commented 5 years ago

i meet the same problem. i have no idea to do that. anything new progress about this problem, pls be kindly to let me konow. @utzig

utzig commented 5 years ago

@calumljohnston @parinpatel @KosingZhu The issue should have been fixed by #10. Please update from master and if the problem persists, feel free to reopen this issue!