PL/Python fails on new NetBSD/PPC 8.0 install

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: PL/Python fails on new NetBSD/PPC 8.0 install
Date: 2019-06-18 22:16:40
Message-ID: 25662.1560896200@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I noticed that the old NetBSD 5.1.5 installation I had on my G4 Mac
was no longer passing our regression tests, because it has a strtof()
that is sloppy about underflow. Rather than fight with that I decided
to update it to something shinier (well, as shiny as you can get on
hardware that's old enough to apply for a driver's license). I stuck in
NetBSD/macppc 8.0, and things seem to work, except that PL/Python
crashes on launch. I see something like this in the postmaster log:

Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1162, in _install_external_importers
File "<frozen importlib._bootstrap>", line 980, in _find_and_load
File "<frozen importlib._bootstrap>", line 149, in __enter__
File "<frozen importlib._bootstrap>", line 84, in acquire
RuntimeError: no current thread ident
Fatal Python error: initexternalimport: external importer setup failed

Current thread 0xffffffff (most recent call first):
2019-06-18 17:40:59.629 EDT [20764] LOG: server process (PID 23714) was terminated by signal 6: Abort trap
2019-06-18 17:40:59.629 EDT [20764] DETAIL: Failed process was running: CREATE FUNCTION stupid() RETURNS text AS 'return "zarkon"' LANGUAGE plpython3u;

and a stack trace like

#0 0xfddd383c in _lwp_kill () from /usr/lib/libc.so.12
#1 0xfddd3800 in raise () from /usr/lib/libc.so.12
#2 0xfddd2e38 in abort () from /usr/lib/libc.so.12
#3 0xf4c371dc in fatal_error () from /usr/pkg/lib/libpython3.7.so.1.0
#4 0xf4c38370 in _Py_FatalInitError () from /usr/pkg/lib/libpython3.7.so.1.0
#5 0xf4c38f7c in Py_InitializeEx () from /usr/pkg/lib/libpython3.7.so.1.0
#6 0xf4c38fc0 in Py_Initialize () from /usr/pkg/lib/libpython3.7.so.1.0
#7 0xfdc8d548 in PLy_initialize () at plpy_main.c:135
#8 0xfdc8da0c in plpython3_validator (fcinfo=<optimized out>)
at plpy_main.c:192
#9 0x01d4a904 in FunctionCall1Coll (flinfo=0xffffd608,
collation=<optimized out>, arg1=<optimized out>) at fmgr.c:1140
#10 0x01d4b03c in OidFunctionCall1Coll (functionId=functionId(at)entry=16464,
collation=collation(at)entry=0, arg1=arg1(at)entry=32774) at fmgr.c:1418
#11 0x0196a9d0 in ProcedureCreate (
procedureName=procedureName(at)entry=0xfdb0aac0 "transaction_test1",
procNamespace=procNamespace(at)entry=2200, replace=replace(at)entry=false,
returnsSet=returnsSet(at)entry=false, returnType=returnType(at)entry=2278,
proowner=10, languageObjectId=languageObjectId(at)entry=16465,
languageValidator=languageValidator(at)entry=16464,
prosrc=prosrc(at)entry=0xfdb0abf8 "\nfor i in range(0, 10):\n plpy.execute(\"INSERT INTO test1 (a) VALUES (%d)\" % i)\n if i % 2 == 0:\n plpy.commit()\n else:\n plpy.rollback()\n", probin=probin(at)entry=0x0,
...

The "no current thread ident" error rings some vague bells, but I could
not find any previous discussion matching that in our archives.

This is with today's HEAD of our code and the python37-3.7.1 package from
NetBSD 8.0.

Any ideas? I'm not so wedded to PL/Python that I'll spend a lot of time
making it go on this old box ... but seeing that 3.7 is still pretty
bleeding-edge Python, I wonder if other people will start getting this
too.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ken Tanzer 2019-06-18 22:23:40 Re: psql UPDATE field [tab] expands to DEFAULT?
Previous Message Tomas Vondra 2019-06-18 21:43:13 O(N^2) when building multi-column MCV lists