SQLITE_IOERR_SHMMAP
SQLiteERRORNotableI/O Errorofficial confidence
I/O error memory-mapping WAL shared memory
Production Risk
High — WAL-mode reads will fail without shm.
What this means
SQLITE_IOERR_SHMMAP (5386) is returned when SQLite cannot memory-map the WAL shared-memory file (-shm). This prevents WAL-mode readers from accessing the database.
Why it happens
- 1Insufficient virtual address space (32-bit process with large shm file).
- 2Permissions on the -shm file do not allow the current user to map it.
- 3Filesystem does not support shared memory mapping.
How to reproduce
WAL-mode database open when the -shm file cannot be memory-mapped.
trigger — this will error
trigger — this will error
# WAL databases require a -shm file; mmap failure → # sqlite3.OperationalError: disk I/O error
expected output
sqlite3.OperationalError: disk I/O error
Fix 1
Fix 2
Fix 3
Sources
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev