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.
* fix : loop on sessionimpl->close if impl is sqlite and sqlite_close return SQLITE_BUSY
* fix : loop on sessionimpl->close if impl is sqlite and sqlite_close return SQLITE_BUSY, try 50 times with 100ms sleeping
* bug : into current implementation od path_unix.cpp I can't use simbol $ like a simbol, not a variable prefix, for example,
I need to use path /home/user/O1$$/folder. I propose to use escape sequence for this, for ex., if I want to use Poco::Glob, I can do
std::set<std::string> files;
std::string path = "/home/user/O1$$/folder"
Poco::replaceInPlace(path, "$", "\\$");
Poco::Glob::glob(path, files);
* fix : loop on sessionimpl->close if impl is sqlite and sqlite_close return SQLITE_BUSY, try 50 times with 100ms sleeping (fix code style)
bug : into current implementation od path_unix.cpp I can't use simbol $ like a simbol, not a variable prefix, for example,
I need to use path /home/user/O1$$/folder. I propose to use escape sequence for this, for ex., if I want to use Poco::Glob, I can do
std::set<std::string> files;
std::string path = "/home/user/O1$$/folder"
Poco::replaceInPlace(path, "$", "\\$");
Poco::Glob::glob(path, files);
add test
* fix : try to finalize stmt if its busy (on close session)
* fix : try to finalize stmt if its busy (on close session)
* SQlite 3.19.3
changelog
http://www.sqlite.org/releaselog/3_19_3.html
* epoll_event memset fix
with -std=c++14 the sizeof(eventsIn) give as result the number of array elements not the bytes number, so the memset is wrong
* fix for older gcc
on older version of gcc struct epoll_event eventsOut[epollSize] = { 0 }; does not compile
* Use appveyor.yaml from c++11 branch so that CI run ok.
* Use .travis.yml from the c++ branch so that Travis CI jobs run ok.
* Add c++11 scripts and Linux config so that Travis CI jobs are ok.
* Use mkdocumentation & mkrelease from c++11 branch.
* Use PocoDoc config files from c++11 branch.
* define POCO_ENABLE_C11 as the default
* CMake: ignore Crypto for now. To be fixed since it fails.
* Backport c++11 changes from the c++11 branch
* Add Cygwin config with c++11 setup.
* Update appveyor.yml from c++11 branch.
* Fix OpenSSLInitialized thread safety (#1739)
The init/uninit methods can be called from multiple threads, and thus need synchronization with a mutex.
* Renamed mutex variable and use ScopedLock.
* Change reference count variable to be an integer, since it’s protected by a mutex and no longer needs to be atomic.
Allows informational logging to be turned off. All find-related messages,
warnings, errors, etc. are still always logged. The option is ON by default
to preserve existing behaviour.
* Fix for issue #1043
The fix for this issue was partially implemented in development branch.
However, there are still some issue, that were not covered:
1. The std::string overload will sets SQL_LONGVARCHAR as fSqlType if the
output parameter is of type VARCHAR(MAX)
2. The UTF16String overload of bind method:
a) always resolves fSqlType using the size of formal parameter const
std::string& val.
b) allocates half of the size of the SP's output parameter.
3. The _utf16Strings member is not sychronized in Binder::synchronize()
method.
4. The _utf16Strings member is not reset in Binder::reset() method.
* Fixed compiler error for GCC
Fixed compiler error caused by improper getting of UTF16String length in
Binder::synchronize()
* Fix input param initialization in unit test
* The destructor of BasicBufferedStreamBuf() calls Allocator::deallocate which can throw exceptions. In particular it throws Poco::SystemException when can't lock mutex.
* Added poco_unexpected(); into exception handler