poco icon indicating copy to clipboard operation
poco copied to clipboard

Application crashed while rotating log files in Mac OS M1/M2

Open hideme4u opened this issue 2 years ago • 4 comments

Multiple and constant instances of crashes observed for an application during log rotation. What I did The application was run with sudo command, the application and all the related paths have proper access permissions. The rotation parameters are set as below: logging.channels.c3.archive: number logging.channels.c3.class: FileChannel logging.channels.c3.formatter: f1 logging.channels.c3.path: /var/log/applicationXYZ/applicationXYZ.log logging.channels.c3.purgeCount: 5 logging.channels.c3.rotation: 1M

Observations: Whenever the log file applicationXYZ.log reaches the it's capacity (here 1M), it tries rotate the file, the application crashes and /bin/launchctl auto launches the application. The log file applicationXYZ.log.0, and execution goes on. Again when log file applicationXYZ.log reaches the it's capacity, the application crashes, and /bin/launchctl auto launches the application. The log files applicationXYZ.log.1 and applicationXYZ.log.0 are created.

This crash has been observed on MACOS M1/M2 Monterey 12.6.1 / 12.6.1 and Ventura 13.1. POCO Library version: 1.12.4

I have pasted the contents of crash file below, and it is the same with every other crash file.

See different crash reports --->

`Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information: dyld2 mode abort() called util(1394,0x104b33e00) malloc: *** error for object 0x7fadfdc16950: pointer being freed was not allocated

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff203c691e __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff203f55bd pthread_kill + 263 2 libsystem_c.dylib 0x00007fff2034a406 abort + 125 3 libsystem_malloc.dylib 0x00007fff2022a165 malloc_vreport + 548 4 libsystem_malloc.dylib 0x00007fff2022d2aa malloc_report + 151 5 libPocoFoundation.94.dylib 0x0000000104c480b7 Poco::FileStreamBuf::~FileStreamBuf() + 135 6 libPocoFoundation.94.dylib 0x0000000104c497e8 Poco::FileOutputStream::~FileOutputStream() + 72 7 libPocoFoundation.94.dylib 0x0000000104bc1efe Poco::LogFile::~LogFile() + 30 8 libPocoFoundation.94.dylib 0x0000000104b75048 Poco::ArchiveByNumberStrategy::archive(Poco::LogFile*) + 56 9 libPocoFoundation.94.dylib 0x0000000104bb42b1 Poco::FileChannel::log(Poco::Message const&) + 97 10 libPocoFoundation.94.dylib 0x0000000104bb8b57 Poco::FormattingChannel::log(Poco::Message const&) + 119 11 util 0x0000000103f5eaa7 main + 9511 12 libdyld.dylib 0x00007fff20410f3d start + 1 `

`System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [9734]

VM Region Info: 0 is not in any region. Bytes before following region: 4378705920 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START --->
__TEXT 104fdc000-104fec000 [ 64K] r-x/r-x SM=COW ...scan-util

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_platform.dylib 0x190ca708c _platform_memmove + 444 1 libc++.1.dylib 0x190bca564 std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 64 2 libPocoFoundation.94.dylib 0x1056550f8 Poco::ArchiveByNumberStrategy::archive(Poco::LogFile*) + 52 3 libPocoFoundation.94.dylib 0x1056915d4 Poco::FileChannel::log(Poco::Message const&) + 108 4 libPocoFoundation.94.dylib 0x105695918 Poco::FormattingChannel::log(Poco::Message const&) + 112`

`System Integrity Protection: enabled

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information: abort() called

0 libsystem_kernel.dylib 0x183682d98 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1836b7ee0 pthread_kill + 288 2 libsystem_c.dylib 0x1835f2340 abort + 168 3 libc++abi.dylib 0x183672b08 abort_message + 132 4 libc++abi.dylib 0x183662938 demangling_terminate_handler() + 312 5 libobjc.A.dylib 0x183558330 _objc_terminate() + 160 6 libc++abi.dylib 0x183671ea4 std::__terminate(void ()()) + 20 7 libc++abi.dylib 0x183674c1c __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception) + 36 8 libc++abi.dylib 0x183674bc8 __cxa_throw + 140 9 libPocoFoundation.94.dylib 0x10538e140 Poco::FileImpl::handleLastErrorImpl(int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 512 10 libPocoFoundation.94.dylib 0x10538d4b8 Poco::FileImpl::handleLastErrorImpl(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 32 11 libPocoFoundation.94.dylib 0x105390d34 Poco::File::handleLastError(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 12 12 libPocoFoundation.94.dylib 0x1054132fc Poco::FileStreamBuf::open(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned int) + 200 13 libPocoFoundation.94.dylib 0x105414428 Poco::FileOutputStream::FileOutputStream(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned int) + 180 14 libPocoFoundation.94.dylib 0x10539d638 Poco::LogFileImpl::LogFileImpl(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 68 15 libPocoFoundation.94.dylib 0x105391650 Poco::FileChannel::log(Poco::Message const&) + 232 16 libPocoFoundation.94.dylib 0x105395918 Poco::FormattingChannel::log(Poco::Message const&) + 112`

It is happening with New Poco Library 1.12.4 Only. I have checked with Poco library 1.11.3 with same application, issue not happened. Issue seems to be introduced in version 1.12.4. Can you please help on this issue? @obiltschnig / @aleks-f / @hmartinez82

hideme4u avatar Dec 28 '22 06:12 hideme4u

Hi All, @obiltschnig / @aleks-f / @hmartinez82, Can you please help to check this issue ?

hideme4u avatar Dec 30 '22 01:12 hideme4u

@hideme4u , Hi! Can you give me simple reproducible code sample?

bas524 avatar Apr 17 '23 13:04 bas524

I'm a dev only on Windows, sorry 🥲

hmartinez82 avatar Apr 17 '23 13:04 hmartinez82

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Apr 17 '24 02:04 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Jun 16 '24 02:06 github-actions[bot]