zddhub/opensse

SketchSearchDemo causes segmentation fault: 11

Jermmy opened this issue Β· 9 comments

Hello zddhub! I am sorry to bother you again. I use your vocabulary to train the data and compile your Qt demo as you said in wiki. When I run sse in command line, everything works well.

xyzdeMacBook-Pro:MacOS xyz$ sse search -i /Users/xyz/Desktop/opensse/index_file -v /Users/xyz/Desktop/opensse/data/vocabulary -f /Users/xyz/Desktop/opensse/filelist -n 10
read vocabulary 1000/1000.
>> sketch search :
>> input absolute path, like "/Users/zdd/zddhub.png"
>> type q exit
>> good luck!
>> /Users/xyz/Desktop/opensse/0.jpg
0.977542 /Users/xyz/Desktop/opensse/Database/SHREC12/D00400view/0.jpg
0.697008 /Users/xyz/Desktop/opensse/Database/SHREC12/D00400view/80.jpg
0.676193 /Users/xyz/Desktop/opensse/Database/SHREC12/D00391view/0.jpg
0.636707 /Users/xyz/Desktop/opensse/Database/SHREC12/D00390view/100.jpg
0.617532 /Users/xyz/Desktop/opensse/Database/SHREC12/D00384view/100.jpg
0.602837 /Users/xyz/Desktop/opensse/Database/SHREC12/D00382view/101.jpg
0.602616 /Users/xyz/Desktop/opensse/Database/SHREC12/D00400view/50.jpg
0.599047 /Users/xyz/Desktop/opensse/Database/SHREC12/D00400view/81.jpg
0.598671 /Users/xyz/Desktop/opensse/Database/SHREC12/D00389view/101.jpg
0.594396 /Users/xyz/Desktop/opensse/Database/SHREC12/D00385view/15.jpg
>> q

But if I run the demo and start to draw, the program crashed and I got an error:

xyzdeMacBook-Pro:MacOS xyz$ ./SketchSearchDemo
Segmentation fault: 11

I am so curious about your project and hope to run your app demo successfully. Could you please give me five?

This is what my config.json looks like:

{
    "searcher":
    {
        "indexfile": "/Users/xyz/Desktop/opensse/index_file",
        "filelist": "/Users/xyz/Desktop/opensse/filelist",
        "vocabulary": "/Users/xyz/Desktop/opensse/data/vocabulary",
        "results_num": "12",
        "views_num": "102"
    }
}

After carefully checking it with the option I run in command line, I think the configuration is right.

This is my Qt version:

xyzdeMacBook-Pro:opensse xyz$ qmake --version
QMake version 3.1
Using Qt version 5.8.0 in /usr/local/Cellar/qt/5.8.0_2/lib

When you run qmake command, your config.json file and view folder will be copied to /tmp/SketchSearchDemo folder like below:

image

So, If you change your config.json file, you should run qmake again.

If still crash, please upload your report log.

I make the project again and it still crash.
How to get my report log? I only get a crash report from system like this:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libopensse.dylib              	0x0000000104bc552c sse::QuantizerHard<std::__1::vector<float, std::__1::allocator<float> >, sse::L2norm_squared<std::__1::vector<float, std::__1::allocator<float> >, float> >::quantize(std::__1::vector<float, std::__1::allocator<float> > const&, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > const&, std::__1::vector<float, std::__1::allocator<float> >&) + 300
1   libopensse.dylib              	0x0000000104bc4bf3 sse::quantize_samples_parallel(std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > const&, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > const&, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > >&, sse::QuantizerHard<std::__1::vector<float, std::__1::allocator<float> >, sse::L2norm_squared<std::__1::vector<float, std::__1::allocator<float> >, float> >&) + 227
2   libopensse.dylib              	0x0000000104bc49d7 sse::quantize(std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > const&, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > const&, std::__1::vector<float, std::__1::allocator<float> >&, sse::QuantizerHard<std::__1::vector<float, std::__1::allocator<float> >, sse::L2norm_squared<std::__1::vector<float, std::__1::allocator<float> >, float> >&) + 263
3   SketchSearchDemo              	0x000000010303abcd SketchSearcher::query(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<QueryResult, std::__1::allocator<QueryResult> >&) + 237
4   SketchSearchDemo              	0x0000000103036b97 MainWindow::search(QString const&) + 151
5   org.qt-project.QtCore         	0x00000001058f117a QMetaObject::activate(QObject*, int, int, void**) + 2954
6   SketchSearchDemo              	0x000000010303bf05 SketchArea::newSketchDone(QString const&) + 53
7   org.qt-project.QtWidgets      	0x0000000104ca50f5 QWidget::event(QEvent*) + 533
8   org.qt-project.QtWidgets      	0x0000000104c63f52 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 306
9   org.qt-project.QtWidgets      	0x0000000104c66e9a QApplication::notify(QObject*, QEvent*) + 7514
10  org.qt-project.QtCore         	0x00000001058c093f QCoreApplication::notifyInternal2(QObject*, QEvent*) + 159
11  org.qt-project.QtWidgets      	0x0000000104c648d0 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) + 896
12  org.qt-project.QtWidgets      	0x0000000104cc60bc 0x104c52000 + 475324
13  org.qt-project.QtWidgets      	0x0000000104cc4d19 0x104c52000 + 470297
14  org.qt-project.QtWidgets      	0x0000000104c63f52 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 306
15  org.qt-project.QtWidgets      	0x0000000104c652a8 QApplication::notify(QObject*, QEvent*) + 360
16  org.qt-project.QtCore         	0x00000001058c093f QCoreApplication::notifyInternal2(QObject*, QEvent*) + 159
17  org.qt-project.QtGui          	0x000000010522721a QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 2938
18  org.qt-project.QtGui          	0x000000010520e0fb QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 155
19  libqcocoa.dylib               	0x000000010835f471 0x108339000 + 156785
20  com.apple.CoreFoundation      	0x00007fff8ab8f3c1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
21  com.apple.CoreFoundation      	0x00007fff8ab702cd __CFRunLoopDoSources0 + 557
22  com.apple.CoreFoundation      	0x00007fff8ab6f7c6 __CFRunLoopRun + 934
23  com.apple.CoreFoundation      	0x00007fff8ab6f1c4 CFRunLoopRunSpecific + 420
24  com.apple.HIToolbox           	0x00007fff8a0d0ebc RunCurrentEventLoopInMode + 240
25  com.apple.HIToolbox           	0x00007fff8a0d0bf9 ReceiveNextEventCommon + 184
26  com.apple.HIToolbox           	0x00007fff8a0d0b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
27  com.apple.AppKit              	0x00007fff8866be24 _DPSNextEvent + 1120
28  com.apple.AppKit              	0x00007fff88de785e -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
29  com.apple.AppKit              	0x00007fff886607ab -[NSApplication run] + 926
30  libqcocoa.dylib               	0x000000010835e21f 0x108339000 + 152095
31  org.qt-project.QtCore         	0x00000001058bc8d2 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 418
32  org.qt-project.QtCore         	0x00000001058c0ff7 QCoreApplication::exec() + 343
33  SketchSearchDemo              	0x0000000103035fad main + 61
34  libdyld.dylib                 	0x00007fffa02d2235 start + 1

No idea from log ...

Sad😞... But still appreciate your work. After all the core function worksπŸ˜€

My demo need put model file (*.off) under the same folder with view images folder (D00xxxview).

If still not work, perhaps you need debug the code and find out root cause by yourself. Good luck!

I think my configuration is right:

xyzdeMacBook-Pro:SHREC12 xyz$ tree
.
β”œβ”€β”€ D00001.off
β”œβ”€β”€ D00001view
β”‚   β”œβ”€β”€ 0.jpg
β”‚   β”œβ”€β”€ 1.jpg
β”‚   β”œβ”€β”€ 10.jpg
β”‚   β”œβ”€β”€ 100.jpg
β”‚   β”œβ”€β”€ 101.jpg
β”‚   β”œβ”€β”€ 11.jpg
β”‚   β”œβ”€β”€ 12.jpg
...

I know little about Qt. Maybe I'll try to debug it later.

Well, finally I fix it. It's a stupid error that I comment the config.json in wrong way causing my own configuration didn't work at all.
I can enjoy it now.
opensse