Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
699 stars 145 forks source link

write_filesystem failing with python3.6 #195

Closed df7cb closed 4 years ago

df7cb commented 6 years ago

The write_filesystem test is failing with python3.6 (all PostgreSQL versions affected where the test is run):

$ diff -u test-3.6/expected/write_filesystem_1.out results/write_filesystem.out 
--- test-3.6/expected/write_filesystem_1.out    2017-10-22 14:44:24.792671522 +0200
+++ results/write_filesystem.out    2017-10-22 15:01:44.736722457 +0200
@@ -143,45 +143,39 @@
 -- Insertion with incoherent filename/properties (should fail)
 INSERT INTO testmulticorn (color, size, name, ext, data, filename) VALUES ('blue', 'big', 'triangle', 'txt', 'Im a big blue triangle',
         'blue/small/triangle.txt');
-psql:test-common/multicorn_testfilesystem.include:28: ERROR:  The columns inferred from the filename do not match the supplied columns.
-HINT:  Remove either the filename column or the properties column from your  statement, or ensure they match
 -- Insertion with missing keys (should fail)
 INSERT INTO testmulticorn (color, size, name) VALUES ('blue', 'small', 'triangle');
-psql:test-common/multicorn_testfilesystem.include:31: ERROR:  The following columns are necessary: {'ext'}
-HINT:  You can also insert an item by providing only the filename and content columns
 -- Insertion with missing keys and filename (should fail)
 INSERT INTO testmulticorn (color, size, name, filename) VALUES ('blue', 'small', 'triangle', 'blue/small/triangle.txt');
-psql:test-common/multicorn_testfilesystem.include:34: ERROR:  The following columns are necessary: {'ext'}
-HINT:  You can also insert an item by providing only the filename and content columns
 -- Insertion which would overwrite a file.
 -- Normal insertion
 INSERT INTO testmulticorn (color, size, name, ext, data) VALUES ('yellow', 'big', 'square', 'text', 'Im a duplicate big square');
-psql:test-common/multicorn_testfilesystem.include:38: ERROR:  Duplicate key value violates filesystem integrity.
-DETAIL:  Key (color, ext, name, size)=(yellow, text, square, big) already exists
 -- Should still have 11 lines by now.
 SELECT * from testmulticorn ORDER BY filename;
- color  | size  |   name   | ext  |        filename         |           data           
---------+-------+----------+------+-------------------------+--------------------------
- blue   | big   | round    | ini  | blue/big/round.ini      | Im a big blue round     +
-        |       |          |      |                         | 
- blue   | big   | square   | txt  | blue/big/square.txt     | Im a big blue square    +
-        |       |          |      |                         | 
- blue   | big   | triangle | txt  | blue/big/triangle.txt   | Im a big blue triangle
- blue   | small | round    | ini  | blue/small/round.ini    | Im a small blue round   +
-        |       |          |      |                         | 
- blue   | small | square   | txt  | blue/small/square.txt   | Im a small blue square  +
-        |       |          |      |                         | 
- red    | big   | round    | ini  | red/big/round.ini       | Im a big red round      +
-        |       |          |      |                         | 
- red    | big   | square   | txt  | red/big/square.txt      | Im a big red square     +
-        |       |          |      |                         | 
- red    | small | round    | ini  | red/small/round.ini     | Im a small red round    +
-        |       |          |      |                         | 
- red    | small | square   | txt  | red/small/square.txt    | Im a small red square   +
-        |       |          |      |                         | 
- yellow | big   | square   | text | yellow/big/square.text  | Im a big yellow square
- yellow | small | square   | txt  | yellow/small/square.txt | Im a small yellow square
-(11 rows)
+ color  | size  |   name   | ext  |         filename         |           data            
+--------+-------+----------+------+--------------------------+---------------------------
+ blue   | big   | round    | ini  | blue/big/round.ini       | Im a big blue round      +
+        |       |          |      |                          | 
+ blue   | big   | square   | txt  | blue/big/square.txt      | Im a big blue square     +
+        |       |          |      |                          | 
+ blue   | big   | triangle | txt  | blue/big/triangle.txt    | Im a big blue triangle
+ blue   | small | round    | ini  | blue/small/round.ini     | Im a small blue round    +
+        |       |          |      |                          | 
+ blue   | small | square   | txt  | blue/small/square.txt    | Im a small blue square   +
+        |       |          |      |                          | 
+ blue   | small | triangle | None | blue/small/triangle.None | 
+ blue   | small | triangle | txt  | blue/small/triangle.txt  | 
+ red    | big   | round    | ini  | red/big/round.ini        | Im a big red round       +
+        |       |          |      |                          | 
+ red    | big   | square   | txt  | red/big/square.txt       | Im a big red square      +
+        |       |          |      |                          | 
+ red    | small | round    | ini  | red/small/round.ini      | Im a small red round     +
+        |       |          |      |                          | 
+ red    | small | square   | txt  | red/small/square.txt     | Im a small red square    +
+        |       |          |      |                          | 
+ yellow | big   | square   | text | yellow/big/square.text   | Im a duplicate big square
+ yellow | small | square   | txt  | yellow/small/square.txt  | Im a small yellow square
+(13 rows)

 -- Test insertion in transaction
 BEGIN;
[...]

(#183 is also about problems with python3.6, but there it seems to be a crash, not here)

df7cb commented 5 years ago

... still a problem with python3.7.

Is this extension still maintained?

galuszkak commented 5 years ago

@ChristophBerg I will be looking on this in next week.

eloyfelix commented 5 years ago

any news on this and #183 issues?

I'm experiencing the same problems when compiling my own python3(3.6.0, 3.7.2 and 3.7.3) and postgresql(10.7 compiled with py3) with multicorn 1.3.4.

First 4 tests pass and last 7 fail.

============== dropping database "regression"         ==============
NOTICE:  database "regression" does not exist, skipping
DROP DATABASE
============== creating database "regression"         ==============
CREATE DATABASE
ALTER DATABASE
============== installing plpgsql                     ==============
CREATE LANGUAGE
============== running regression test queries        ==============
test multicorn_cache_invalidation ... ok
test multicorn_column_options_test ... ok
test multicorn_error_test     ... 2019-04-06 23:35:35.949 UTC [69] ERROR:  The wrapper parameter is mandatory, specify a valid class name
2019-04-06 23:35:35.949 UTC [69] STATEMENT:  CREATE server multicorn_srv foreign data wrapper multicorn;
2019-04-06 23:35:35.981 UTC [69] ERROR:  Cannot set the wrapper class on the table
2019-04-06 23:35:35.981 UTC [69] HINT:  Set it on the server
2019-04-06 23:35:35.981 UTC [69] STATEMENT:  CREATE foreign table testmulticorn (
        test1 character varying,
        test2 character varying
    ) server multicorn_srv options (
        option1 'option1',
        wrapper 'multicorn.evilwrapper.EvilDataWrapper'
    );
2019-04-06 23:35:35.986 UTC [69] ERROR:  The wrapper parameter is mandatory, specify a valid class name
2019-04-06 23:35:35.986 UTC [69] STATEMENT:  ALTER server multicorn_srv options (DROP wrapper);
2019-04-06 23:35:35.987 UTC [69] ERROR:  The wrapper parameter is mandatory, specify a valid class name
2019-04-06 23:35:35.987 UTC [69] STATEMENT:  CREATE server multicorn_empty_srv foreign data wrapper multicorn;
ok
test multicorn_logger_test    ... 2019-04-06 23:35:36.073 UTC [73] WARNING:  An error is about to occur
2019-04-06 23:35:36.073 UTC [73] ERROR:  An error occured
2019-04-06 23:35:36.073 UTC [73] STATEMENT:  select * from testmulticorn;
ok
test multicorn_planner_test   ... 2019-04-06 23:35:36.456 UTC [9] LOG:  server process (PID 77) was terminated by signal 11: Segmentation fault
2019-04-06 23:35:36.456 UTC [9] DETAIL:  Failed process was running: explain select * from testmulticorn;
2019-04-06 23:35:36.456 UTC [9] LOG:  terminating any other active server processes
2019-04-06 23:35:36.461 UTC [14] WARNING:  terminating connection because of crash of another server process
2019-04-06 23:35:36.461 UTC [14] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2019-04-06 23:35:36.461 UTC [14] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2019-04-06 23:35:36.464 UTC [9] LOG:  all server processes terminated; reinitializing
2019-04-06 23:35:36.496 UTC [81] LOG:  database system was interrupted; last known up at 2019-04-06 23:35:35 UTC
FAILED (test process exited with exit code 2)
test multicorn_regression_test ... 2019-04-06 23:35:36.528 UTC [84] FATAL:  the database system is in recovery mode
FAILED (test process exited with exit code 2)
test multicorn_sequence_test  ... 2019-04-06 23:35:36.588 UTC [90] FATAL:  the database system is in recovery mode
FAILED (test process exited with exit code 2)
test multicorn_test_date      ... 2019-04-06 23:35:36.651 UTC [96] FATAL:  the database system is in recovery mode
FAILED (test process exited with exit code 2)
test multicorn_test_dict      ... 2019-04-06 23:35:36.706 UTC [102] FATAL:  the database system is in recovery mode
FAILED (test process exited with exit code 2)
test multicorn_test_list      ... 2019-04-06 23:35:36.720 UTC [108] FATAL:  the database system is in recovery mode
FAILED (test process exited with exit code 2)
test multicorn_test_sort      ... 2019-04-06 23:35:36.760 UTC [114] FATAL:  the database system is in recovery mode
FAILED (test process exited with exit code 2)

=======================
 7 of 11 tests failed.
=======================

The differences that caused some tests to fail can be viewed in the
file "/home/postgres/Multicorn-1.3.4/regression.diffs".  A copy of the test summary that you see
above is saved in the file "/home/postgres/Multicorn-1.3.4/regression.out".
rdunklau commented 4 years ago

Should be fixed.