IntersectMBO / IntersectMBO/ouroboros-network

Silent failure on opening of unix domain socket

Open
#2,519 0 comments 2 reactions 0 assignees View on GitHub
node-to-client
Dominant language
Haskell
Stars
296
Forks
104
Avg merge
2d 10h
Merged PRs (30d)
4

Description

I tried opening a Unix domain socket filename with an invalid filename where it was longer than the maximum of `104` characters. In the REPL, it fails like this:

```
λ> import Prelude
λ> import qualified Ouroboros.Network.NodeToClient as NTC
λ> import qualified Ouroboros.Network.Snocket as Snocket
λ> let path = "/private/var/folders/zh/ln41q4zs52x2fd61rxccmq640000gn/T/temp/chairman/test-13dfca22944230a2/socket/mocket" :: String
λ> NTC.withIOManager $ \iocp -> do { sn <- pure $ Snocket.localSnocket iocp path; sd <- Snocket.open sn (Snocket.addrFamily sn $ Snocket.localAddressFromPath path); Snocket.bind sn sd $ Snocket.localAddressFromPath path; Snocket.listen sn sd}
*** Exception: pokeSockAddr: path is too long
CallStack (from HasCallStack):
error, called at Network/Socket/Types.hsc:1077:40 in ntwrk-3.1.1.1-58eabeff:Network.Socket.Types
```

In `cardano-node`, the process continues with no evidence of failure except that the socket file cannot be found.

My expectation is that the node should fail to start.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.