-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault when drag and dropping a table from another DB4S instance #1288
Comments
Interesting. What's the value of |
It's:
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: sqlitebrowser/src/MainWindow.cpp Lines 503 to 509 in b08960f
Line 509 there is the one calling Looking back a few lines, line 474 looks interesting: sqlitebrowser/src/MainWindow.cpp Line 474 in b08960f
That 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? 😄 |
Awesome. Thanks @MKleusberg. 😄 |
Perfect! It's working now. I don't know how I could overlooked that change in the tree, but I took it as a mere collapse of the items. Thanks @MKleusberg |
@MKleusberg I just noticed that now the same is happening when you change the schema line-break setting and save the preferences. It was working 39a5460 so I guess that the change fix one situation and breaks the other. I've looked a bit at it but don't know how to solve it. |
Can you try with the latest fix? I hope it's working in all cases now 😉 |
Perfect. It's no longer happening. |
Details for the issue
Open two DB4S instances.
Drag a table from the Database Structure of one instance and drop in the same tab of the other.
Tree is refreshed and the new is present in the database.
Change to the Browse Data tab.
Receiving DB4S instance crashes with the following backtrace:
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: