Summary: | Crash in the SVN plugin [svn::pool_create] | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | RJVB <rjvbertin> |
Component: | general | Assignee: | 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
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 ;) Apparently it's related to the QMake project manager. Loading a qmake-based project into an already running session triggers the crash. 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 ... 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. 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) 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. 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! 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! |