You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Read keys without throwing system exception.
Logs
Output of the mini example:
SystemException: System exception: cannot lock mutex
Code: 0
Output of valgrind:
# valgrind ./a.out
==4743== Memcheck, a memory error detector
==4743== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==4743== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==4743== Command: ./a.out
==4743==
==4743== Invalid read of size 4
==4743== at 0x4DC9FE4: pthread_mutex_lock@@GLIBC_2.2.5 (pthread_mutex_lock.c:80)
==4743== by 0x4A43120: ??? (in /usr/lib/x86_64-linux-gnu/libPocoUtil.so.80)
==4743== by 0x4A4720D: Poco::Util::AbstractConfiguration::keys(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) const (in /usr/lib/x86_64-linux-gnu/libPocoUtil.so.80)
==4743== by 0x10A5A4: main (poco_bug.cpp:12)
==4743== Address 0x51e2bd8 is 488 bytes inside a block of size 552 free'd
==4743== at 0x484A61D: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4743== by 0x10A840: Poco::RefCountedObject::release() const (RefCountedObject.h:82)
==4743== by 0x10AB16: Poco::AutoPtr<Poco::Util::AbstractConfiguration>::~AutoPtr() (AutoPtr.h:96)
==4743== by 0x10A572: main (poco_bug.cpp:10)
==4743== Block was alloc'd at
==4743== at 0x4846FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4743== by 0x4A4B934: Poco::Util::AbstractConfiguration::createView(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/x86_64-linux-gnu/libPocoUtil.so.80)
==4743== by 0x10A54D: main (poco_bug.cpp:10)
==4743==
==4743== Invalid read of size 4
==4743== at 0x4DC992C: __pthread_mutex_lock_full (pthread_mutex_lock.c:198)
==4743== by 0x4A43120: ??? (in /usr/lib/x86_64-linux-gnu/libPocoUtil.so.80)
==4743== by 0x4A4720D: Poco::Util::AbstractConfiguration::keys(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) const (in /usr/lib/x86_64-linux-gnu/libPocoUtil.so.80)
==4743== by 0x10A5A4: main (poco_bug.cpp:12)
==4743== Address 0x51e2bd8 is 488 bytes inside a block of size 552 free'd
==4743== at 0x484A61D: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4743== by 0x10A840: Poco::RefCountedObject::release() const (RefCountedObject.h:82)
==4743== by 0x10AB16: Poco::AutoPtr<Poco::Util::AbstractConfiguration>::~AutoPtr() (AutoPtr.h:96)
==4743== by 0x10A572: main (poco_bug.cpp:10)
==4743== Block was alloc'd at
==4743== at 0x4846FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4743== by 0x4A4B934: Poco::Util::AbstractConfiguration::createView(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/x86_64-linux-gnu/libPocoUtil.so.80)
==4743== by 0x10A54D: main (poco_bug.cpp:10)
==4743==
SystemException: System exception: cannot lock mutex
Code: 0
==4743==
==4743== HEAP SUMMARY:
==4743== in use at exit: 54,904 bytes in 20 blocks
==4743== total heap usage: 158 allocs, 138 frees, 177,095 bytes allocated
==4743==
==4743== LEAK SUMMARY:
==4743== definitely lost: 536 bytes in 1 blocks
==4743== indirectly lost: 54,368 bytes in 19 blocks
==4743== possibly lost: 0 bytes in 0 blocks
==4743== still reachable: 0 bytes in 0 blocks
==4743== suppressed: 0 bytes in 0 blocks
==4743== Rerun with --leak-check=full to see details of leaked memory
==4743==
==4743== For lists of detected and suppressed errors, rerun with: -s
==4743== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Describe the bug
My application encounters a Poco SystemException when accessing the keys of a xml sub-view.
To Reproduce
Mini example "poco_bug.cpp":
The try-catch is only used to receive further information.
Read xml "conf.xml":
Compiled and executed with:
Expected behavior
Read keys without throwing system exception.
Logs
Output of the mini example:
Output of valgrind:
Please add relevant environment information:
With poco version 1.9.4 this was working. I also tried newer versions (e.g. 1.12.0, 1.13.3, 1.14.0) and also encountered this problem.
The text was updated successfully, but these errors were encountered: