sqlitebrowser / sqlitebrowser/sqlitebrowser

[Bug]: `ROLLBACK;VACUUM;` indefinitely locks up application when switching tabs

Open
#3,772 5 comments 0 reactions 1 assignee View on GitHub

@mgrojo is already working on this.

Since Oct 19, 2024.

duplicate response requested
Dominant language
C++
Stars
24.6k
Forks
2.4k
Avg merge
3d 49m
Merged PRs (30d)
3

Description

What did you do?
  1. Create or open any database (file or memory)
  2. Execute ROLLBACK;VACUUM; in the sql editor
  3. Change the active tab
What did you expect to see?

The application should do either one of:

  • Change the tab and update contents when the query has completed
  • Inform the user that it's not possible to do so
  • Not executing SQL queries on the UI thread. Instead executing them in a time limited background thread providing graceful abort.

If we want to be very pedantic, the SQL statement should be aborted immediately, since there is no transaction opened by the user that ROLLBACK applies to, and it should not be possible to undermine the internal SQL state of the application.

What did you see instead?

The application indefinitely locks up. The only way out is to forcibly closing it, losing any and all unsaved SQL queries.

It seems that the ROLLBACK; terminates a transaction created by the application itself, leaving it in a corrupt state where it is unable to make any changes to the database whatsoever now. With the VACUUM command, the editor indefinitely waits for the internal transaction to complete but this is not possible since it has been rolled back. This is probably what then leads to it running indefinitely and eventually locking up the application because every command issued afterwards, whether by SQL editor or by an internal action gets queued forever.

DB4S Version

3.13.0

What OS are you seeing the problem on?

Windows

OS version

Version 10.0.19045.3208

Relevant log output

No response

Prevention against duplicate issues
  • I have searched for similar issues

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.