Re: newtmgr OTA error: slice bounds out of range [:-62]

2022-12-07 Thread Szymon Janc
Hi,

We are able to reproduce this on newtmgr master (1.11-dev), will try to fix
this before next release

On Fri, 16 Sept 2022 at 03:22, Mo Chen  wrote:

> Hi there,
>
> I encountered errors when using mynewt to DFU OTA.
>
> Environment:
> Intel Macbook pro
> MacOS: Monterey 12.5.1
>
> newt version: 1.10.0
> newtmgr version: tried with v1.10.0 and v1.9.0. Neither works with the same
> error.
>
> Any clues or help are highly appreciated!
>
>
> error message:
>
> mndrive@Mos-MBP-MnDRIVE ~ % newtmgr image upload -c testbrd
>
> /Users/xxx/Documents/Mynewt/test/bin/targets/testbrd/app/apps/testbrd/testbrd.img
>
>  0 / 163232 [--]
>   0.00%panic:
> runtime error: slice bounds out of range [:-62]
>
>
> goroutine 1 [running]:
>
> mynewt.apache.org/newtmgr/nmxact/xact.encodeUploadReq({0x451a240
> 
> ?,
> 0xc000304320?}, {0xc2e140?, 0x42bd8c6?, 0x5ba48ab08a0c882f?}, 0x98?,
> {0xc00038?, 0x0?, 0x421300?}, 0x0, ...)
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:120
> +0x146
>
> mynewt.apache.org/newtmgr/nmxact/xact.findChunkLen({0x451a240
> ,
> 0xc000304320}, {0xc2e140, 0x20, 0x20}, 0x0?, {0xc00038, 0x27da0,
> 0x27da1}, 0x0, ...)
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:139
> +0x131
>
> mynewt.apache.org/newtmgr/nmxact/xact.nextImageUploadReq({0x451a240
> 
> ,
> 0xc000304320}, 0x0?, {0xc00038, 0x27da0, 0x27da1}, 0x0, 0x0?)
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:177
> +0x1eb
>
> mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUploadCmd).Run(0xc32200,
> {0x451a240, 0xc000304320})
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:353
> +0x24e
>
>
> mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUpgradeCmd).runUpload(0xc32100
> ,
> {0x451a240, 0xc000304320})
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:510
> +0x1cb
>
> mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUpgradeCmd).Run(0x7ff7bfeffbe5
> ?,
> {0x451a240?, 0xc000304320?})
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:536
> +0x6a
>
> mynewt.apache.org/newtmgr/newtmgr/cli.imageUploadCmd(0xc0001f4c80?,
> {0xc0001ad920?, 0x3?, 0x3?})
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/newtmgr/cli/image.go:212
> +0x30b
>
> github.com/spf13/cobra.(*Command).execute(0xc0001f4c80, {0xc0001ad830,
> 0x3,
> 0x3})
>
> /Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
> +0x663 
>
> github.com/spf13/cobra.(*Command).ExecuteC(0xccaf00)
>
> /Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
> +0x2ee 
>
> github.com/spf13/cobra.(*Command).Execute(...)
>
> /Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
>
> main.main()
>
>
> /Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/newtmgr/newtmgr.go:111
> +0x16f
>
>
>
> --
> Mo Chen
>


-- 
pozdrawiam
Szymon K. Janc


newtmgr OTA error: slice bounds out of range [:-62]

2022-09-15 Thread Mo Chen
Hi there,

I encountered errors when using mynewt to DFU OTA.

Environment:
Intel Macbook pro
MacOS: Monterey 12.5.1

newt version: 1.10.0
newtmgr version: tried with v1.10.0 and v1.9.0. Neither works with the same
error.

Any clues or help are highly appreciated!


error message:

mndrive@Mos-MBP-MnDRIVE ~ % newtmgr image upload -c testbrd
/Users/xxx/Documents/Mynewt/test/bin/targets/testbrd/app/apps/testbrd/testbrd.img

 0 / 163232 [--]
  0.00%panic:
runtime error: slice bounds out of range [:-62]


goroutine 1 [running]:

mynewt.apache.org/newtmgr/nmxact/xact.encodeUploadReq({0x451a240?,
0xc000304320?}, {0xc2e140?, 0x42bd8c6?, 0x5ba48ab08a0c882f?}, 0x98?,
{0xc00038?, 0x0?, 0x421300?}, 0x0, ...)

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:120
+0x146

mynewt.apache.org/newtmgr/nmxact/xact.findChunkLen({0x451a240,
0xc000304320}, {0xc2e140, 0x20, 0x20}, 0x0?, {0xc00038, 0x27da0,
0x27da1}, 0x0, ...)

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:139
+0x131

mynewt.apache.org/newtmgr/nmxact/xact.nextImageUploadReq({0x451a240,
0xc000304320}, 0x0?, {0xc00038, 0x27da0, 0x27da1}, 0x0, 0x0?)

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:177
+0x1eb

mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUploadCmd).Run(0xc32200,
{0x451a240, 0xc000304320})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:353
+0x24e

mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUpgradeCmd).runUpload(0xc32100,
{0x451a240, 0xc000304320})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:510
+0x1cb

mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUpgradeCmd).Run(0x7ff7bfeffbe5?,
{0x451a240?, 0xc000304320?})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:536
+0x6a

mynewt.apache.org/newtmgr/newtmgr/cli.imageUploadCmd(0xc0001f4c80?,
{0xc0001ad920?, 0x3?, 0x3?})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/newtmgr/cli/image.go:212
+0x30b

github.com/spf13/cobra.(*Command).execute(0xc0001f4c80, {0xc0001ad830, 0x3,
0x3})

/Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
+0x663

github.com/spf13/cobra.(*Command).ExecuteC(0xccaf00)

/Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
+0x2ee

github.com/spf13/cobra.(*Command).Execute(...)

/Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864

main.main()

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/newtmgr/newtmgr.go:111
+0x16f



-- 
Mo Chen