I've used pgloader successfully to import a SQLite database to PostgreSQL. Since then, even with the master version, I've received a "Control stack guard page temporarily disabled: proceed with caution" error. The SQLite database is trivial: CREATE TABLE t(v int); with a single row. The only output from --debug is:
2018-10-23T19:02:32.040000+01:00 DEBUG LOAD DATA FROM #<PGLOADER.SOURCE.SQLITE:SQLITE-CONNECTION sqlite:///var/lib/postgresql/test.db {10058CEE03}>
2018-10-23T19:02:32.040000+01:00 DEBUG CONNECTED TO #<PGLOADER.PGSQL:PGSQL- CONNECTION pgsql://postgres@UNIX:5432/test {1005AD04A3}>
2018-10-23T19:02:32.040000+01:00 DEBUG SET client_encoding TO 'utf8'
2018-10-23T19:02:32.040000+01:00 DEBUG SET application_name TO 'pgloader'
2018-10-23T19:02:32.050000+01:00 LOG Migrating from #<SQLITE-CONNECTION sqlite:///var/lib/postgresql/test.db {10058CEE03}>
2018-10-23T19:02:32.050000+01:00 LOG Migrating into #<PGSQL-CONNECTION pgsql://postgres@UNIX:5432/test {1005AD04A3}>
2018-10-23T19:02:32.067000+01:00 DEBUG CONNECTED TO /var/lib/postgresql/test.db
2018-10-23T19:02:32.067000+01:00 SQL SQLite: SELECT tbl_name
FROM sqlite_master
WHERE tbl_name = 'sqlite_sequence'
2018-10-23T19:02:32.070000+01:00 SQL SELECT tbl_name
FROM sqlite_master
WHERE type='table'
AND tbl_name <> 'sqlite_sequence'
2018-10-23T19:02:32.097000+01:00 NOTICE Prepare PostgreSQL database.
2018-10-23T19:02:32.099000+01:00 DEBUG CONNECTED TO #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://postgres@UNIX:5432/test {1005AD04A3}>
2018-10-23T19:02:32.099000+01:00 DEBUG SET client_encoding TO 'utf8'
2018-10-23T19:02:32.100000+01:00 DEBUG SET application_name TO 'pgloader'
2018-10-23T19:02:32.102000+01:00 DEBUG BEGIN
KABOOM!
INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution
2018-10-23T19:02:32.452000+01:00 INFO Stopping monitor
What I am doing here?
Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.
PROCEED WITH CAUTION.
I think I've narrowed this down to an incompatability with Postgres 10. On a fresh Debian testing install with the http://apt.postgresql.org/pub/repos/apt/ repository configured, and Postgres 10.5-2.pgdg90+1 listening on port 5433, and 9.5.14 listening on port 5434, pgloader 3.5.2, and the same trivial SQLite database as before:
PGPORT=5433 pgloader test.db postgresql:///test
2018-10-24T17:28:20.059000Z LOG Migrating from #<SQLITE-CONNECTION sqlite:///var/lib/postgresql/test.db {1006012BE3}>
2018-10-24T17:28:20.063000Z LOG Migrating into #<PGSQL-CONNECTION pgsql://postgres@UNIX:5433/test {100625B5A3}>
KABOOM!
INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution
What I am doing here?
Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.
PROCEED WITH CAUTION.
$ PGPORT=5434 pgloader test.db postgresql:///test
2018-10-24T17:28:44.059000Z LOG Migrating from #<SQLITE-CONNECTION sqlite:///var/lib/postgresql/test.db {1006012BE3}>
2018-10-24T17:28:44.063000Z LOG Migrating into #<PGSQL-CONNECTION pgsql://postgres@UNIX:5434/test {100625B5A3}>
2018-10-24T17:28:44.254000Z LOG report summary reset
table name errors rows bytes total time
----------------------- --------- --------- --------- --------------
fetch 0 0 0.000s
fetch meta data 0 1 0.023s
Create Schemas 0 0 0.001s
Create SQL Types 0 0 0.007s
Create tables 0 2 0.016s
Set Table OIDs 0 1 0.008s
----------------------- --------- --------- --------- --------------
t 0 1 0.0 kB 0.024s
----------------------- --------- --------- --------- --------------
COPY Threads Completion 0 4 0.025s
Index Build Completion 0 0 0.000s
Reset Sequences 0 0 0.013s
Primary Keys 0 0 0.000s
Create Foreign Keys 0 0 0.000s
Create Triggers 0 0 0.000s
Install Comments 0 0 0.000s
----------------------- --------- --------- --------- --------------
Total import time ? 1 0.0 kB 0.038s
I'm still seeing this issue while using the dimitri/pgloader Docker container and Postgres 11.1. I also tried Postgres 10 but hit the same issue.
root@c11fb58eb8bc:/data# psql -h psql -U codespeed -c "SELECT version();"
Password for user codespeed:
version
-------------------------------------------------------------------------------------------------------------------
---------------
PostgreSQL 11.1 (Debian 11.1-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20
170516, 64-bit
(1 row)
root@c11fb58eb8bc:/data# pgloader --version
WARNING:
Couldn't re-execute SBCL with proper personality flags (/proc isn't mounted? setuid?)
Trying to continue anyway.
pgloader version "3.5.2~devel"
compiled with SBCL 1.3.14.debian
root@94b8787f1064:/data# pgloader --debug pgloader.migrate
WARNING:
Couldn't re-execute SBCL with proper personality flags (/proc isn't mounted? setuid?)
Trying to continue anyway.
sb-impl::*default-external-format* :ANSI_X3.4-1968
tmpdir: #P"/tmp/pgloader/"
2018-12-06T14:10:17.017000Z NOTICE Starting pgloader, log system is ready.
2018-12-06T14:10:17.036000Z INFO Starting monitor
2018-12-06T14:10:17.058000Z INFO Parsed command:
load database
from sqlite:///data/data.db
into postgresql://codespeed:foobar00@psql:5432/codespeed
with include drop, create tables, create indexes, reset sequences
set work_mem to '16MB', maintenance_work_mem to '512 MB';
2018-12-06T14:10:17.131000Z DEBUG CONNECTED TO #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://codespeed@psql:5432/codespeed {1006CA3293}>
2018-12-06T14:10:17.132000Z DEBUG SET client_encoding TO 'utf8'
2018-12-06T14:10:17.132000Z DEBUG SET work_mem TO '16MB'
2018-12-06T14:10:17.132000Z DEBUG SET maintenance_work_mem TO '512 MB'
2018-12-06T14:10:17.132000Z DEBUG SET application_name TO 'pgloader'
2018-12-06T14:10:17.143000Z LOG Migrating from #<SQLITE-CONNECTION sqlite:///data/data.db {1006CA1CE3}>
2018-12-06T14:10:17.143000Z LOG Migrating into #<PGSQL-CONNECTION pgsql://codespeed@psql:5432/codespeed {1006CA3293}>
2018-12-06T14:10:17.155000Z DEBUG CONNECTED TO /data/data.db
2018-12-06T14:10:17.155000Z SQL SQLite: SELECT tbl_name
FROM sqlite_master
WHERE tbl_name = 'sqlite_sequence'
2018-12-06T14:10:17.160000Z SQL SELECT tbl_name
FROM sqlite_master
WHERE type='table'
AND tbl_name <> 'sqlite_sequence'
2018-12-06T14:10:17.163000Z NOTICE SQLite column django_migrations.id uses a sequence
2018-12-06T14:10:17.168000Z NOTICE SQLite column django_admin_log.id uses a sequence
2018-12-06T14:10:17.168000Z NOTICE SQLite column django_content_type.id uses a sequence
2018-12-06T14:10:17.168000Z NOTICE SQLite column auth_permission.id uses a sequence
2018-12-06T14:10:17.168000Z NOTICE SQLite column auth_user.id uses a sequence
2018-12-06T14:10:17.169000Z NOTICE SQLite column codespeed_environment.id uses a sequence
2018-12-06T14:10:17.169000Z NOTICE SQLite column codespeed_revision.id uses a sequence
2018-12-06T14:10:17.170000Z NOTICE SQLite column codespeed_report.id uses a sequence
2018-12-06T14:10:17.170000Z NOTICE SQLite column codespeed_executable.id uses a sequence
2018-12-06T14:10:17.171000Z NOTICE SQLite column codespeed_benchmark.id uses a sequence
2018-12-06T14:10:17.171000Z NOTICE SQLite column codespeed_result.id uses a sequence
2018-12-06T14:10:17.172000Z NOTICE SQLite column codespeed_project.id uses a sequence
2018-12-06T14:10:17.172000Z NOTICE SQLite column codespeed_branch.id uses a sequence
2018-12-06T14:10:17.210000Z NOTICE Prepare PostgreSQL database.
2018-12-06T14:10:17.213000Z DEBUG CONNECTED TO #<PGLOADER.PGSQL:PGSQL-CONNECTION pgsql://codespeed@psql:5432/codespeed {1006CA3293}>
2018-12-06T14:10:17.213000Z DEBUG SET client_encoding TO 'utf8'
2018-12-06T14:10:17.213000Z DEBUG SET work_mem TO '16MB'
2018-12-06T14:10:17.213000Z DEBUG SET maintenance_work_mem TO '512 MB'
2018-12-06T14:10:17.213000Z DEBUG SET application_name TO 'pgloader'
2018-12-06T14:10:17.217000Z DEBUG BEGIN
KABOOM!
INFO: Control stack guard page unprotected
Control stack guard page temporarily disabled: proceed with caution
2018-12-06T14:10:17.568000Z INFO Stopping monitor
What I am doing here?
Control stack exhausted (no more space for function call frames).
This is probably due to heavily nested or infinitely recursive function
calls, or a tail call that SBCL cannot or has not optimized away.
PROCEED WITH CAUTION.
I believe https://github.com/dimitri/pgloader/commit/ab2cadff24f58c933b2c6afd29604c5e938eb8c7 should have fixed the issue, so I'm closing it. Please re-open if that's still a problem that needs attention.
Most helpful comment
I think I've narrowed this down to an incompatability with Postgres 10. On a fresh Debian testing install with the http://apt.postgresql.org/pub/repos/apt/ repository configured, and Postgres 10.5-2.pgdg90+1 listening on port 5433, and 9.5.14 listening on port 5434, pgloader 3.5.2, and the same trivial SQLite database as before: