sebastien-guay a9982e68ba "SocketReactor::addEventHandler" and "SocketReactor::removeEventHandler" must protect the access to "NotifierPtr pNotifier" (#1709)
Those two methods already use FastMutex::ScopedLock lock(_mutex), but
the scope is not large enough to protect "NotifierPtr pNotifier" that is
accessed by calling SocketNotifier::addObserver() and
SocketNotifier::removeObserver().

It is mentioned in SocketReator.h that it is safe to call
addEventHandler() and removeEventHandler() from another thread while the
SocketReactor is running. My current use of the SocketReactor
encountered an issue where the SocketNotifier::_events has been
corrupted by a concurent write access done by
SocketReactor::addEventHandler() and
SocketReactor::removeEventHandler().
The call stack show that the SocketReactor::addEventHandler is stuck in
a while loop in gcc/libstdc++/tree.cc Rb_tree_insert_and_rebalance()

I clearly see in my logs that it happened while my
SocketConnector::unregisterConnector() and
SocketConnector::registerConnector() were called by two different
threads.

#0 0x00a80a7b in std::_Rb_tree_insert_and_rebalance () from
/usr/lib/libstdc++.so.6
#1 0x06ccb430 in std::_Rb_tree<Poco::Net::SocketNotification*,
Poco::Net::SocketNotification*,
std::_IdentityPoco::Net::SocketNotification*,
std::lessPoco::Net::SocketNotification*,
std::allocatorPoco::Net::SocketNotification* >::_M_insert
(this=0xac75dc90, __x=0x0, __p=0xac7ed0c8, __v=@0xb5fb0c40) at
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h:816
#2 0x06ccb15d in std::_Rb_tree<Poco::Net::SocketNotification*,
Poco::Net::SocketNotification*,
std::_IdentityPoco::Net::SocketNotification*,
std::lessPoco::Net::SocketNotification*,
std::allocatorPoco::Net::SocketNotification* >::insert_equal
(this=0xac75dc90, __v=@0xb5fb0c40) at
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h:858
#3 0x06ccad86 in std::multiset<Poco::Net::SocketNotification*,
std::lessPoco::Net::SocketNotification*,
std::allocatorPoco::Net::SocketNotification* >::insert (this=0xac75dc90,
__x=@0xb5fb0c40)
at
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_multiset.h:306
#4 0x06cca72b in Poco::Net::SocketNotifier::addObserver
(this=0xac75dc70, pReactor=0x8d27958, observer=@0xb5fb0cd0) at
src/SocketNotifier.cpp:45
#5 0x06cd060f in Poco::Net::SocketReactor::addEventHandler
(this=0x8d27958, socket=@0xac7f5a74, observer=@0xb5fb0cd0) at
src/SocketReactor.cpp:178

SocketReactor::run() is already protecting the access to the
SocketNotifier.
2017-08-10 10:10:09 +02:00
2017-08-10 10:00:06 +02:00
2017-08-10 10:00:06 +02:00
2015-12-12 19:41:28 -06:00
2012-04-23 01:14:34 +00:00
2016-03-12 11:59:10 +01:00
2017-03-31 13:26:40 +02:00
2012-04-23 01:14:34 +00:00
2015-12-08 11:35:09 +01:00
2016-03-09 11:38:41 +01:00
2012-12-26 18:30:52 -06:00
2012-12-26 18:30:52 -06:00
2012-12-26 18:30:52 -06:00
2017-02-20 16:55:18 +01:00
2016-09-13 07:15:12 +02:00
2016-02-28 15:27:37 -06:00
2016-03-07 06:57:52 +01:00
2015-05-18 20:50:10 -05:00
2016-03-07 06:57:52 +01:00
2017-05-23 20:36:12 -05:00
2012-04-23 01:14:34 +00:00
2016-09-13 07:45:35 +02:00
2016-03-07 06:57:52 +01:00

POCO C++ Libraries

Build Status

  • Travis: Travis Build Status
  • AppVeyor: AppVeyor Build Status
  • CII Best Practices

alt text

POrtable COmponents C++ Libraries are:

  • A collection of C++ class libraries, conceptually similar to the Java Class Library, the .NET Framework or Apples Cocoa.
  • Focused on solutions to frequently-encountered practical problems.
  • Focused on internet-age network-centric applications.
  • Written in efficient, modern, 100% ANSI/ISO Standard C++.
  • Based on and complementing the C++ Standard Library/STL.
  • Highly portable and available on many different platforms.
  • Open Source, licensed under the Boost Software License.

To start using POCO, see the Guided Tour and Getting Started documents.


POCO has an active user and contributing community, please visit our web site, forum and blog. Answers to POCO-related questions can also be found on Stack Overflow.

Please see CONTRIBUTING for submitting contributions, bugs reports, feature requests or security issues.


In regards to Boost, in spite of some functional overlapping, POCO is best thought of as a Boost complement (rather than replacement). Side-by-side use of Boost and POCO is a very common occurrence.

When contributing to POCO, please adhere to our guidelines.

All text file line endings in the repository must be Unix-style (LF). This includes Visual Studio project and solution files (.sln, .vcproj, .vcxproj, .vcxproj.filters).

Languages
C 50.8%
C++ 47.8%
CMake 0.5%
Makefile 0.2%
JavaScript 0.2%
Other 0.3%