lightning
lightning copied to clipboard
On mac a difference error is thrown on connection refusal
@cdecker
This hints at an underlying bug, TBH. ECONNREFUSED is definitely the error we expect...
Testing on a Mac myself, it seems that something is up with these kinds of errors. Every once in a while I seem to be losing the hsmd filedescriptor, which is weird.
Still working on making compilation on m1 solid, but will keep an eye open on why this fails. In the meantime if there's any pointers as to how to debug this, they'd be much appreciated.
Testing on a Mac myself, it seems that something is up with these kinds of errors. Every once in a while I seem to be losing the hsmd filedescriptor, which is weird.
Hmm. This is usually caused by someone closing the wrong fd (less often, by dup2 on top of the fd). Try replacing close with closex which does assert(!getenv("HSM_FD") || fd != atoi(getenv("HSM_FD")) then setenv that to "3" at the start of connectd?
That will at least tell us who is closing it, if not why they're wrong. If you can make it really reproducible you can debug the subd and poke around, but that's harder if it's intermittent.
FWIW, I saw this on Linux and had the same gut reaction as @rustyrussell. "Bad file descriptor" indicates a logic bug: passing to a syscall an integer that does not specify an open file descriptor.
I think we can close this, the root problem being somewhere else :-)
Wfm 👍