Panic: runtime error: invalid memory address #870

Closed
opened 1 year ago by Dave · 8 comments
Dave commented 1 year ago

I thought I should report this.

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

goroutine 68 [running]:
gopkg.in/gomail%2ev2.send(0x0, 0x0, 0xc024aa0140, 0x140f9a8, 0xc000465600)
	/home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:57 +0x91
gopkg.in/gomail%2ev2.Send(0x0, 0x0, 0xc000177f68, 0x1, 0x1, 0x2, 0x0)
	/home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:38 +0x73
code.vikunja.io/api/pkg/mail.StartMailDaemon.func1()
	/bigus/vikunja/api/pkg/mail/mail.go:73 +0x345
created by code.vikunja.io/api/pkg/mail.StartMailDaemon
	/bigus/vikunja/api/pkg/mail/mail.go:55 +0x167

The entry in standard.log was this:

2021-05-24T14:06:05.707537588-07:00: ERROR	▶ mail/func1 0ea Error during connect to smtp server: %s x509: certificate has expired or is not yet valid: current time 2021-05-24T14:06:05-07:00 is after 2020-06-23T17:36:24Z

The version I used was git cloned at the commit indicated below:

> git log --oneline | head -1
67f86312 Update module go-testfixtures/testfixtures/v3 to v3.6.1 (#868)
> ./vikunja version
Vikunja api version v0.17.0+11-67f863120e
Built with go1.15.8

on OS

FreeBSD 12.2-STABLE r368820 amd64
I thought I should report this. ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x18512b1] goroutine 68 [running]: gopkg.in/gomail%2ev2.send(0x0, 0x0, 0xc024aa0140, 0x140f9a8, 0xc000465600) /home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:57 +0x91 gopkg.in/gomail%2ev2.Send(0x0, 0x0, 0xc000177f68, 0x1, 0x1, 0x2, 0x0) /home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:38 +0x73 code.vikunja.io/api/pkg/mail.StartMailDaemon.func1() /bigus/vikunja/api/pkg/mail/mail.go:73 +0x345 created by code.vikunja.io/api/pkg/mail.StartMailDaemon /bigus/vikunja/api/pkg/mail/mail.go:55 +0x167 ``` The entry in `standard.log` was this: ``` 2021-05-24T14:06:05.707537588-07:00: ERROR ▶ mail/func1 0ea Error during connect to smtp server: %s x509: certificate has expired or is not yet valid: current time 2021-05-24T14:06:05-07:00 is after 2020-06-23T17:36:24Z ``` The version I used was git cloned at the commit indicated below: ``` > git log --oneline | head -1 67f86312 Update module go-testfixtures/testfixtures/v3 to v3.6.1 (#868) > ./vikunja version Vikunja api version v0.17.0+11-67f863120e Built with go1.15.8 ``` on OS ``` FreeBSD 12.2-STABLE r368820 amd64 ```
Owner

The panic shouldn't happen, but this looks like the TLS certificate of the mail server is not valid.
You could disable the certificate verification: https://vikunja.io/docs/config-options/#skiptlsverify

Does the error go away when you enable that option?

I'll leave this issue open until the panicking itself is fixed and the error is handled properly.

The panic shouldn't happen, but this looks like the TLS certificate of the mail server is not valid. You could disable the certificate verification: https://vikunja.io/docs/config-options/#skiptlsverify Does the error go away when you enable that option? I'll leave this issue open until the panicking itself is fixed and the error is handled properly.
Dave commented 1 year ago
Poster

I can't be 100% sure, since I am new to this software, but it seems it works now. I do see a mail message sent after skiptlsverify was set to true.

The mail certificates here are self-signed and won't verify. I know I can use Let's Encrypt to get a valid one, but as a developer myself I do not believe the software should panic with a SEGV for any reason. :)

I can't be 100% sure, since I am new to this software, but it seems it works now. I do see a mail message sent after skiptlsverify was set to true. The mail certificates here are self-signed and won't verify. I know I can use Let's Encrypt to get a valid one, but as a developer myself I do not believe the software should panic with a SEGV for any reason. :)
Owner

Oh yeah it definitely should not panic 🙃

Oh yeah it definitely should not panic 🙃
konrad added the
kind/bug
label 1 year ago
Owner

Is this still relevant?

Is this still relevant?
Poster

I hadn't seen a new release, but it has been a while. Certainly git pull shows changes. I'll recompile main and take a look.

I hadn't seen a new release, but it has been a while. Certainly git pull shows changes. I'll recompile main and take a look.
Poster

2021-08-01T14:20:35.278239141-07:00: ERROR ▶ mail/func1 d78 Error during connect to smtp server: %s x509: certificate has expired or is not yet valid: current time 2021-08-01T14:20:35-07:00 is after 2020-06-23T17:36:24Z

So this is the message I now get and vikunja is no longer running. I did not find a corefile but running it in the foreground I get this:

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

goroutine 54 [running]:
gopkg.in/gomail%2ev2.send(0x0, 0x0, 0xc000970820, 0x1292008, 0xc000827f40)
/home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:57 +0x97
gopkg.in/gomail%2ev2.Send(0x0, 0x0, 0xc000927f88, 0x1, 0x1, 0x2, 0x1)
/home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:38 +0x73
code.vikunja.io/api/pkg/mail.StartMailDaemon.func1()
/bigus/vikunja/api/pkg/mail/mail.go:73 +0x345
created by code.vikunja.io/api/pkg/mail.StartMailDaemon
/bigus/vikunja/api/pkg/mail/mail.go:55 +0x167

> 2021-08-01T14:20:35.278239141-07:00: ERROR ▶ mail/func1 d78 Error during connect to smtp server: %s x509: certificate has expired or is not yet valid: current time 2021-08-01T14:20:35-07:00 is after 2020-06-23T17:36:24Z So this is the message I now get and vikunja is no longer running. I did not find a corefile but running it in the foreground I get this: > panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x16e5817] >goroutine 54 [running]: gopkg.in/gomail%2ev2.send(0x0, 0x0, 0xc000970820, 0x1292008, 0xc000827f40) /home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:57 +0x97 gopkg.in/gomail%2ev2.Send(0x0, 0x0, 0xc000927f88, 0x1, 0x1, 0x2, 0x1) /home/dave/go/pkg/mod/gopkg.in/gomail.v2@v2.0.0-20160411212932-81ebce5c23df/send.go:38 +0x73 code.vikunja.io/api/pkg/mail.StartMailDaemon.func1() /bigus/vikunja/api/pkg/mail/mail.go:73 +0x345 created by code.vikunja.io/api/pkg/mail.StartMailDaemon /bigus/vikunja/api/pkg/mail/mail.go:55 +0x167
Owner

I've just pushed a fix in f237afd2ac which should prevent the panic. I wasn't able to get a panic before that commit either, could you try to see if it really fixed it?

I've just pushed a fix in f237afd2accb16d2d6769f8bb224c12405a6c80d which should prevent the panic. I wasn't able to get a panic before that commit either, could you try to see if it really fixed it?
Owner

Closing as resolved, feel free to ping or reopen if you have other issues.

Closing as resolved, feel free to ping or reopen if you have other issues.
konrad closed this issue 11 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.