GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — assertion failure at Modules/_sqlite/blob.c:146: `PyObject *read_multiple(pysqlite_Blob *, Py_ssize_t, Py_ssize_t): Assertion 'offset < sqlite3_blob_bytes(self->blob)' failed` · Issue #142787 · python/cpython

assertion failure at Modules/_sqlite/blob.c:146: PyObject *read_multiple(pysqlite_Blob *, Py_ssize_t, Py_ssize_t): Assertion 'offset < sqlite3_blob_bytes(self->blob)' failed #142787

New issue
Copy link
New issue
Copy link
Closed
#142824
Closed
assertion failure at Modules/_sqlite/blob.c:146: PyObject *read_multiple(pysqlite_Blob *, Py_ssize_t, Py_ssize_t): Assertion 'offset < sqlite3_blob_bytes(self->blob)' failed#142787
#142824
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-sqlite3type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@YuanchengJiang
YuanchengJiang
opened on Dec 16, 2025
Issue body actions

Crash report

What happened?

import sqlite3

# 1. Setup an in-memory database with a BLOB column
con = sqlite3.connect(':memory:')
con.execute('create table test(b blob)')

# 2. Insert a small amount of data.
# The unicode character '\u2603' (Snowman) is 3 bytes in UTF-8 (b'\xe2\x98\x83').
# The blob size will be 3.
con.execute('insert into test(b) values (?)', ('\u2603',))

# 3. Open the BLOB for incremental I/O
# Table: 'test', Column: 'b', Row: 1
blob = con.blobopen('test', 'b', 1)

# 4. Trigger the crash
# We request a slice starting at index 5 (which is beyond the blob size of 3)
# and ending at index -5 (which wraps around to before the start).
# This combination causes the internal 'offset' calculation in C to assert
# failing that the offset (5) is not less than the blob bytes (3).
blob[5:-5]
python: ../Modules/_sqlite/blob.c:146: PyObject *read_multiple(pysqlite_Blob *, Py_ssize_t, Py_ssize_t): Assertion `offset < sqlite3_blob_bytes(self->blob)' failed.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

Linked PRs

  • gh-142787: Fix assertion failure in sqlite3 blob slice #142824
  • [3.14] gh-142787: Handle empty sqlite3 blob slices (GH-142824) #145297
  • [3.13] gh-142787: Handle empty sqlite3 blob slices (GH-142824) #145298

Activity

  1. YuanchengJiang
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on Dec 16, 2025
  2. StanFromIreland
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    topic-sqlite3
    on Dec 16, 2025
  3. github-project-automation
    added this to sqlite3 issueson Dec 16, 2025
  4. abdoulrasheed
    added a commit that references this issue on Dec 16, 2025

    pythongh-142787: Fix assertion failure in sqlite3 blob slice

    97ca005
  5. erlend-aasland
    moved this to In Progress in sqlite3 issueson Dec 16, 2025
  6. abdoulrasheed
    added a commit that references this issue on Dec 16, 2025

    Add regression test for pythongh-142787

    c7a12b3
  7. erlend-aasland
    linked a pull request that will close this issuegh-142787: Fix assertion failure in sqlite3 blob slice #142824on Feb 26, 2026
  8. erlend-aasland
    added a commit that references this issue on Feb 26, 2026

    gh-142787: Handle empty sqlite3 blob slices (#142824)

    06b0920
  9. erlend-aasland
    closed this as completedin #142824on Feb 26, 2026
  10. github-project-automation
    moved this from In Progress to Done in sqlite3 issueson Feb 26, 2026
  11. miss-islington
    added 2 commits that reference this issue on Feb 26, 2026

    pythongh-142787: Handle empty sqlite3 blob slices (pythonGH-142824)

    04cab0e

    pythongh-142787: Handle empty sqlite3 blob slices (pythonGH-142824)

    de537f0
  12. erlend-aasland
    added 2 commits that reference this issue on Feb 27, 2026

    [3.14] gh-142787: Handle empty sqlite3 blob slices (GH-142824) (#145297)

    bc6a7a2

    [3.13] gh-142787: Handle empty sqlite3 blob slices (GH-142824) (#145298)

    cd3e9b3
  13. erlend-aasland commented on Feb 27, 2026

    @erlend-aasland
    erlend-aasland
    on Feb 27, 2026
    Contributor
    More actions

    Thanks for the report, @YuanchengJiang, and thanks for the fix @abdoulrasheed!

  14. brijkapadia
    added a commit that references this issue on Feb 28, 2026

    pythongh-142787: Handle empty sqlite3 blob slices (python#142824)

    26a469c
  15. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-142787: Handle empty sqlite3 blob slices (python#142824)

    9fbeae8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-sqlite3type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    Projects

    • sqlite3 issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.