Open suntong opened 7 years ago
OK, got the exact error as before when redoing the 60MB one:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x5a0a20]
goroutine 1 [running]:
github.com/go-gomail/gomail.(*base64LineWriter).Write(0xc4203e0080, 0xc4202744b8, 0x400, 0x400, 0xc4200fc000, 0x300, 0x8000)
/path/to/Go/src/github.com/go-gomail/gomail/writeto.go:292 +0x70
encoding/base64.(*encoder).Write(0xc420274480, 0xc4200fc000, 0x8000, 0x8000, 0x8000, 0x0, 0x0)
/usr/lib/go-1.8/src/encoding/base64/base64.go:197 +0x2b3
io.copyBuffer(0x7fe934985b98, 0xc420274480, 0x847440, 0xc42012e008, 0xc4200fc000, 0x8000, 0x8000, 0xc42012e008, 0x0, 0x0)
/usr/lib/go-1.8/src/io/io.go:392 +0x20b
io.Copy(0x7fe934985b98, 0xc420274480, 0x847440, 0xc42012e008, 0x0, 0x40e2d8, 0x6c0120)
/usr/lib/go-1.8/src/io/io.go:360 +0x68
So,
Confirmed.
Please verify. Thx.
New evidences show that it might not be size related, because
So this is more like a memory related glitch, that might not be that easily to catch. But I do believe that the bigger in size the attainments are, the more likely it will error out.
I'm using gomail to send 15 HUGE images, embedded in the message body, with a total of 60M in size.
This is the first time I'm sending messages of this big, and found that gomail cannot handle it. Here are the errors:
The above are from Latest commit (81ebce5 on Apr 11, 2016) https://github.com/go-gomail/gomail/tree/81ebce5c23dfd25c6c67194b37d3dd3f338c98b1, and is triggered from the
DialAndSend
line of my code, after having doneEmbed()
andNewDialer
. The same code works for smaller-size messages. The biggest I've done this far is 10MB.Will try a 18MB one (in 5 files) and report back -- Yep, works fine. Will try a 30MB one (in 9 files) and report back -- Yep, works fine. Will try a 40MB one and report back -- Yep, works fine. Will try a 50MB one and report back -- Yep, works fine. So, will try again with the 60MB one next Monday and report back.