Title: 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 · GitHub
Open Graph Title: 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
X Title: 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
Description: 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...
Open Graph Description: 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 ...
X Description: 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...
Opengraph URL: https://github.com/python/cpython/issues/142787
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"assertion failure at Modules/_sqlite/blob.c:146: `PyObject *read_multiple(pysqlite_Blob *, Py_ssize_t, Py_ssize_t): Assertion 'offset \u003c sqlite3_blob_bytes(self-\u003eblob)' failed`","articleBody":"# Crash report\n\n### What happened?\n\n```python\nimport sqlite3\n\n# 1. Setup an in-memory database with a BLOB column\ncon = sqlite3.connect(':memory:')\ncon.execute('create table test(b blob)')\n\n# 2. Insert a small amount of data.\n# The unicode character '\\u2603' (Snowman) is 3 bytes in UTF-8 (b'\\xe2\\x98\\x83').\n# The blob size will be 3.\ncon.execute('insert into test(b) values (?)', ('\\u2603',))\n\n# 3. Open the BLOB for incremental I/O\n# Table: 'test', Column: 'b', Row: 1\nblob = con.blobopen('test', 'b', 1)\n\n# 4. Trigger the crash\n# We request a slice starting at index 5 (which is beyond the blob size of 3)\n# and ending at index -5 (which wraps around to before the start).\n# This combination causes the internal 'offset' calculation in C to assert\n# failing that the offset (5) is not less than the blob bytes (3).\nblob[5:-5]\n```\n\n```\npython: ../Modules/_sqlite/blob.c:146: PyObject *read_multiple(pysqlite_Blob *, Py_ssize_t, Py_ssize_t): Assertion `offset \u003c sqlite3_blob_bytes(self-\u003eblob)' failed.\n```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n### Output from running 'python -VV' on the command line:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-142824\n* gh-145297\n* gh-145298\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/YuanchengJiang","@type":"Person","name":"YuanchengJiang"},"datePublished":"2025-12-16T07:17:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/142787/cpython/issues/142787"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fff1aa4e-b15f-c547-7bb1-3fbf61766adb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C844:1EEA:4CB4036:6C6FEE8:6A500FF8 |
| html-safe-nonce | 3efdb4964d97b6d56f2337a2a7d30e4927df41a9485b93d8dd9f07265e2a6383 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODQ0OjFFRUE6NENCNDAzNjo2QzZGRUU4OjZBNTAwRkY4IiwidmlzaXRvcl9pZCI6IjIzODkxNjYwODUyMDkzMjk2NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5f06580b584d5c93d713b87cf88e25b314be1fc4517676982d2e61b4bd158f65 |
| hovercard-subject-tag | issue:3733522157 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/142787/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d7a09042c11733aa34b00bed272af8dcba7f9cb020f7c3b3d06b482568827124/python/cpython/issues/142787 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d7a09042c11733aa34b00bed272af8dcba7f9cb020f7c3b3d06b482568827124/python/cpython/issues/142787 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YuanchengJiang |
| hostname | github.com |
| expected-hostname | github.com |
| None | fe4f38b24922a1ce81c1708c3793b47c185599b9144ab94f6ca846b00698058d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 42b6390c91978a16f9196c38c7a00e9bf21f37e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width