Bug 384885

Summary: Crash in the SVN plugin [svn::pool_create]
Product: [Applications] kdevelop Reporter: RJVB <rjvbertin>
Component: generalAssignee: kdevelop-bugs-null
Status: RESOLVED WORKSFORME    
Severity: crash Keywords: drkonqi
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description RJVB 2017-09-20 15:36:59 UTC
Application: kdevelop (5.1.40)
 (Compiled from sources)
Qt Version: 5.8.0
Frameworks Version: 5.35.0
Operating System: Darwin 13.4.0 x86_64
Distribution (Platform): MacPorts Packages

-- Information about the crash:
- What I was doing when the application crashed:
Loading a session with a few projects none of which use SVN

- Unusual behaviour I noticed:

Terminal output:
kdevelop.projectmanagers.qmake: unhandled function call "!load"
kdevelop.projectmanagers.qmake: unhandled function call "error"
kdevelop.projectmanagers.qmake: unhandled function call "load"
QObject::connect: invalid null parameter

-- Backtrace:
Application: KDevelop (kdevelop), signal: Segmentation fault: 11
(lldb) process attach --pid 23985
Process 23985 stopped
Executable module set to "/Applications/MacPorts/KF5/kdevelop.app/Contents/MacOS/kdevelop.bin".
Architecture set to: x86_64-apple-macosx.
(lldb) set term-width 200
(lldb) thread info
thread #1: tid = 0x1b676e0, 0x00007fff8fb78e20 libsystem_kernel.dylib`__wait4 + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP

(lldb) bt all
* thread #1: tid = 0x1b676e0, 0x00007fff8fb78e20 libsystem_kernel.dylib`__wait4 + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff8fb78e20 libsystem_kernel.dylib`__wait4 + 8
    frame #1: 0x0000000107ba4cde libKF5Crash.5.dylib`KCrash::startProcess(int, char const**, bool) [inlined] startProcessInternal(argc=<unavailable>, directly=<unavailable>) + 125 at kcrash.cpp:651
    frame #2: 0x0000000107ba4c61 libKF5Crash.5.dylib`KCrash::startProcess(argc=<unavailable>, argv=<unavailable>, waitAndExit=<unavailable>) + 17 at kcrash.cpp:633
    frame #3: 0x0000000107ba4aa5 libKF5Crash.5.dylib`KCrash::defaultCrashHandler(sig=11) + 1061 at kcrash.cpp:530
    frame #4: 0x00007fff929405aa libsystem_platform.dylib`_sigtramp + 26
    frame #5: 0x0000000122059599 libapr-1.0.dylib`apr_pool_create_ex + 64
    frame #6: 0x0000000121b66d24 libsvn_subr-1.0.dylib`svn_pool_create_ex + 36
    frame #7: 0x00000001219eac0b kdevsubversion.so`svn::Pool::Pool(apr_pool_t*) [inlined] svn::pool_create(parent=0x0000000000000000) + 59 at pool.cpp:46
    frame #8: 0x00000001219eabf1 kdevsubversion.so`svn::Pool::Pool(apr_pool_t*) [inlined] svn::Pool::Pool(this=0x00007f81368b77c8, parent=0x0000000000000000) + 20 at pool.cpp:50
    frame #9: 0x00000001219eabdd kdevsubversion.so`svn::Pool::Pool(this=0x00007f81368b77c8, parent=0x0000000000000000) + 13 at pool.cpp:51
    frame #10: 0x00000001219e611d kdevsubversion.so`svn::Context::Data::Data(this=0x00007f81368b77b0, configDir_=0x00007fff584818b0) + 61 at context.cpp:127
    frame #11: 0x00000001219e5d62 kdevsubversion.so`svn::Context::Context(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [inlined] svn::Context::Data::Data(this=<unavailable>, configDir_=<unavailable>) + 50 at context.cpp:130
    frame #12: 0x00000001219e5d57 kdevsubversion.so`svn::Context::Context(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [inlined] svn::Context::Context(this=0x00007f81368b7c40, configDir=0x00007fff584818b0) + 23 at context.cpp:631
    frame #13: 0x00000001219e5d40 kdevsubversion.so`svn::Context::Context(this=0x00007f81368b7c40, configDir=<unavailable>) + 16 at context.cpp:630
    frame #14: 0x00000001219bb486 kdevsubversion.so`SvnInternalJobBase::SvnInternalJobBase(this=0x00007f81368bad50, parent=<unavailable>) + 118 at svninternaljobbase.cpp:44
    frame #15: 0x00000001219c8d9c kdevsubversion.so`SvnJobBaseImpl<SvnInternalInfoJob>::SvnJobBaseImpl(KDevSvnPlugin*, KDevelop::OutputJob::OutputJobVerbosity) [inlined] SvnInternalInfoJob::SvnInternalInfoJob(parent=0x00007f81368b5c80) + 11 at svninfojob.cpp:33
    frame #16: 0x00000001219c8d91 kdevsubversion.so`SvnJobBaseImpl<SvnInternalInfoJob>::SvnJobBaseImpl(KDevSvnPlugin*, KDevelop::OutputJob::OutputJobVerbosity) [inlined] SvnInternalInfoJob::SvnInternalInfoJob(parent=0x00007f81368b5c80) at svninfojob.cpp:34
    frame #17: 0x00000001219c8d91 kdevsubversion.so`SvnJobBaseImpl<SvnInternalInfoJob>::SvnJobBaseImpl(this=0x00007f81368b5c80, plugin=<unavailable>, verbosity=<unavailable>) + 49 at svnjobbase.h:78
    frame #18: 0x00000001219c8b57 kdevsubversion.so`SvnInfoJob::SvnInfoJob(this=0x00007f81368b5c80, parent=<unavailable>) + 23 at svninfojob.cpp:90
    frame #19: 0x00000001219b065e kdevsubversion.so`KDevSvnPlugin::isVersionControlled(this=0x00007f81361928d0, localLocation=0x00007fff58481a98) + 62 at kdevsvnplugin.cpp:108
    frame #20: 0x000000010798e6cc libKDevPlatformShell.10.dylib`KDevelop::ProjectPrivate::loadVersionControlPlugin(this=<unavailable>, projectGroup=<unavailable>) + 652 at project.cpp:375
    frame #21: 0x000000010798d043 libKDevPlatformShell.10.dylib`KDevelop::Project::open(this=0x00007f81363cd200, projectFile=<unavailable>) + 371 at project.cpp:508
    frame #22: 0x0000000107980fc7 libKDevPlatformShell.10.dylib`KDevelop::ProjectControllerPrivate::importProject(this=<unavailable>, url_=<unavailable>) + 2519 at projectcontroller.cpp:348
    frame #23: 0x00000001079805ad libKDevPlatformShell.10.dylib`KDevelop::ProjectController::openProject(this=0x00007f813586f410, projectFile=<unavailable>) + 3549 at projectcontroller.cpp:862
    frame #24: 0x000000010797efbc libKDevPlatformShell.10.dylib`KDevelop::ProjectController::openProjects(this=0x00007f813586f410, projects=<unavailable>) + 188 at projectcontroller.cpp:682
    frame #25: 0x000000010a786813 QtCore`QObject::event(this=<unavailable>, e=<unavailable>) + 739 at qobject.cpp:1263
    frame #26: 0x000000010976ca6d QtWidgets`QApplicationPrivate::notify_helper(this=<unavailable>, receiver=0x00007f813586f410, e=0x00007f8136215fe0) + 269 at qapplication.cpp:3745
    frame #27: 0x000000010976fde2 QtWidgets`QApplication::notify(this=<unavailable>, receiver=<unavailable>, e=<unavailable>) + 8306 at qapplication.cpp:3708
    frame #28: 0x000000010a75d717 QtCore`QCoreApplication::notifyInternal2(receiver=0x00007f813586f410, event=0x00007f8136215fe0) + 167 at qcoreapplication.cpp:995
    frame #29: 0x000000010a75e3ef QtCore`QCoreApplicationPrivate::sendPostedEvents(receiver=0x0000000000000000, event_type=0, data=0x00007f8132e00730) + 591 at qcoreapplication.h:231
    frame #30: 0x000000011429c0aa libqaltcocoa.dylib`QCocoaEventDispatcherPrivate::processPostedEvents(this=0x00007f8132e1fa30) + 314 at qcocoaeventdispatcher.mm:888
    frame #31: 0x000000011429cac3 libqaltcocoa.dylib`QCocoaEventDispatcherPrivate::postedEventsSourceCallback(info=0x00007f8132e1fa30) + 179 at qcocoaeventdispatcher.mm:925
    frame #32: 0x00007fff9a53a5b1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #33: 0x00007fff9a52bd29 CoreFoundation`__CFRunLoopDoSources0 + 441
    frame #34: 0x00007fff9a52b3ef CoreFoundation`__CFRunLoopRun + 831
    frame #35: 0x00007fff9a52ae75 CoreFoundation`CFRunLoopRunSpecific + 309
    frame #36: 0x00007fff92a6ba0d HIToolbox`RunCurrentEventLoopInMode + 226
    frame #37: 0x00007fff92a6b685 HIToolbox`ReceiveNextEventCommon + 173
    frame #38: 0x00007fff92a6b5bc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 65
    frame #39: 0x00007fff8ee9324e AppKit`_DPSNextEvent + 1434
    frame #40: 0x00007fff8ee9289b AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
    frame #41: 0x00007fff8ee8699c AppKit`-[NSApplication run] + 553
    frame #42: 0x000000011429b76e libqaltcocoa.dylib`QCocoaEventDispatcher::processEvents(this=0x00007f8132e241d0, flags=<unavailable>) + 2846 at qcocoaeventdispatcher.mm:421
    frame #43: 0x000000010a75990e QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) [inlined] QEventLoop::processEvents(this=<unavailable>, flags=<unavailable>) + 398 at qeventloop.cpp:134
    frame #44: 0x000000010a7598f4 QtCore`QEventLoop::exec(this=0x00007fff58483dd0, flags=<unavailable>) + 372 at qeventloop.cpp:212
    frame #45: 0x000000010a75ddfa QtCore`QCoreApplication::exec() + 346 at qcoreapplication.cpp:1268
    frame #46: 0x0000000107794766 kdevelop.bin`main(argc=<unavailable>, argv=0x00007fff58484108) + 52438 at main.cpp:917
    frame #47: 0x00007fff906e25fd libdyld.dylib`start + 1
    frame #48: 0x00007fff906e25fd libdyld.dylib`start + 1

  thread #2: tid = 0x1b676e3, 0x00007fff8fb79662 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
    frame #0: 0x00007fff8fb79662 libsystem_kernel.dylib`kevent64 + 10
    frame #1: 0x00007fff93ec8421 libdispatch.dylib`_dispatch_mgr_invoke + 239
    frame #2: 0x00007fff93ec8136 libdispatch.dylib`_dispatch_mgr_thread + 52

  thread #3: tid = 0x1b67734, 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10, name = 'QDBusConnectionManager'
    frame #0: 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10
    frame #1: 0x000000010a7afcd0 QtCore`qt_safe_poll(pollfd*, unsigned int, timespec const*) [inlined] qt_ppoll(fds=0x00007f8132c48ac8, nfds=2) + 528 at qcore_unix.cpp:83
    frame #2: 0x000000010a7afcbb QtCore`qt_safe_poll(fds=0x00007f8132c48ac8, nfds=2, timeout_ts=0x0000000000000000) + 507 at qcore_unix.cpp:102
    frame #3: 0x000000010a7b1359 QtCore`QEventDispatcherUNIX::processEvents(this=<unavailable>, flags=<unavailable>) + 857 at qeventdispatcher_unix.cpp:500
    frame #4: 0x000000010a75990e QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) [inlined] QEventLoop::processEvents(this=<unavailable>, flags=<unavailable>) + 398 at qeventloop.cpp:134
    frame #5: 0x000000010a7598f4 QtCore`QEventLoop::exec(this=0x0000000117387e30, flags=<unavailable>) + 372 at qeventloop.cpp:212
    frame #6: 0x000000010a599e62 QtCore`QThread::exec(this=<unavailable>) + 114 at qthread.cpp:507
    frame #7: 0x00000001093bb783 QtDBus`QDBusConnectionManager::run(this=0x00007f8132e64520) + 19 at qdbusconnection.cpp:170
    frame #8: 0x000000010a59d867 QtCore`QThreadPrivate::start(arg=0x00007f8132e64520) + 359 at qthread_unix.cpp:368
    frame #9: 0x00007fff8dc7d899 libsystem_pthread.dylib`_pthread_body + 138
    frame #10: 0x00007fff8dc7d72a libsystem_pthread.dylib`_pthread_start + 137
    frame #11: 0x00007fff8dc81fc9 libsystem_pthread.dylib`thread_start + 13

  thread #4: tid = 0x1b67739, 0x00007fff8fb74a1a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #0: 0x00007fff8fb74a1a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fff8fb73d18 libsystem_kernel.dylib`mach_msg + 64
    frame #2: 0x00007fff9a52bf15 CoreFoundation`__CFRunLoopServiceMachPort + 181
    frame #3: 0x00007fff9a52b539 CoreFoundation`__CFRunLoopRun + 1161
    frame #4: 0x00007fff9a52ae75 CoreFoundation`CFRunLoopRunSpecific + 309
    frame #5: 0x00007fff8f03305e AppKit`_NSEventThread + 144
    frame #6: 0x00007fff8dc7d899 libsystem_pthread.dylib`_pthread_body + 138
    frame #7: 0x00007fff8dc7d72a libsystem_pthread.dylib`_pthread_start + 137
    frame #8: 0x00007fff8dc81fc9 libsystem_pthread.dylib`thread_start + 13

  thread #5: tid = 0x1b67794, 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10, name = 'QThread'
    frame #0: 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10
    frame #1: 0x000000010a7afb30 QtCore`qt_safe_poll(pollfd*, unsigned int, timespec const*) [inlined] qt_ppoll(fds=0x00007f81359babb8, nfds=1) + 112 at qcore_unix.cpp:83
    frame #2: 0x000000010a7afaf5 QtCore`qt_safe_poll(fds=0x00007f81359babb8, nfds=1, timeout_ts=0x000000011993cd10) + 53 at qcore_unix.cpp:111
    frame #3: 0x000000010a7b1359 QtCore`QEventDispatcherUNIX::processEvents(this=<unavailable>, flags=<unavailable>) + 857 at qeventdispatcher_unix.cpp:500
    frame #4: 0x000000010a75990e QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) [inlined] QEventLoop::processEvents(this=<unavailable>, flags=<unavailable>) + 398 at qeventloop.cpp:134
    frame #5: 0x000000010a7598f4 QtCore`QEventLoop::exec(this=0x000000011993cde0, flags=<unavailable>) + 372 at qeventloop.cpp:212
    frame #6: 0x000000010a599e62 QtCore`QThread::exec(this=<unavailable>) + 114 at qthread.cpp:507
    frame #7: 0x000000010aea790f libKDevPlatformLanguage.10.dylib`KDevelop::DUChainPrivate::CleanupThread::run(this=0x00007f8132eec330) + 159 at duchain.cpp:283
    frame #8: 0x000000010a59d867 QtCore`QThreadPrivate::start(arg=0x00007f8132eec330) + 359 at qthread_unix.cpp:368
    frame #9: 0x00007fff8dc7d899 libsystem_pthread.dylib`_pthread_body + 138
    frame #10: 0x00007fff8dc7d72a libsystem_pthread.dylib`_pthread_start + 137
    frame #11: 0x00007fff8dc81fc9 libsystem_pthread.dylib`thread_start + 13

  thread #6: tid = 0x1b67795, 0x00007fff8fb789aa libsystem_kernel.dylib`__select + 10, name = 'com.apple.CFSocket.private'
    frame #0: 0x00007fff8fb789aa libsystem_kernel.dylib`__select + 10
    frame #1: 0x00007fff9a577a03 CoreFoundation`__CFSocketManager + 867
    frame #2: 0x00007fff8dc7d899 libsystem_pthread.dylib`_pthread_body + 138
    frame #3: 0x00007fff8dc7d72a libsystem_pthread.dylib`_pthread_start + 137
    frame #4: 0x00007fff8dc81fc9 libsystem_pthread.dylib`thread_start + 13

  thread #7: tid = 0x1b6779d, 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10, name = 'Qt bearer thread'
    frame #0: 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10
    frame #1: 0x000000010a7afcd0 QtCore`qt_safe_poll(pollfd*, unsigned int, timespec const*) [inlined] qt_ppoll(fds=0x00007f813629bf78, nfds=1) + 528 at qcore_unix.cpp:83
    frame #2: 0x000000010a7afcbb QtCore`qt_safe_poll(fds=0x00007f813629bf78, nfds=1, timeout_ts=0x0000000000000000) + 507 at qcore_unix.cpp:102
    frame #3: 0x000000010a7b1359 QtCore`QEventDispatcherUNIX::processEvents(this=<unavailable>, flags=<unavailable>) + 857 at qeventdispatcher_unix.cpp:500
    frame #4: 0x000000010a75990e QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) [inlined] QEventLoop::processEvents(this=<unavailable>, flags=<unavailable>) + 398 at qeventloop.cpp:134
    frame #5: 0x000000010a7598f4 QtCore`QEventLoop::exec(this=0x000000011aca8e60, flags=<unavailable>) + 372 at qeventloop.cpp:212
    frame #6: 0x000000010a599e62 QtCore`QThread::exec(this=<unavailable>) + 114 at qthread.cpp:507
    frame #7: 0x000000010a59d867 QtCore`QThreadPrivate::start(arg=0x00007f8135be3e70) + 359 at qthread_unix.cpp:368
    frame #8: 0x00007fff8dc7d899 libsystem_pthread.dylib`_pthread_body + 138
    frame #9: 0x00007fff8dc7d72a libsystem_pthread.dylib`_pthread_start + 137
    frame #10: 0x00007fff8dc81fc9 libsystem_pthread.dylib`thread_start + 13

  thread #8: tid = 0x1b678bb, 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10, name = 'OutputFilterThread'
    frame #0: 0x00007fff8fb7994a libsystem_kernel.dylib`poll + 10
    frame #1: 0x000000010a7afcd0 QtCore`qt_safe_poll(pollfd*, unsigned int, timespec const*) [inlined] qt_ppoll(fds=0x00007f8136a69a98, nfds=1) + 528 at qcore_unix.cpp:83
    frame #2: 0x000000010a7afcbb QtCore`qt_safe_poll(fds=0x00007f8136a69a98, nfds=1, timeout_ts=0x0000000000000000) + 507 at qcore_unix.cpp:102
    frame #3: 0x000000010a7b1359 QtCore`QEventDispatcherUNIX::processEvents(this=<unavailable>, flags=<unavailable>) + 857 at qeventdispatcher_unix.cpp:500
    frame #4: 0x000000010a75990e QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) [inlined] QEventLoop::processEvents(this=<unavailable>, flags=<unavailable>) + 398 at qeventloop.cpp:134
    frame #5: 0x000000010a7598f4 QtCore`QEventLoop::exec(this=0x00000001219a1e60, flags=<unavailable>) + 372 at qeventloop.cpp:212
    frame #6: 0x000000010a599e62 QtCore`QThread::exec(this=<unavailable>) + 114 at qthread.cpp:507
    frame #7: 0x000000010a59d867 QtCore`QThreadPrivate::start(arg=0x00007f81364818f8) + 359 at qthread_unix.cpp:368
    frame #8: 0x00007fff8dc7d899 libsystem_pthread.dylib`_pthread_body + 138
    frame #9: 0x00007fff8dc7d72a libsystem_pthread.dylib`_pthread_start + 137
    frame #10: 0x00007fff8dc81fc9 libsystem_pthread.dylib`thread_start + 13

  thread #9: tid = 0x1b679fe, 0x00007fff8fb78e6a libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x00007fff8fb78e6a libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff8dc7ef08 libsystem_pthread.dylib`_pthread_wqthread + 330
    frame #2: 0x00007fff8dc81fb9 libsystem_pthread.dylib`start_wqthread + 13

  thread #10: tid = 0x1b679ff, 0x00007fff8fb78e6a libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x00007fff8fb78e6a libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff8dc7ef08 libsystem_pthread.dylib`_pthread_wqthread + 330
    frame #2: 0x00007fff8dc81fb9 libsystem_pthread.dylib`start_wqthread + 13
(lldb) detach
Process 23985 detached

Possible duplicates by query: bug 384852, bug 384828, bug 384771, bug 384723, bug 384557.

Reported using DrKonqi
Comment 1 RJVB 2017-09-20 16:52:16 UTC
It turns out to be reproducible for the session in question. The session loads when I disable the plugin, and crashes again on reload when I reenable the plugin.

I still think it's freaky for a plugin to crash if not being used ;)
Comment 2 RJVB 2017-09-20 16:55:45 UTC
Apparently it's related to the QMake project manager. Loading a qmake-based project into an already running session triggers the crash.
Comment 3 RJVB 2017-09-21 21:39:01 UTC
Here's what happens: apr_pool_create_ex is called with NULL parent and allocator, leading to a nullptr dereference:

* thread #1: tid = 0x1c6e93b, 0x000000012bde307f libapr-1.0.dylib`apr_pool_create_ex(newpool=0x00007fff519cf7e8, parent=<unavailable>, abort_fn=<unavailable>, allocator=<unavailable>) + 63 at apr_pools.c:1077, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x30)
    frame #0: 0x000000012bde307f libapr-1.0.dylib`apr_pool_create_ex(newpool=0x00007fff519cf7e8, parent=<unavailable>, abort_fn=<unavailable>, allocator=<unavailable>) + 63 at apr_pools.c:1077
   1074         abort_fn = parent->abort_fn;
   1075 
   1076     if (allocator == NULL)
-> 1077         allocator = parent->allocator;
   1078 
   1079     if ((node = allocator_alloc(allocator,
   1080                                 MIN_ALLOC - APR_MEMNODE_T_SIZE)) == NULL) {
(lldb) p parent
error: Couldn't materialize: couldn't get the value of variable parent: variable not available
Errored out in Execute, couldn't PrepareToExecuteJITExpression
(lldb) up
frame #1: 0x000000012b8c4c14 libsvn_subr-1.0.dylib`svn_pool_create_ex(parent_pool=<unavailable>, allocator=<unavailable>) + 36 at pool.c:70
   67   svn_pool_create_ex(apr_pool_t *parent_pool, apr_allocator_t *allocator)
   68   {
   69     apr_pool_t *pool;
-> 70     apr_pool_create_ex(&pool, parent_pool, abort_on_pool_failure, allocator);
   71     return pool;
   72   }
   73   
(lldb) up
frame #2: 0x000000012b75bc0b kdevsubversion.so`svn::Pool::Pool(apr_pool_t*) [inlined] svn::pool_create(parent=0x0000000000000000) + 59 at pool.cpp:46
   43         apr_pool_initialize();
   44       }
   45   
-> 46       return svn_pool_create(parent);
   47     }
   48   
   49     Pool::Pool(apr_pool_t * parent)
(lldb) up
frame #3: 0x000000012b75bbf1 kdevsubversion.so`svn::Pool::Pool(apr_pool_t*) [inlined] svn::Pool::Pool(this=0x00007fb29daea418, parent=0x0000000000000000) + 20 at pool.cpp:50
   47     }
   48   
   49     Pool::Pool(apr_pool_t * parent)
-> 50         : m_parent(parent), m_pool(pool_create(parent))
   51     {
   52     }
   53   
(lldb) bt
* thread #1: tid = 0x1c6e93b, 0x000000012bde307f libapr-1.0.dylib`apr_pool_create_ex(newpool=0x00007fff519cf7e8, parent=<unavailable>, abort_fn=<unavailable>, allocator=<unavailable>) + 63 at apr_pools.c:1077, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x30)
    frame #0: 0x000000012bde307f libapr-1.0.dylib`apr_pool_create_ex(newpool=0x00007fff519cf7e8, parent=<unavailable>, abort_fn=<unavailable>, allocator=<unavailable>) + 63 at apr_pools.c:1077
    frame #1: 0x000000012b8c4c14 libsvn_subr-1.0.dylib`svn_pool_create_ex(parent_pool=<unavailable>, allocator=<unavailable>) + 36 at pool.c:70
    frame #2: 0x000000012b75bc0b kdevsubversion.so`svn::Pool::Pool(apr_pool_t*) [inlined] svn::pool_create(parent=0x0000000000000000) + 59 at pool.cpp:46
  * frame #3: 0x000000012b75bbf1 kdevsubversion.so`svn::Pool::Pool(apr_pool_t*) [inlined] svn::Pool::Pool(this=0x00007fb29daea418, parent=0x0000000000000000) + 20 at pool.cpp:50
    frame #4: 0x000000012b75bbdd kdevsubversion.so`svn::Pool::Pool(this=0x00007fb29daea418, parent=0x0000000000000000) + 13 at pool.cpp:51
    frame #5: 0x000000012b75711d kdevsubversion.so`svn::Context::Data::Data(this=0x00007fb29daea400, configDir_=0x00007fff519cf8b0) + 61 at context.cpp:127
    frame #6: 0x000000012b756d62 kdevsubversion.so`svn::Context::Context(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [inlined] svn::Context::Data::Data(this=<unavailable>, configDir_=<unavailable>) + 50 at context.cpp:130
    frame #7: 0x000000012b756d57 kdevsubversion.so`svn::Context::Context(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [inlined] svn::Context::Context(this=0x00007fb29d3b9240, configDir=0x00007fff519cf8b0) + 23 at context.cpp:631
    frame #8: 0x000000012b756d40 kdevsubversion.so`svn::Context::Context(this=0x00007fb29d3b9240, configDir=<unavailable>) + 16 at context.cpp:630

Not sure how this does not cause problems on Linux ...
Comment 4 RJVB 2017-09-22 21:27:08 UTC
It really *is* a freak crash.

The code behaves as if the call to `apr_pool_initialize()` is never actually made in `svn::pool_create()`. I can assign the function's return to a variable and print that value (0, meaning success), but when I step through the function with a debugger I never actually get into the function. Same thing when I set a breakpoint in `apr_pool_initialize()`.

All this works fine in kdesvn, suggesting something is getting seriously messed up somewhere in KDevelop.
Comment 5 RJVB 2017-09-25 10:58:08 UTC
The only explanation I can find is that the compiler (clang 4.0.1) miscompiles the svncpp code in KDevelop (but not the comparable code in kdesvn, from which I copied certain things for testing). Compiler and/or linker don't generate the proper address for  the apr_pool_initialize() function:


(lldb) l 40
   40       if (!s_initialized)
   41       {
   42         if (apr_pool_initialize() == APR_SUCCESS) {
   43             s_initialized = true;
   44         }
   45       }
   46   
   47       return svn_pool_create(parent);
   48     }
   49   
(lldb) dis -l
kdevsubversion.so`svn::Pool::Pool:
->  0x11e0c3be4 <+36>: callq  0x11e0c5f90               ; symbol stub for: apr_pool_initialize

(lldb) l apr_pool_initialize
File: /Volumes/VMs/MPbuild/_Volumes_Debian_MP9_var_macports_sources_rsync.macports.org_release_ports_devel_apr/apr/work/apr-1.6.2/memory/unix/apr_pools.c
   642   * Local functions
   643   */
   644  
   645  static void run_cleanups(cleanup_t **c);
   646  static void free_proc_chain(struct process_chain *procs);
   647  
   648  #if APR_POOL_DEBUG
   649  static void pool_destroy_debug(apr_pool_t *pool, const char *file_line);
   650  #endif
   651  
   652  #if !APR_POOL_DEBUG
(lldb) l 661
   661      if (apr_pools_initialized++)
   662          return APR_SUCCESS;
   663  
   664  #if HAVE_VALGRIND
   665      apr_running_on_valgrind = RUNNING_ON_VALGRIND;
   666  #endif
   667  
   668  #if APR_ALLOCATOR_USES_MMAP && defined(_SC_PAGESIZE)
   669      boundary_size = sysconf(_SC_PAGESIZE);
   670      boundary_index = 12;

(lldb) p apr_pool_initialize()
(apr_status_t) $1 = 0
(lldb) p apr_pools_initialized
(apr_byte_t) $2 = '\0'
(lldb) p apr_pool_initialize
(apr_status_t (*)()) $3 = 0x000000011e33cc9e (libapr-1.0.dylib`apr_pool_initialize)
Comment 6 Justin Zobel 2020-12-17 05:31:20 UTC
Thank you for the crash report.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 7 Bug Janitor Service 2021-01-01 04:37:30 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Bug Janitor Service 2021-01-16 04:36:25 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!