This happens for simple plugins as well (tested with the attached plugin). The stack trace from address sanitizer is below.
=================================================================
==12840==ERROR: AddressSanitizer: heap-use-after-free on address 0x61900004b580 at pc 0x7fcfa05be4aa bp 0x7fff775ea390 sp 0x7fff775ea388
READ of size 8 at 0x61900004b580 thread T0
#0 0x7fcfa05be4a9 in BOARD::~BOARD() /master/pcbnew/class_board.cpp:155:9
#1 0x7fcfa05be9dd in BOARD::~BOARD() /master/pcbnew/class_board.cpp:142:1
#2 0x7fcfa059c70c in PCB_BASE_FRAME::~PCB_BASE_FRAME() /master/pcbnew/pcb_base_frame.cpp:108:5
#3 0x7fcf9fce9008 in PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME() /master/pcbnew/pcb_base_edit_frame.cpp:53:1
#4 0x7fcf9fcfc205 in PCB_EDIT_FRAME::~PCB_EDIT_FRAME() /master/pcbnew/pcb_edit_frame.cpp:339:1
#5 0x7fcf9fcfc22d in PCB_EDIT_FRAME::~PCB_EDIT_FRAME() /master/pcbnew/pcb_edit_frame.cpp:338:1
#6 0x7fcfab2429c6 in wxAppConsoleBase::DeletePendingObjects() ../src/common/appbase.cpp:591:16
#7 0x7fcfab242a48 in wxAppConsoleBase::ProcessIdle() ../src/common/appbase.cpp:397:25
#8 0x7fcfab8434a7 in wxAppBase::ProcessIdle() ../src/common/appcmn.cpp:366:50
#9 0x7fcfab76d094 in wxApp::DoIdle() ../src/gtk/app.cpp:159:31
#10 0x7fcfab76d1b6 ../src/gtk/app.cpp:107:28
#11 0x7fcfa977f7da (/lib64/libglib-2.0.so.0+0x4c7da)
#12 0x7fcfa9782edc in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x4fedc)
#13 0x7fcfa978326f (/lib64/libglib-2.0.so.0+0x5026f)
#14 0x7fcfa97835a2 in g_main_loop_run (/lib64/libglib-2.0.so.0+0x505a2)
#15 0x7fcfa9dc1b3c in gtk_main (/lib64/libgtk-3.so.0+0x24db3c)
#16 0x7fcfab78cbc4 in wxGUIEventLoop::DoRun() ../src/gtk/evtloop.cpp:65:17
#17 0x7fcfab285170 in wxEventLoopBase::Run() ../src/common/evtloopcmn.cpp:78:17
#18 0x7fcfab245c69 in wxAppConsoleBase::MainLoop() ../src/common/appbase.cpp:334:40
#19 0x53c770 in APP_KICAD::OnRun() /master/kicad/kicad.cpp:261:27
#20 0x7fcfab2d9abb in wxEntry(int&, wchar_t**) ../src/common/init.cpp:506:31
#21 0x53a4ae in main /master/kicad/kicad.cpp:292:1
#22 0x7fcfaa2abf32 in __libc_start_main (/lib64/libc.so.6+0x23f32)
#23 0x40302d in _start (/master/build/debug/kicad/kicad+0x40302d)
0x61900004b580 is located 0 bytes inside of 956-byte region [0x61900004b580,0x61900004b93c)
freed by thread T0 here:
#0 0x51d65f in operator delete(void*) (/master/build/debug/kicad/kicad+0x51d65f)
#1 0x7fcfab24b138 /usr/include/c++/9/ext/new_allocator.h:128:19
#2 0x7fcfab24b138 /usr/include/c++/9/bits/alloc_traits.h:470:9
#3 0x7fcfab24b138 /usr/include/c++/9/bits/basic_string.h:237:34
#4 0x7fcfab24b138 /usr/include/c++/9/bits/basic_string.h:232:4
#5 0x7fcfab24b138 /usr/include/c++/9/bits/basic_string.h:658:9
#6 0x7fcfab24b138 ../include/wx/string.h:393:24
#7 0x7fcfab24b138 ../include/wx/scopedarray.h:29:24
#8 0x7fcfab24b138 in wxArrayString::Add(wxString const&, unsigned long) ../src/common/arrstr.cpp:302:53
previously allocated by thread T0 here:
#0 0x51c83f in operator new(unsigned long) (/master/build/debug/kicad/kicad+0x51c83f)
#1 0x52575e in __gnu_cxx::new_allocator<wchar_t>::allocate(unsigned long, void const*) /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/ext/new_allocator.h:114:27
#2 0x5256fa in std::allocator_traits<std::allocator<wchar_t> >::allocate(std::allocator<wchar_t>&, unsigned long) /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/alloc_traits.h:444:20
#3 0x525465 in std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_create(unsigned long&, unsigned long) /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/basic_string.tcc:153:14
#4 0x52737e in std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_assign(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/basic_string.tcc:265:24
#5 0x7fcfab24a86b /usr/include/c++/9/bits/basic_string.h:1366:2
#6 0x7fcfab24a86b /usr/include/c++/9/bits/basic_string.h:696:27
#7 0x7fcfab24a86b ../include/wx/string.h:1883:28
#8 0x7fcfab24a86b in wxArrayString::Grow(unsigned long) ../src/common/arrstr.cpp:149:31
Application: Pcbnew
Version: (5.99.0-151-g8be9aeac9-dirty), debug build
Libraries:
wxWidgets 3.0.4
libcurl/7.65.3 OpenSSL/1.1.1c-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.9.0/openssl/zlib nghttp2/1.38.0
Platform: Linux 5.1.18-300.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.69.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.65.3
Compiler: Clang 8.0.0 with C++ ABI 1002
This happens for simple plugins as well (tested with the attached plugin). The stack trace from address sanitizer is below.
======= ======= ======= ======= ======= ======= ======= ======= ======= == pcbnew/ class_board. cpp:155: 9 pcbnew/ class_board. cpp:142: 1 FRAME:: ~PCB_BASE_ FRAME() /master/ pcbnew/ pcb_base_ frame.cpp: 108:5 EDIT_FRAME: :~PCB_BASE_ EDIT_FRAME( ) /master/ pcbnew/ pcb_base_ edit_frame. cpp:53: 1 FRAME:: ~PCB_EDIT_ FRAME() /master/ pcbnew/ pcb_edit_ frame.cpp: 339:1 FRAME:: ~PCB_EDIT_ FRAME() /master/ pcbnew/ pcb_edit_ frame.cpp: 338:1 e::DeletePendin gObjects( ) ../src/ common/ appbase. cpp:591: 16 e::ProcessIdle( ) ../src/ common/ appbase. cpp:397: 25 :ProcessIdle( ) ../src/ common/ appcmn. cpp:366: 50 gtk/app. cpp:159: 31 gtk/app. cpp:107: 28 libglib- 2.0.so. 0+0x4c7da) context_ dispatch (/lib64/ libglib- 2.0.so. 0+0x4fedc) libglib- 2.0.so. 0+0x5026f) libglib- 2.0.so. 0+0x505a2) libgtk- 3.so.0+ 0x24db3c) :DoRun( ) ../src/ gtk/evtloop. cpp:65: 17 ::Run() ../src/ common/ evtloopcmn. cpp:78: 17 e::MainLoop( ) ../src/ common/ appbase. cpp:334: 40 kicad/kicad. cpp:261: 27 common/ init.cpp: 506:31 kicad/kicad. cpp:292: 1 libc.so. 6+0x23f32) build/debug/ kicad/kicad+ 0x40302d)
==12840==ERROR: AddressSanitizer: heap-use-after-free on address 0x61900004b580 at pc 0x7fcfa05be4aa bp 0x7fff775ea390 sp 0x7fff775ea388
READ of size 8 at 0x61900004b580 thread T0
#0 0x7fcfa05be4a9 in BOARD::~BOARD() /master/
#1 0x7fcfa05be9dd in BOARD::~BOARD() /master/
#2 0x7fcfa059c70c in PCB_BASE_
#3 0x7fcf9fce9008 in PCB_BASE_
#4 0x7fcf9fcfc205 in PCB_EDIT_
#5 0x7fcf9fcfc22d in PCB_EDIT_
#6 0x7fcfab2429c6 in wxAppConsoleBas
#7 0x7fcfab242a48 in wxAppConsoleBas
#8 0x7fcfab8434a7 in wxAppBase:
#9 0x7fcfab76d094 in wxApp::DoIdle() ../src/
#10 0x7fcfab76d1b6 ../src/
#11 0x7fcfa977f7da (/lib64/
#12 0x7fcfa9782edc in g_main_
#13 0x7fcfa978326f (/lib64/
#14 0x7fcfa97835a2 in g_main_loop_run (/lib64/
#15 0x7fcfa9dc1b3c in gtk_main (/lib64/
#16 0x7fcfab78cbc4 in wxGUIEventLoop:
#17 0x7fcfab285170 in wxEventLoopBase
#18 0x7fcfab245c69 in wxAppConsoleBas
#19 0x53c770 in APP_KICAD::OnRun() /master/
#20 0x7fcfab2d9abb in wxEntry(int&, wchar_t**) ../src/
#21 0x53a4ae in main /master/
#22 0x7fcfaa2abf32 in __libc_start_main (/lib64/
#23 0x40302d in _start (/master/
0x61900004b580 is located 0 bytes inside of 956-byte region [0x61900004b580 ,0x61900004b93c ) build/debug/ kicad/kicad+ 0x51d65f) c++/9/ext/ new_allocator. h:128:19 c++/9/bits/ alloc_traits. h:470:9 c++/9/bits/ basic_string. h:237:34 c++/9/bits/ basic_string. h:232:4 c++/9/bits/ basic_string. h:658:9 wx/string. h:393:24 wx/scopedarray. h:29:24 :Add(wxString const&, unsigned long) ../src/ common/ arrstr. cpp:302: 53
freed by thread T0 here:
#0 0x51d65f in operator delete(void*) (/master/
#1 0x7fcfab24b138 /usr/include/
#2 0x7fcfab24b138 /usr/include/
#3 0x7fcfab24b138 /usr/include/
#4 0x7fcfab24b138 /usr/include/
#5 0x7fcfab24b138 /usr/include/
#6 0x7fcfab24b138 ../include/
#7 0x7fcfab24b138 ../include/
#8 0x7fcfab24b138 in wxArrayString:
previously allocated by thread T0 here: build/debug/ kicad/kicad+ 0x51c83f) :new_allocator< wchar_t> ::allocate( unsigned long, void const*) /usr/bin/ ../lib/ gcc/x86_ 64-redhat- linux/9/ ../../. ./../include/ c++/9/ext/ new_allocator. h:114:27 traits< std::allocator< wchar_t> >::allocate( std::allocator< wchar_t> &, unsigned long) /usr/bin/ ../lib/ gcc/x86_ 64-redhat- linux/9/ ../../. ./../include/ c++/9/bits/ alloc_traits. h:444:20 cxx11:: basic_string< wchar_t, std::char_ traits< wchar_t> , std::allocator< wchar_t> >::_M_create( unsigned long&, unsigned long) /usr/bin/ ../lib/ gcc/x86_ 64-redhat- linux/9/ ../../. ./../include/ c++/9/bits/ basic_string. tcc:153: 14 cxx11:: basic_string< wchar_t, std::char_ traits< wchar_t> , std::allocator< wchar_t> >::_M_assign( std::__ cxx11:: basic_string< wchar_t, std::char_ traits< wchar_t> , std::allocator< wchar_t> > const&) /usr/bin/ ../lib/ gcc/x86_ 64-redhat- linux/9/ ../../. ./../include/ c++/9/bits/ basic_string. tcc:265: 24 c++/9/bits/ basic_string. h:1366: 2 c++/9/bits/ basic_string. h:696:27 wx/string. h:1883: 28 :Grow(unsigned long) ../src/ common/ arrstr. cpp:149: 31
#0 0x51c83f in operator new(unsigned long) (/master/
#1 0x52575e in __gnu_cxx:
#2 0x5256fa in std::allocator_
#3 0x525465 in std::__
#4 0x52737e in std::__
#5 0x7fcfab24a86b /usr/include/
#6 0x7fcfab24a86b /usr/include/
#7 0x7fcfab24a86b ../include/
#8 0x7fcfab24a86b in wxArrayString:
Application: Pcbnew 151-g8be9aeac9- dirty), debug build 0.9.0/openssl/ zlib nghttp2/1.38.0 300.fc30. x86_64 x86_64, 64 bit, Little endian, wxGTK compatible with 2.8) GTK+ 3.24
Version: (5.99.0-
Libraries:
wxWidgets 3.0.4
libcurl/7.65.3 OpenSSL/1.1.1c-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/
Platform: Linux 5.1.18-
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,
Boost: 1.69.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.65.3
Compiler: Clang 8.0.0 with C++ ABI 1002
Build settings: SCRIPTING= ON SCRIPTING_ MODULES= ON SCRIPTING_ PYTHON3= ON SCRIPTING_ WXPYTHON= ON SCRIPTING_ WXPYTHON_ PHOENIX= ON SCRIPTING_ ACTION_ MENU=ON GITHUB_ PLUGIN= ON USE_OCE= ON USE_OCC= OFF STDLIB_ DEBUG=OFF STDLIB_ LIGHT_DEBUG= OFF SANITIZE= OFF
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON
KICAD_
KICAD_
KICAD_