testsuite icon indicating copy to clipboard operation
testsuite copied to clipboard

nil pointer dereference in test

Open cjslep opened this issue 3 years ago • 1 comments

Server crashed due to a nil URL in the server DB, maybe related to #8 :

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5c31da]

goroutine 2962 [running]:
net/url.(*URL).String(0x0, 0xc0003f4000, 0x0)
        net/url/url.go:775 +0x4a
github.com/go-fed/testsuite/server.(*Database).Create(0xc0001b5c00, 0x26137e0, 0xc0001b4cc0, 0x7fc849cbefd8, 0xc0003f4000, 0x0, 0x0)
        github.com/go-fed/testsuite/server/db.go:145 +0x5a
github.com/go-fed/testsuite/server.(*baseTest).helperMustAddToDatabase(0xc0001a7920, 0xc000258160, 0xc0003ca980, 0x7fc849cbefd8, 0xc0003f4000, 0x0)
        github.com/go-fed/testsuite/server/tests.go:276 +0x20f
github.com/go-fed/testsuite/server.newCommonTests.func2(0xc0001a7920, 0xc000258160, 0xc0000b5800, 0x1, 0xe, 0xc0001d6488)
        github.com/go-fed/testsuite/server/tests.go:975 +0x48c
github.com/go-fed/testsuite/server.(*baseTest).MaybeRunResult(0xc0001a7920, 0xc000258160, 0xc0000b5800, 0x1, 0xe, 0x0)
        github.com/go-fed/testsuite/server/tests.go:256 +0x5b
github.com/go-fed/testsuite/server.(*TestRunner).iterate(0xc0001d6480, 0xc000258160, 0x0, 0xd)
        github.com/go-fed/testsuite/server/testrunner.go:106 +0x144
github.com/go-fed/testsuite/server.(*TestRunner).Run.func1(0xc0001d6480, 0xc000258160)
        github.com/go-fed/testsuite/server/testrunner.go:71 +0x412
created by github.com/go-fed/testsuite/server.(*TestRunner).Run
        github.com/go-fed/testsuite/server/testrunner.go:65 +0xda

cjslep avatar Mar 06 '21 11:03 cjslep

Same problem here. Have you managed to get around this somehow?

gerard76 avatar Oct 18 '22 09:10 gerard76