network-quality/goresponsiveness

Segmentation Fault On Broken Connections From TLS Security Failure

hawkinsw opened this issue · 3 comments

As reported by @rjmcmahon:

Configuration: Version: 1

Small URL: https://10.19.87.10:4043/small

Large URL: https://10.19.87.10:4043/large

Upload URL: https://10.19.87.10:4043/slurp

Endpoint: 


Test will end earlier than 2022-04-01 12:07:48.245840972 -0700 PDT m=+20.000768352

04-01-2022 19:07:28 UTC Go Responsiveness to [10.19.87.10:4043](http://10.19.87.10:4043/)...

Timeout expected to end at 2022-04-01 12:07:48.245840972 -0700 PDT m=+20.000768352

Started a load-generating upload (id: 1).

Started a load-generating upload (id: 2).

Started a load-generating upload (id: 3).

Started a load-generating upload (id: 4).

upload: Sleeping until 2022-04-01 12:07:29.259440488 -0700 PDT m=+1.014367975

Started a load-generating download (id: 5).

Started a load-generating download (id: 6).

Started a load-generating download (id: 7).

Started a load-generating download (id: 8).

download: Sleeping until 2022-04-01 12:07:29.261157803 -0700 PDT m=+1.016085356

GetConn host port for 8: [10.19.87.10:4043](http://10.19.87.10:4043/)

GetConn host port for 7: [10.19.87.10:4043](http://10.19.87.10:4043/)

GetConn host port for 5: [10.19.87.10:4043](http://10.19.87.10:4043/)

TCP Start of 8: tcp: [10.19.87.10:4043](http://10.19.87.10:4043/)

TCP Start of 7: tcp: [10.19.87.10:4043](http://10.19.87.10:4043/)

GetConn host port for 6: [10.19.87.10:4043](http://10.19.87.10:4043/)

TCP Start of 6: tcp: [10.19.87.10:4043](http://10.19.87.10:4043/)

TCP Done for 8: tcp: [10.19.87.10:4043](http://10.19.87.10:4043/) (<nil>)

TCP Done for 7: tcp: [10.19.87.10:4043](http://10.19.87.10:4043/) (<nil>)

TCP Done for 6: tcp: [10.19.87.10:4043](http://10.19.87.10:4043/) (<nil>)

TCP Start of 5: tcp: [10.19.87.10:4043](http://10.19.87.10:4043/)

TCP Done for 5: tcp: 10.19.87.10:4043 (<nil>)

panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x6a2495]


goroutine 28 [running]:

[github.com/network-quality/goresponsiveness/lgc.(*LoadGeneratingConnectionUpload).doUpload(0xc0000c27c0](http://github.com/network-quality/goresponsiveness/lgc.(*LoadGeneratingConnectionUpload).doUpload(0xc0000c27c0), 0x7967b8, 0xc0000c2400, 0x1)

	/usr/local/src/RPM/goresponsiveness/lgc/lgc.go:318 +0xd5

created by [github.com/network-quality/goresponsiveness/lgc.(*LoadGeneratingConnectionUpload).Start](http://github.com/network-quality/goresponsiveness/lgc.(*LoadGeneratingConnectionUpload).Start)

	/usr/local/src/RPM/goresponsiveness/lgc/lgc.go:355 +0x125

I experienced the same problem today running the reference server (using locally generated certs) with this client. While the /config request sets and honors the InsecureSkipVerify:true setting in the request client, subsequent connections do not.

https://github.com/network-quality/goresponsiveness/blob/main/lgc/lgc.go#L202
https://github.com/network-quality/goresponsiveness/blob/main/lgc/lgc.go#L334
https://github.com/network-quality/goresponsiveness/blob/main/networkQuality.go#L668

Also, for these cases, I believe the root cause of the segfault is missing error checking here:
https://github.com/network-quality/goresponsiveness/blob/main/lgc/lgc.go#L315-L318

Resolved in fa647c6.