Recent

Author Topic: External SIGSEV (Database is locked)  (Read 508 times)

Ylmith

  • Newbie
  • Posts: 3
External SIGSEV (Database is locked)
« on: February 10, 2026, 04:54:25 pm »
Bonjour,

je travaille avec Lazarus sur une application qui utilisait une base Access, mais devant tous
les changements néfastes qui se profilent chez Microsoft j'ai décidé de porter les tables de
l'application vers SQLite (que j'utilise par ailleurs régulièrement)
Il y a juste 2 tables, elles s'ouvrent sans problème dans les forms (DBGrids) mais génèrent le
même type d'erreur quand j'essaie de faire  des mises à jour (Update)

Je reçois le message

" Database is locked"

et ensuite dans la fenêtre de l'assembleur

00000000007E924E 8890A0000000      mov [rax+$000000A0],dl

qui correspond, selon tout ce que j'ai lu, à une erreur mémoire.

J'ai demandé à Perplexity de me donner les raisons d'une telle erreur et les solutions,
j'ai, je crois, tout vérifié et essayé mais sans succès...d'où ce post.

merci d'avance.



440bx

  • Hero Member
  • *****
  • Posts: 6159
Re: External SIGSEV (Database is locked)
« Reply #1 on: February 10, 2026, 05:07:08 pm »
The above text in English is:

Hello,

I'm working with Lazarus on an application that used an Access database, but given all the negative changes looming at Microsoft, I decided to migrate the application's tables to SQLite (which I also use regularly).
There are just two tables; they open without any problem in the forms (DBGrids), but generate the same type of error when I try to perform updates.

I receive the message:

"Database is locked"

and then in the assembler window:

00000000007E924E 8890A0000000 mov [rax+$000000A0],dl

which, according to everything I've read, corresponds to a memory error.

I asked Perplexity to explain the reasons for this error and provide solutions.

I think I've checked and tried everything, but without success...hence this post.

Thanks in advance.



@Ylmith

Posts in the international section are expected to be in English.  Also, you're much more likely to get help if more people understand the message (which is likely to be a higher number for a message in English)
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Ylmith

  • Newbie
  • Posts: 3
Re: External SIGSEV (Database is locked)
« Reply #2 on: February 10, 2026, 05:34:35 pm »
ok, thanks

cdbc

  • Hero Member
  • *****
  • Posts: 2687
    • http://www.cdbc.dk
Re: External SIGSEV (Database is locked)
« Reply #3 on: February 10, 2026, 05:37:46 pm »
Hi
Hmmm, do you by any chance have the database active/open in the Lazarus IDE?!?
If it's an internal sqlite-lock, sometimes you can use "sqlite3" app (from the commandline) to copy / backup the db-file, so you can get to using it again...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Zvoni

  • Hero Member
  • *****
  • Posts: 3315
Re: External SIGSEV (Database is locked)
« Reply #4 on: February 11, 2026, 08:26:34 am »
That's a classic with SQLite, specifically when using DB-Bound controls and/or a separate DB-Management-Program (DB-Browser for SQLite, DBeaver etc.) in parallel
first line after opening do a ExecSQL with "pragma journal_mode=wal" and you're set

EDIT: Just checked fpc3.2.3 (fixes)
If you're on fixes, adding a Param "journal_mode=wal" before opening your connection is enough

They changed the "DoInternalConnect" for SQLite3Connection there.
Though why they are handling only 2 Pragmas is beyond me. Nevermind the Params are not sanitized.
(No check if someone adds "PRAGMA journal_mode=wal" which would result in "PRAGMA PRAGMA journal_mode=wal")

EDIT2: Correction: It would result in no execution of the Pragma at all, since they can't find the "name"-Part in Params.
Even worse....

« Last Edit: February 11, 2026, 08:37:31 am by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018