Segmentation fault when drag and dropping a table from another DB4S instance #1288
Details for the issue
Open two DB4S instances.
Useful extra information
I'm opening this issue because:
I'm using DB4S on:
I'm using DB4S version:
I have also:
The text was updated successfully, but these errors were encountered:
That explains the crash. Everything is null, including the m_db member in line sqlitetablemodel.cpp:71
It seems an incorrect initialisation after refreshing the database.
Yep. Looking at that backtrace, this seems to be the culprit code:
Line 509 there is the one calling
Looking back a few lines, line 474 looks interesting:
On the other hand, this is all inside the
This is all just me guessing though. 😄
When dragging and dropping a table from one instance of the application to the other, the tree structure representing the database was broken. We would show the 'Browsables' and 'All' nodes at the top level instead of the child nodes of the 'All' node. This happened because after dropping a table, we would reload the database structure and rebuild the tree structure but didn't notify the tree view in the main window about the update. This is fixed by this commit, so the main window's widgets are always notified about the new tree structure. See issue #1288.
The problem actually happens a bit earlier. You can see, that after dropping a table onto the structure view, the tree structure looks different: it's not longer Tables/Views/Indices/Triggers but Browsables/All instead. This happened essentially because whenever the tree structure is updated, we need to notify the main window because some code in there restricts the structure view to the bits in the 'All' node and the browse data combobox to the 'Browsables' node. In this case here however we didn't notify the main window, so the restriction bits weren't executed. The crash in the Browse Data tab is then only a follow up issue on this 😉
Anyway, I think I have fixed the issue. Can you double check, @mgrojo? 😄