facebook / wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
Apache License 2.0
3.04k stars 535 forks source link

Function with noexcept specifier throws exception causes program terminated #186

Open zER0pAGe-1 opened 3 years ago

zER0pAGe-1 commented 3 years ago

The following function in wangle acceptor could possibly throws an exception in makeNewAsyncSocket https://github.com/facebook/wangle/blob/master/wangle/acceptor/Acceptor.cpp#L305

While I didn't find any catch phrase that could handle this exception, thus when create new async socket failed, the exception causes the whole program terminated.

My question is, is that normal or should I override this function to deal with exceptions on my case?

yfeldblum commented 3 years ago

It is not generally expected that creating the async socket fails, triggering program termination.

Do you have more details on what the exception is and what triggers it? If this is reproducible in the debugger, any chance of a type, a message, and a stacktrace?

zER0pAGe-1 commented 3 years ago

Exception message: AsyncSocketException: failed to set close-on-exec flag(type = Internal error, errno=9(Bad file descriptor))

zER0pAGe-1 commented 3 years ago

Exception happens about once a day (online environment), and it seems I can't reproduce it in debugger