Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

trying to get sqlite3 working on MacOS after upgrade to Mojave

36 views
Skip to first unread message

ben....@snowflake.com

unread,
Aug 30, 2019, 11:43:17 AM8/30/19
to
Hi all - I just upgraded MacOS to Mojave 14.6. This broke an existing tcl/tk script. Culprit is sqlite. Existing code now produces a segmentation fault on
package require sqlite3

How do I proceed here? Do I have a tcl/tk install mismatched with the sqlite3 libraries, or maybe I need to use the "package require -exact" syntax? Or something else?

I'm also not sure how to detect what version of sqlite3 my tcl/tk installation is expecting.

I'm using an ActiveState tcl/tk installation.
% puts [info patchlevel]
8.6.9

Also, run interactively:
% package require sqlite3
3.24.0
% sqlite3 myvar ./mydb.db
Segmentation fault: 11

If I run "sqlite3 --version" from the MacOS command prompt, I get
$ sqlite3 --version
3.24.0 2018-06-04 14:10:15 95fbac39baaab1c3a84fdfc82ccb7f42398b2e92f18a2a57bce1d4a713cbaapl

and

$ which sqlite3
/usr/bin/sqlite3


How come from within my script, just running "package require sqlite3" causes a crash, but when run interactively, the Segmentation fault comes when trying to open a database.

Any help appreciated!

Ben

Gerald Lester

unread,
Aug 30, 2019, 1:48:58 PM8/30/19
to
Are you using the Tcl/Tk that comes with MacOS or a version you built?

Are you using an SQLite that came with MacOS or a version you built/pulled?

My first guess is that one package is built for 32 bits and the other 64
bits giving you a mismatch and thus causing the segmentation fault/crash.


--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

Christian Gollwitzer

unread,
Aug 31, 2019, 2:28:37 PM8/31/19
to
Am 30.08.19 um 17:43 schrieb ben....@snowflake.com:
> Hi all - I just upgraded MacOS to Mojave 14.6. This broke an existing tcl/tk script. Culprit is sqlite. Existing code now produces a segmentation fault on
> package require sqlite3
>
> How do I proceed here? Do I have a tcl/tk install mismatched with the sqlite3 libraries, or maybe I need to use the "package require -exact" syntax? Or something else?
>
> I'm also not sure how to detect what version of sqlite3 my tcl/tk installation is expecting.
>
> I'm using an ActiveState tcl/tk installation.
> % puts [info patchlevel]
> 8.6.9
>
> Also, run interactively:
> % package require sqlite3
> 3.24.0

After that, do "package ifneeded sqlite3 3.24.0". This will tell you
where exactly sqlite came from.

> % sqlite3 myvar ./mydb.db
> Segmentation fault: 11

Strange, because sqlite itself is typically linked statically with the
Tcl package. Try to recompile it.


> If I run "sqlite3 --version" from the MacOS command prompt, I get
> $ sqlite3 --version
> 3.24.0 2018-06-04 14:10:15 95fbac39baaab1c3a84fdfc82ccb7f42398b2e92f18a2a57bce1d4a713cbaapl

This gives you another version of sqlite3 not linked to the Tcl module.
This should not be problematic, because the on-disc format of sqlite is
very stable.

> How come from within my script, just running "package require sqlite3" causes a crash, but when run interactively, the Segmentation fault comes when trying to open a database.


That is the pleasure of memory access errors. Something gets randomly
overwritten, and the crash happens at a time when it finally goes wrong.

Christian
0 new messages