duckdb / sqlite_scanner

DuckDB extension to read and write to SQLite databases
https://duckdb.org/docs/extensions/sqlite
MIT License
208 stars 21 forks source link

unable to load extension if built in debug mode #36

Closed hinxx closed 1 year ago

hinxx commented 1 year ago

What happens?

I get the following error when trying to load the extension:

hinxx@obzen ~/ess/duckdb/sqlite_scanner $ ./build/debug/duckdb -unsigned
v0.7.2-dev457 403d0ca315
Enter ".help" for usage hints.
D install 'build/debug/extension/sqlite_scanner/sqlite_scanner.duckdb_extension';
D load 'build/debug/extension/sqlite_scanner/sqlite_scanner.duckdb_extension';
/home/hinxx/ess/duckdb/sqlite_scanner/duckdb/src/parser/parsed_data/create_table_function_info.cpp:10:2: runtime error: member access within address 0x7ffec7f47380 which does not point to an object of type 'CreateInfo'
0x7ffec7f47380: note: object is of type 'duckdb::CreateTableFunctionInfo'
 00 00 00 00  c8 9a 0e 21 f7 7f 00 00  19 78 f4 c7 fe 7f 00 00  a0 73 f4 c7 fe 7f 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'duckdb::CreateTableFunctionInfo'

hinxx@obzen ~/ess/duckdb/sqlite_scanner $ g++ --version
g++ (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

To Reproduce

git clone <this repo>
cd sqlite_scanner
make debug
<run as seen above>

OTOH, there is no issue to load the extension if the same code with the same compiler is built in release mode:

hinxx@obzen ~/ess/duckdb/sqlite_scanner $ ./build/release/duckdb -unsigned
v0.7.2-dev457 403d0ca315
Enter ".help" for usage hints.
D install 'build/release/extension/sqlite_scanner/sqlite_scanner.duckdb_extension';
D load 'build/release/extension/sqlite_scanner/sqlite_scanner.duckdb_extension';
D select * from duckdb_extensions();
...
│ sqlite_scanner    │ true    │ true      │ /home/hinxx/.duckdb/extensi…  │ Adds support for reading SQLite database files                       │ [sqlite, sqlite3] │
...

OS:

Linux

SQLite Version:

3.22.0

DuckDB Version:

v0.7.2-dev457

DuckDB Client:

cli

Full Name:

hinko kocevar

Affiliation:

ESS ERIC

Have you tried this on the latest master branch?

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

Mytherin commented 1 year ago

This looks like a duplicate of duckdb/duckdb#6521. It should not be an issue (aside from triggering the sanitizer). You can disable the EXTENSION_STATIC_BUILD flag to fix it during debugging.