Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Crash when using log4plus::RollingFileAppender #630

@petrichor12138

Description

@petrichor12138

My compilnation envrionment is macOS12.6, and with libc++abi

And my program structure has two parts which using log4plus, the first part is libcutt-sdk.dylib. In this dynamic library, log4cplus is using to output log for this library. The second part is the main program, log4cplus is used to output the whole program log.

When I am trying to execute the unix program, it is always crashed in log4cplus::RollingFileAppender::RollFileAppender.
The context is below:

log4cplus::SharedAppenderPtr appender(new log4cplus::RollingFileAppender(VDI_log_dir_path.toStdString(), LOG_FILE_MAX_SIZE, 1, true, true));
log4cplus::SharedAppenderPtr appender1(new log4cplus::RollingFileAppender(VDI_AUTOTEST_log_dir_path.toStdString(), LOG_FILE_MAX_SIZE, 1, true, true));

And the debug info is:

uSmartView_VDI_Client(32644,0x101738600) malloc: Incorrect checksum for freed object 0x108630828: probably modified after being freed.

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007ff80f438fce libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007ff80f46f1ff libsystem_pthread.dylib`pthread_kill + 263
    frame #2: 0x00007ff80f3bad14 libsystem_c.dylib`abort + 123
    frame #3: 0x00007ff80f297357 libsystem_malloc.dylib`malloc_vreport + 551
    frame #4: 0x00007ff80f2ab308 libsystem_malloc.dylib`malloc_zone_error + 178
    frame #5: 0x00007ff80f28c50c libsystem_malloc.dylib`tiny_malloc_from_free_list + 1820
    frame #6: 0x00007ff80f28b8ad libsystem_malloc.dylib`tiny_malloc_should_clear + 255
    frame #7: 0x00007ff80f28a7d2 libsystem_malloc.dylib`szone_malloc_should_clear + 66
    frame #8: 0x00007ff80f2a5abb libsystem_malloc.dylib`_malloc_zone_malloc + 125
    frame #9: 0x00007ff80f42c95a libc++abi.dylib`operator new(unsigned long) + 26
    frame #10: 0x00000001003b4e36 uSmartView_VDI_Client`void log4cplus::internal::split_into_components<log4cplus::internal::(anonymous namespace)::path_sep_comp, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, log4cplus::internal::(anonymous namespace)::path_sep_comp) + 646
    frame #11: 0x00000001003b44e5 uSmartView_VDI_Client`log4cplus::internal::split_path(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 85
    frame #12: 0x00000001003b5107 uSmartView_VDI_Client`log4cplus::internal::make_dirs(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 71
    frame #13: 0x00000001003b9007 uSmartView_VDI_Client`log4cplus::FileAppenderBase::open(unsigned int) + 39
    frame #14: 0x00000001003b87b6 uSmartView_VDI_Client`log4cplus::FileAppenderBase::init() + 310
    frame #15: 0x00000001003b9a5a uSmartView_VDI_Client`log4cplus::RollingFileAppender::RollingFileAppender(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, long, int, bool, bool) + 138
    frame #16: 0x00000001000ffd47 uSmartView_VDI_Client`init_log_system() at qtlogger.cpp:248:51
    frame #17: 0x00000001000bc6aa uSmartView_VDI_Client`Application::run(this=0x0000000109012600, argc=3, argv=0x00007ff7bfeff4e0) at application.cpp:7544:15
    frame #18: 0x000000010004ae2c uSmartView_VDI_Client`main(argc=3, argv=0x00007ff7bfeff4e0) at main.cpp:36:10
    frame #19: 0x00000001016bd52e dyld`start + 462

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions