1. Beatrix Willius
  2. Valentina Database ADK
  3. Friday, January 10 2020, 06:58 AM
  4.  Subscribe via email
I didn't get a reply to my last email so I'm trying here: after Thomas Tempelmann convinced me to try with the diagnosis in a thread everything seemed to be fine.

Then I got the first report from a customer: when you switch to another app when the diagnosis is running then macOS redraws the windows, which reloads the data in the main window. Which then crashes due to the running diagnosis. I think I fixed that by doing a semaphore on the reloading of the data. Of course, in this case part of the data in the window disappears because the NSTableView doesn't cache the data.

So far so good. Then yesterday I got another crash report. My app now crashes when the app is quit during diagnosis.

Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff609a2202 close + 10
1 com.apple.CoreServices.CarbonCore 0x00007fff35b9059c BasicCloseFork(int) + 44
2 com.apple.CoreServices.CarbonCore 0x00007fff35b90564 PBCloseForkSync + 17
3 com.apple.CoreServices.CarbonCore 0x00007fff35b90547 FSCloseFork + 29
4 libvshared_fat_release_x64.dylib 0x000000010eba1d64 fbl::File_Mac::DoClose() + 40
5 libvkernel_fat_release_x64.dylib 0x000000010fa8fba9 fbl::DbStorage::CloseVolumes() + 93
6 libvkernel_fat_release_x64.dylib 0x000000010f85afbd fbl::Database_imp::Close() + 281
7 libvkernel_fat_release_x64.dylib 0x000000010f84fc3e fbl::vsql::SqlDatabase::Close() + 334
8 v4rb_cocoa_64.dylib 0x000000010eaa625a Database_Close(REALobjectStruct*) + 94
9 com.mothsoftware.mailarchiverx 0x0000000104857dbf VDatabase.Close%%o<VDatabase> + 31
10 com.mothsoftware.mailarchiverx 0x0000000104e4584b VConnectionController.Disconnect%%o<VConnectionController> + 747
11 com.mothsoftware.mailarchiverx 0x00000001055b99ae MaxModel.CloseArchive%%o<MaxModel> + 510
12 com.mothsoftware.mailarchiverx 0x0000000105ca3bb4 MainWindowController.CloseArchive%%o<MainWindowController> + 212
13 com.mothsoftware.mailarchiverx 0x0000000105ce03fb MainWindow.MainWindow.CloseDB%%o<MainWindow.MainWindow>b + 3915
14 com.mothsoftware.mailarchiverx 0x0000000105ccbe7e MainWindow.MainWindow.Event_CloseDatabase%%o<MainWindow.MainWindow>b + 270
15 com.mothsoftware.mailarchiverx 0x0000000105d5490a DBWindow.CloseArchive%%o<DBWindow> + 474

Thread 11 Crashed:
0 libvkernel_fat_release_x64.dylib 0x000000010faa03ac fbl::SegmentFile::ReadSegmentHeader(unsigned int, fbl::SegmentHeader&;) + 52
1 libvkernel_fat_release_x64.dylib 0x000000010fa9f85c fbl::SegmentFile::Diagnose_ChainOfSegments(fbl::smart_ptr<fbl::I_OStream>, fbl::EVerboseLevel, unsigned int, fbl::BitSet&;) + 166
2 libvkernel_fat_release_x64.dylib 0x000000010fa9f670 fbl::SegmentFile::Diagnose(fbl::smart_ptr<fbl::I_OStream>, fbl::EVerboseLevel, fbl::smart_ptr<fbl::BitSet>;) + 420
3 libvkernel_fat_release_x64.dylib 0x000000010f796297 fbl::VBlob::DiagnoseWithExplain(fbl::smart_ptr<fbl::I_OStream>, fbl::EVerboseLevel, fbl::smart_ptr<fbl::Node_Explain>;) + 1383
4 libvkernel_fat_release_x64.dylib 0x000000010fab56fa fbl::Table::DiagnoseWithExplain(fbl::smart_ptr<fbl::I_OStream>, fbl::EVerboseLevel, fbl::smart_ptr<fbl::Node_Explain>;) + 1098
5 libvkernel_fat_release_x64.dylib 0x000000010f85795b fbl::Database_imp::Diagnose_plain_imp(fbl::smart_ptr<fbl::I_OStream>, fbl::EVerboseLevel, fbl::smart_ptr<fbl::Node_Explain>;) + 195
6 libvkernel_fat_release_x64.dylib 0x000000010f86b64a fbl::Database_imp::DiagnoseWithExplain_imp(fbl::smart_ptr<fbl::I_OStream>, fbl::EVerboseLevel, fbl::smart_ptr<fbl::Node_Explain>;) + 1104
7 libvkernel_fat_release_x64.dylib 0x000000010f86aea9 fbl::Database_imp::DiagnoseWithExplain(fbl::smart_ptr<fbl::I_OStream>, fbl::EVerboseLevel, fbl::smart_ptr<fbl::Node_Explain>;) + 99
8 libvkernel_fat_release_x64.dylib 0x000000010f86b09f fbl::Database_imp::DiagnoseWithExplain(fbl::smart_ptr<fbl::I_Location>, fbl::EVerboseLevel, fbl::smart_ptr<fbl::Node_Explain>;) + 405
9 libvkernel_fat_release_x64.dylib 0x000000010f85c5b5 fbl::Database_imp::Diagnose(fbl::smart_ptr<fbl::I_Location>, fbl::EVerboseLevel) + 71
10 v4rb_cocoa_64.dylib 0x000000010eaacfa9 Database_Diagnose(REALobjectStruct*, int, REALobjectStruct*) + 299
11 com.mothsoftware.mailarchiverx 0x000000010485a6ea VDatabase.Diagnose%b%o<VDatabase>i8o<FolderItem> + 74
12 com.mothsoftware.mailarchiverx 0x0000000104b0aadc DiagnoseThread.Event_Run%%o<DiagnoseThread> + 972
13 com.xojo.XojoFramework 0x00000001077fe860 0x107587000 + 2586720

I have a really bad feeling about the situation with the diagnosis. A couple of times I thought "now I've got it" - just to see another hole that I need to plug.

The whole architecture doesn't work. The app is async and the database is not. That doesn't fit together.

Mit freundlichen Grüßen/Regards

Beatrix Willius

Mail Archiver X: The email archiving solution for professionals
There are no comments made yet.
Beatrix Willius Accepted Answer
I have an idea where I screwed up. The diagnosis feels like a sieve or I'm too stupid.
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Ruslan Zasukhin Accepted Answer
Hi Trixi,

that idea has fixed this issue?
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Beatrix Willius Accepted Answer
Hi Ruslan,

yes, got the issue fixed. A too-early notification closed the progress window while the diagnosis was ongoing.

How do I solve the problem with the disappearing data?
Sorry, I do not see question about data above. Where it was?
  1. Ruslan Zasukhin
  2. 1 year ago
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
Beatrix Willius Accepted Answer
Do a diagnosis
Switch to another app
Switch back to my app
Now macOS does a refresh of the window.

The NSTableview reloads the data -> crash because the diagnosis is ongoing. Or do a semaphore so that no data is loaded which makes the data go away. The NSTableview doesn't cache the data. I assign a cursor and with the method

Public Function DataSource_Cell(row as Integer, column as Integer) as ListCellTV

I only get the data of the visible cells from the cursor into the NSTableview.
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 4
Ivan Smahin Accepted Answer
Hi Beatrix,

As far as I got it - there are 2 threads (I mean OS threads - not Xojo's) which are calling vKernel at the same time and crash happens? BTW, could you send me the crash log?
It seems to be impossible because of Xojo's cooperative multitasking. I mean it could be few OS threads, but it can not be really 2 vKernel calls at the same time.

Well, we have thread-safe vKernel/vShared... components which are using under vServer, vStudio and probably some ADKs, but not under Xojo's plugin. Probably, we should use them in Xojo.

As a workaround, you may use something like Mutex/Semaphore or condition_variables/events for synching that threads.
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 5
Beatrix Willius Accepted Answer
I've attached the crash log. I'm now using a semaphore as workaround.
Attachments (1)
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 6
  • Page :
  • 1

There are no replies made for this post yet.
However, you are not allowed to reply to this post.


Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories