heterodb / pg-strom

PG-Strom - Master development repository
http://heterodb.github.io/pg-strom/
Other
1.3k stars 162 forks source link

[VTJ-JP]pg2arrow crashed when using smallint(?) #852

Open sakaik opened 1 week ago

sakaik commented 1 week ago

Summary

pg2arrowがSIGSEGVで落ちました。

実行コマンド

pg2arrow -u postgres -d db -t my_tmp_00122 -n12 -o my_tmp_00122.arrow

今回のケースでは -n6 まででは発生せずに、-n7 以降で発生しました。

テーブル構造

db=# \d my_tmp_00122 
           Unlogged table "public.my_tmp_00122"
 Column |       Type       | Collation | Nullable | Default 
--------+------------------+-----------+----------+---------
 id     | character(5)     |           |          | 
 no     | integer          |           |          | 
 nn     | smallint         |           |          | 
 nx     | smallint         |           |          | 
 ny     | smallint         |           |          | 
 gnx    | smallint         |           |          | 
 gny    | smallint         |           |          | 
 v1     | double precision |           |          | 
 v2     | double precision |           |          | 
 v3     | double precision |           |          | 
 v4     | real             |           |          | 
 v5     | real             |           |          | 

件数

db=# SELECT COUNT(*) FROM my_tmp_00122;
  count   
----------
 33554432

データ例

db=# SELECT * FROM my_tmp_00122 LIMIT 4;
  id   | no | nn | nx | ny | gnx  | gny |          v1          |          v2          |          v3         |     v4       |    v5   
-------+----+----+----+----+------+-----+----------------------+----------------------+---------------------+--------------+-----------
 00122 |  1 |  1 |  1 |  1 | 3713 | 129 | -0.28864785259643163 |  -0.4974168656284512 |  0.5514554344955545 | 0.0166009457 |  8.721273
 00122 |  2 |  2 |  1 |  1 | 3713 | 129 | -0.28673127018849698 |  -0.4936543956396634 | 0.45484039884633245 | 0.0266843003 |  9.325415
 00122 |  3 |  3 |  1 |  1 | 3713 | 129 | -0.28557772714547248 |  -0.4902515150830255 |  0.3574342124475877 | 0.0319896682 |  9.032224
 00122 |  4 |  4 |  1 |  1 | 3713 | 129 |  -0.2852518165748367 | -0.48714499157969366 |  0.2604573805338721 | 0.0460765397 |  9.515858

coredumpのbt

(gdb) bt
#0  0x000000000041c0f9 in move_int16_value (dest=0x7fb1340145a0, src=<optimized out>, sindex=2098172) at arrow_pgsql.c:673
#1  0x000000000040460d in sql_field_move_value (index=2098172, src=0x7fb1200145a0, dest=0x7fb1340145a0) at arrow_ipc.h:179
#2  mergeArrowChunkOneRow (src_index=<optimized out>, src_table=<optimized out>, dst_table=<optimized out>) at sql2arrow.c:1320
#3  sql2arrow_common (sqldb_conn=sqldb_conn@entry=0x7fb13400ae50, worker_id=worker_id@entry=6) at sql2arrow.c:1406
#4  0x0000000000405d7d in worker_main (__worker_id=0x6) at sql2arrow.c:1478
#5  0x00007fb143eb91ca in start_thread () from /lib64/libpthread.so.0
#6  0x00007fb143b25e73 in clone () from /lib64/libc.so.6

その他