opencog / cogutil

Very low-level C++ programming utilities used by several components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

using logger().error() in excpetion crashes

linas opened this issue · comments

when catching an exception, it appears to be OK to use logger().info("blah") and it works fine, but using logger().error("blah") will segfault. The only difference between these two is the printing of the stack frame, so the best guess is that it has something to do with printing the stack in an exception context.

... although this may have something to do with boost. This bug is seen when adding logger prints to the exception handles in this code: https://github.com/opencog/opencog/blob/master/opencog/cogserver/server/ServerSocket.cc#L167-L173

This might be fixed now. Turns out the backtrace-printer, which is used for logger().error() was not thread-safe. It was made thread-safe with commit 9ecbd1b

Closing, this should be tested again, but maybe its fixed so, whatever.