Hi UCSC Genome Browser team,
While using bigBedToBed and related binaries, I noticed that the program sometimes terminates early while fetching a lot of data from large bigBed files at HTTPS URLs. Fetching the same files from HTTP and locally was OK. (My test case was
https://pakt01.u.hpc.mssm.edu/test/hg38.refGene.idx.bb)
I tracked this down in a debugger to a SIGPIPE being thrown when mustCloseFd() was being called in kent/src/lib/udc.c:243. This is because the pthread created for SSL encryption/decryption tries to keep writing to the socketpair() created in kent/src/lib/https.c and this throws a SIGPIPE signal. By default a SIGPIPE ends the process.
This fix simply ignores SIGPIPE. This seems safe because you are already checking for error codes in netConnectHttpsThread() and terminating the thread when the pipe closes.
Sending this to you so hopefully you can patch a fix into the main repo.
Cheers,
Ted Pak
MD/PhD Student, Kasarskis Lab
Icahn School of Medicine at Mount Sinai