Skip to content

Commit 85b98c3

Browse files
Disable invalid-handle check under MSan
The invalid-handle check was disabled in a55878f for Valgrind and MSan issues an warning originating from the Driver Manager, during the same call; ``` ==26==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x7a902a23c3a2 in __validate_stmt /msan-build/DriverManager/__handles.c:1375:20 #1 0x7a902a1fc264 in __SQLFreeHandle /msan-build/DriverManager/SQLFreeHandle.c:398:19 #2 0x559ce0edbbb9 in sqlchar /home/buildbot/odbc_build/source/test/unicode.c:270:12 #3 0x559ce0ed4419 in run_tests_ex /home/buildbot/odbc_build/source/test/tap.h:1182:11 #4 0x7a9029eccca7 (/lib/x86_64-linux-gnu/libc.so.6+0x29ca7) (BuildId: 58749c528985eab03e6700ebc1469fa50aa41219) #5 0x7a9029eccd64 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29d64) (BuildId: 58749c528985eab03e6700ebc1469fa50aa41219) #6 0x559ce0e2e670 in _start (/home/buildbot/odbc_build/build/bintar/test/odbc_unicode+0x34670) (BuildId: 92f183f3e775737cd445db531d16f5654952b845) SUMMARY: MemorySanitizer: use-of-uninitialized-value /msan-build/DriverManager/__handles.c:1375:20 in __validate_stmt ORIGIN: invalid (0). Might be a bug in MemorySanitizer origin tracking. This could still be a bug in your code, too! Exiting ```
1 parent a91902e commit 85b98c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/unicode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,17 @@ ODBC_TEST(sqlchar)
259259
FAIL_IF(SQLFetch(hstmt1) != SQL_NO_DATA_FOUND, "eof expected");
260260

261261
CHECK_STMT_RC(hstmt1, SQLFreeStmt(hstmt1, SQL_DROP));
262+
#ifndef MEMCHECK_SKIP_TEST
262263
// We probably could do that in driver as well, TODO: but do we really need
263264
if (using_dm())
264265
{
266+
#if defined(__has_feature) && __has_feature(memory_sanitizer)
267+
diag("Skipping invalid-handle check under MSan");
268+
#else
265269
is_num(SQLFreeHandle(SQL_HANDLE_STMT, hstmt1), SQL_INVALID_HANDLE);
270+
#endif
266271
}
272+
#endif
267273
CHECK_DBC_RC(hdbc1, SQLDisconnect(hdbc1));
268274
CHECK_DBC_RC(hdbc1, SQLFreeConnect(hdbc1));
269275

0 commit comments

Comments
 (0)