Your message dated Mon, 20 Oct 2025 09:49:03 +0000
with message-id <[email protected]>
and subject line Bug#1118416: fixed in sqliteodbc 0.99991-4
has caused the Debian Bug report #1118416,
regarding libsqliteodbc: Segmentation fault after calling SQLGetTypeInfo
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1118416: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118416
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libsqliteodbc
Version: 0.99991-3
Severity: important
Tags: upstream patch
X-Debbugs-Cc: [email protected]
Programs that use SQLGetTypeInfo (notable example is pyodbc) are
crashing now. This happened after Fix-incompatible-pointer patch was
added. This is caused by incorrect free function that is used -
drvgettypeinfo returns result that is stored in static buffers but
rowfree function tries to deallocate it.
I suspect that SQLTables (drvtables) has same issue but don't have any
code that uses this function.
Minimal program to reproduce this error:
```
#include <stdio.h>
#include <string.h>
#include <sql.h>
#include <sqlext.h>
int fail(const char *err)
{
printf("%s\n", err);
return -1;
}
int main()
{
const char * settings = "driver=SQLite3;database=/tmp/file.db";
SQLHENV env = NULL;
if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE,
&env)))
return fail("Failed to allocate ODBC Environment");
if (!SQL_SUCCEEDED(SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION,
(SQLPOINTER) SQL_OV_ODBC3, 0)))
return fail("Failed to request ODBCv3");
SQLHDBC dbc = NULL;
if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc)))
return fail("Failed to allocate ODBC Connection");
char buf[SQL_MAX_OPTION_STRING_LENGTH];
SQLSMALLINT buflen = sizeof(buf);
if (!SQL_SUCCEEDED(SQLDriverConnect(dbc, NULL, (SQLCHAR *)settings,
strlen(settings), (SQLCHAR *)buf, sizeof(buf), &buflen, SQL_DRIVER_NOPROMPT)))
return fail("Failed to connect");
printf("Connection string: %s\n", buf);
HSTMT hstmt;
if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_STMT, dbc, &hstmt)))
return -1;
/*
// Code from pyodbc
SQLINTEGER columnsize;
if (SQL_SUCCEEDED(SQLGetTypeInfo(hstmt, SQL_VARCHAR)) &&
SQL_SUCCEEDED(SQLFetch(hstmt)) &&
SQL_SUCCEEDED(SQLGetData(hstmt, 3, SQL_INTEGER, &columnsize,
sizeof(columnsize), 0))) {
printf("Column size: %d\n", columnsize);
}
SQLFreeStmt(hstmt, SQL_CLOSE);
*/
// Minimal variant
SQLGetTypeInfo(hstmt, SQL_VARCHAR);
SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
SQLDisconnect(dbc);
SQLFreeHandle(SQL_HANDLE_DBC, dbc);
SQLFreeHandle(SQL_HANDLE_ENV, env);
}
```
Inline patch:
```
diff --git a/debian/patches/Fix-incompatible-pointer-compilation-error.patch
b/debian/patches/Fix-incompatible-pointer-compilation-error.patch
index 3494c8a..b83831d 100644
--- a/debian/patches/Fix-incompatible-pointer-compilation-error.patch
+++ b/debian/patches/Fix-incompatible-pointer-compilation-error.patch
@@ -44,7 +44,7 @@ index 5f5959d..9b001ad 100644
s->rowfree = xfree__;
#else
- s->rowfree = sqlite3_free;
-+ s->rowfree = sqlite3_free_table;
++ s->rowfree = (void (*)(char **)) sqlite3_free;
#endif
memset(s->rows, 0, sizeof (char *) * (s->nrows + 1) * asize);
if (sqltype == SQL_ALL_TYPES) {
@@ -92,7 +92,7 @@ index 055dba2..ad30b4a 100644
s->rowfree = xfree__;
#else
- s->rowfree = free;
-+ s->rowfree = freerows;
++ s->rowfree = (void (*)(char **)) free;
#endif
memset(s->rows, 0, sizeof (char *) * (s->nrows + 1) * asize);
if (sqltype == SQL_ALL_TYPES) {
```
-- System Information:
Debian Release: 13.1
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-9-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to
en_US.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Versions of packages libsqliteodbc depends on:
ii libc6 2.41-12
ii libsqlite3-0 3.46.1-7
ii odbcinst 2.3.12-2
libsqliteodbc recommends no packages.
libsqliteodbc suggests no packages.
-- no debconf information
diff --git a/debian/patches/Fix-incompatible-pointer-compilation-error.patch
b/debian/patches/Fix-incompatible-pointer-compilation-error.patch
index 3494c8a..b83831d 100644
--- a/debian/patches/Fix-incompatible-pointer-compilation-error.patch
+++ b/debian/patches/Fix-incompatible-pointer-compilation-error.patch
@@ -44,7 +44,7 @@ index 5f5959d..9b001ad 100644
s->rowfree = xfree__;
#else
- s->rowfree = sqlite3_free;
-+ s->rowfree = sqlite3_free_table;
++ s->rowfree = (void (*)(char **)) sqlite3_free;
#endif
memset(s->rows, 0, sizeof (char *) * (s->nrows + 1) * asize);
if (sqltype == SQL_ALL_TYPES) {
@@ -92,7 +92,7 @@ index 055dba2..ad30b4a 100644
s->rowfree = xfree__;
#else
- s->rowfree = free;
-+ s->rowfree = freerows;
++ s->rowfree = (void (*)(char **)) free;
#endif
memset(s->rows, 0, sizeof (char *) * (s->nrows + 1) * asize);
if (sqltype == SQL_ALL_TYPES) {
diff --git a/debian/patches/Fix-incompatible-pointer-compilation-error.patch
b/debian/patches/Fix-incompatible-pointer-compilation-error.patch
index 3494c8a..b83831d 100644
--- a/debian/patches/Fix-incompatible-pointer-compilation-error.patch
+++ b/debian/patches/Fix-incompatible-pointer-compilation-error.patch
@@ -44,7 +44,7 @@ index 5f5959d..9b001ad 100644
s->rowfree = xfree__;
#else
- s->rowfree = sqlite3_free;
-+ s->rowfree = sqlite3_free_table;
++ s->rowfree = (void (*)(char **)) sqlite3_free;
#endif
memset(s->rows, 0, sizeof (char *) * (s->nrows + 1) * asize);
if (sqltype == SQL_ALL_TYPES) {
@@ -92,7 +92,7 @@ index 055dba2..ad30b4a 100644
s->rowfree = xfree__;
#else
- s->rowfree = free;
-+ s->rowfree = freerows;
++ s->rowfree = (void (*)(char **)) free;
#endif
memset(s->rows, 0, sizeof (char *) * (s->nrows + 1) * asize);
if (sqltype == SQL_ALL_TYPES) {
--- End Message ---
--- Begin Message ---
Source: sqliteodbc
Source-Version: 0.99991-4
Done: Chris Hofstaedtler <[email protected]>
We believe that the bug you reported is fixed in the latest version of
sqliteodbc, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Chris Hofstaedtler <[email protected]> (supplier of updated sqliteodbc package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Mon, 20 Oct 2025 11:28:47 +0200
Source: sqliteodbc
Architecture: source
Version: 0.99991-4
Distribution: unstable
Urgency: medium
Maintainer: Chris Hofstaedtler <[email protected]>
Changed-By: Chris Hofstaedtler <[email protected]>
Closes: 1118416
Changes:
sqliteodbc (0.99991-4) unstable; urgency=medium
.
* Use free on memory allocated by (x)malloc (Closes: #1118416)
* Refresh patches
Checksums-Sha1:
6ad187d56a15dde64a39d9114520b67668cefb56 2374 sqliteodbc_0.99991-4.dsc
2572bc2405984d901b6ece5a52dda03505dc8f00 12728
sqliteodbc_0.99991-4.debian.tar.xz
c995fc5296c334da285f080f9f164eccf1270dd9 9500
sqliteodbc_0.99991-4_arm64.buildinfo
Checksums-Sha256:
4f0104d736636ab1fcf3809d6f2515576f84535c40f40ef9c9bb4cec87689a10 2374
sqliteodbc_0.99991-4.dsc
a9a1df6b7dbb285af8a3f8fece744045d413b64d14df2c957ed390d6f24a4557 12728
sqliteodbc_0.99991-4.debian.tar.xz
9490fa298105cdc0fc00ada38786e83438168a63d9a5ed0c93765e415707ecda 9500
sqliteodbc_0.99991-4_arm64.buildinfo
Files:
7bd0c5d19f4e43e3976e3d741735ff8f 2374 libs optional sqliteodbc_0.99991-4.dsc
924e313c51de7e3ecf72db232d4cecd2 12728 libs optional
sqliteodbc_0.99991-4.debian.tar.xz
b9168c5a4eb71ba8e95e0119b6778b5e 9500 libs optional
sqliteodbc_0.99991-4_arm64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEfRrP+tnggGycTNOSXBPW25MFLgMFAmj2AqMACgkQXBPW25MF
LgNfjA/8CZwb/xYMC5sC80NEyORMDL6Ibm1BD2SopyL1DfGkahZw+PMQG7o0887J
2VAJBlKH7pYWJZ3952t8qoK5fSFG+PfD3TupA6KzZ7JallCC+cHFD9WL3sqHZz8b
B/SGJQEwyjDMA2IwVr6BpRKvw+bedJJd2TxWIyqmirpqWiWtfH4TivxC67HP7j8J
qGC4/Z8WTBlq0jvm9iRuQ6h8Da1AO867QKXEDrMHSrrIqpLQERkseDhY2KBNG8ky
9PIRH3ToZKEoLqOM1UOHSV+3KuMLxqhuRhpz8MRAy8IWqdVBUaMNAK+kcxXEJ3Gn
Q/zj/1sOrRIP6kGs4eE6061UUnYOM9lRhTBLSWBGvXWIgWwsSI9qEMwMi84BOBrt
+W6Q7c2eCfmeGyWKNQN3dbwUZ7fO4XLyBDa2Pl/tZIViVxwghDgMST3igLXYAiGn
6enibTdIeWwfWy+oRC3MaN7/J8JURubcOt7Et5w045ImN6RllhTbBfqWaChWlF5F
Jg4Zw/dL9va5EMIZTA6rk1E9y6emjacehfsvvrY9ptHcqVR81LpBE+LQkKFHJU8h
LN5V/ADCyaB+BVJs+Y1ZEyOie5lITI+CvsmkFS++0xickp4Z7RnJOcaqNQfGydBF
i1N147Zzq/lWG7LTkdxiCFbX472NHwMQqL4bnzSVxG5qFmorbV4=
=snfc
-----END PGP SIGNATURE-----
pgpfV4PSJ238a.pgp
Description: PGP signature
--- End Message ---