lightning icon indicating copy to clipboard operation
lightning copied to clipboard

On mac a difference error is thrown on connection refusal

Open ddustin opened this issue 3 years ago • 4 comments
trafficstars

@cdecker

ddustin avatar Dec 18 '21 18:12 ddustin

This hints at an underlying bug, TBH. ECONNREFUSED is definitely the error we expect...

rustyrussell avatar Dec 20 '21 05:12 rustyrussell

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.

cdecker avatar Dec 20 '21 11:12 cdecker

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.

rustyrussell avatar Dec 21 '21 00:12 rustyrussell

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.

whitslack avatar Apr 02 '22 20:04 whitslack

I think we can close this, the root problem being somewhere else :-)

cdecker avatar Sep 26 '22 15:09 cdecker

Wfm 👍

ddustin avatar Sep 26 '22 21:09 ddustin