[ https://issues.apache.org/jira/browse/LOGCXX-353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13896162#comment-13896162 ]
Simon Reye commented on LOGCXX-353: ----------------------------------- No I can't at the moment sorry. That was four years ago and we no longer use the SocketHubAppender. But I did just have a look at the code (not sure if it was the latest) and the problem was in the append() function. If a client had disconnected this would we discovered when trying to send a message to it. An exception would be thrown and the client would be removed from the list of streams. You can see this in the catch clause with the line: it = streams.erase(it); But what this does is invalidate the variable itEnd which is used in the while loop i.e while (it != itEnd). From memory that is where things went wrong. My quick fix was to reassign itEnd i.e itEnd = streams.end() right after the erase call. Perhaps simply using streams.end() in the while loop clause would work too. It's been a while since I looked at this and even since I worked with vectors and C++ so I hope this helps. > When a client disconnects the SocketHubAppender crashes on the next log > message > ------------------------------------------------------------------------------- > > Key: LOGCXX-353 > URL: https://issues.apache.org/jira/browse/LOGCXX-353 > Project: Log4cxx > Issue Type: Bug > Components: Appender > Affects Versions: 0.10.0 > Environment: Windows Vista x64 compiling with Visual Studio 2008 > Reporter: Simon Reye > Assignee: Curt Arnold > > When a connected client disconnects from a SocketHubAppender log4cxx throughs > an exception. From looking at the code, what is happening is the disconnected > client is being erased from a output stream vector, which invalidates a > .end() iterator which is being used in a while loop. The simple fix would be > to reassign the end iterator after erasing the disconnected client. > I don't have developer access so I can't check my patch in. -- This message was sent by Atlassian JIRA (v6.1.5#6160)