У меня странная проблема с использованием создателя QT.Я использую последнюю версию QT Creator и функции Qvector (я пробовал также std :: vector и та же проблема) В цикле я вызываю рекурсивные функции, например:
void add(bool in){
global_var.push_back(in) //Qvector<bool>, global varible
return;
}
void start(int x,int y,int z){
for(int i=0;i<z;i++){
if(i<z){
add(true);
start(x,y,z);
start(x,y,z);
return;
}
}
add(false)
}
А затем приложение случайно падает в некоторыхЕдинственная ошибка, которую я получаю:
Process: FIRST_program [24565]
Path: /Users/USER/Downloads/*/FIRST_program.app/Contents/MacOS/FIRST_program
Identifier: feri.FIRST_program
Version: 0
Code Type: X86-64 (Native)
Parent Process: Qt Creator [23775]
Responsible: FIRST_program [24565]
User ID: 501
Date/Time: 2018-12-12 21:24:41.838 +0100
OS Version: Mac OS X 10.14.1 (18B75)
Report Version: 12
Bridge OS Version: 3.0 (14Y667)
Anonymous UUID: F7D655B5-7798-C8EF-925D-0F2BF1B2ABD3
Sleep/Wake UUID: 6384DE06-A77B-4893-9D81-3BC040DA989F
Time Awake Since Boot: 52000 seconds
Time Since Wake: 11000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007ffee4a8bff8
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [24565]
VM Regions Near 0x7ffee4a8bff8:
MALLOC_SMALL 00007f9884800000-00007f9885800000 [ 16.0M] rw-/rwx SM=PRV
--> STACK GUARD 00007ffee128c000-00007ffee4a8c000 [ 56.0M] ---/rwx SM=NUL stack guard for thread 0
Stack 00007ffee4a8c000-00007ffee528c000 [ 8192K] rw-/rwx SM=SHM thread 0
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 macbook.FIRST_program 0x000000010a97d690 QBasicAtomicInteger<int>::load() const + 16 (qbasicatomic.h:103)
1 macbook.FIRST_program 0x000000010a97f155 QtPrivate::RefCount::isShared() const + 21 (qrefcount.h:101)
2 macbook.FIRST_program 0x000000010a980d38 QVector<bool>::isDetached() const + 24 (qvector.h:106)
3 macbook.FIRST_program 0x000000010a981920 QVector<bool>::append(bool const&) + 64 (qvector.h:679)
4 macbook.FIRST_program 0x000000010a97b64d QVector<bool>::push_back(bool const&) + 29 (qvector.h:260)
5 macbook.FIRST_program 0x000000010a97afc8 MainWindow::add(bool) + 40 (mainwindow.cpp:204)
6 macbook.FIRST_program 0x000000010a97ae22 MainWindow::start(int, int, int, int) + 242 (mainwindow.cpp:132)
7 macbook.FIRST_program 0x000000010a97ae9b MainWindow::start(int, int, int, int) + 363 (mainwindow.cpp:139)
8 macbook.FIRST_program 0x000000010a97ae9b MainWindow::start(int, int, int, int) + 363 (mainwindow.cpp:139)
9 macbook.FIRST_program 0x000000010a97ae9b MainWindow::start(int, int, int, int) + 363 (mainwindow.cpp:139)
10 macbook.FIRST_program 0x000000010a97ae9b MainWindow::start(int, int, int, int) + 363 (mainwindow.cpp:139)
11 macbook.FIRST_program 0x000000010a97ae9b MainWindow::start(int, int, int, int) + 363 (mainwindow.cpp:139)
12 macbook.FIRST_program 0x000000010a97ae9b MainWindow::start(int, int, int, int) + 363 (mainwindow.cpp:139)
13 macbook.FIRST_program 0x000000010a97ae9b MainWindow::start(int, int, int, int) + 363 (mainwindow.cpp:139)