Postgresql initdb - 分段错误(核心已转储)

Postgresql initdb - Segmentation fault (core dumped)

我对pgsql源代码做了一些修改,比如添加了一个新的系统目录。然后我想使用 initdb -D PG_DATA_PATH 初始化数据库。但是却遇到了这个问题:

The files belonging to this database system will be owned by user "pguser".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /home/pguser/Desktop/postgres/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... America/Los_Angeles
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... Segmentation fault (core dumped)
child process exited with exit code 139
initdb: removing data directory "/home/pguser/Desktop/postgres/data"

当我执行 makemake install 时,有 NO 个错误或警告。另外,我使用 gdb 回溯了 initdb 的执行:

Program received signal SIGPIPE, Broken pipe.
0x00007ffff7475224 in __GI___libc_write (fd=4, buf=0x555555838910, nbytes=71)
    at ../sysdeps/unix/sysv/linux/write.c:27
27  ../sysdeps/unix/sysv/linux/write.c: No such file or directory.
(gdb) bt
#0  0x00007ffff7475224 in __GI___libc_write (fd=4, buf=0x555555838910, 
    nbytes=71) at ../sysdeps/unix/sysv/linux/write.c:27
#1  0x00007ffff73f028d in _IO_new_file_write (f=0x555555828040, 
    data=0x555555838910, n=71) at fileops.c:1203
#2  0x00007ffff73f2021 in new_do_write (to_do=71, 
    data=0x555555838910 " * string literal (including a function body!) or a multiline comment.\n\n\n\nguage';\nge';\n;\n;\nrministic, collencoding, collcollate, collctype)VALUES (pg_nextoid('pg_catalog.pg_collation', 'oid', 'pg_cata"..., 
    fp=0x555555828040) at fileops.c:457
#3  _IO_new_do_write (fp=0x555555828040, 
    data=0x555555838910 " * string literal (including a function body!) or a multiline comment.\n\n\n\nguage';\nge';\n;\n;\nrministic, collencoding, collcollate, collctype)VALUES (pg_nextoid('pg_catalog.pg_collation', 'oid', 'pg_cata"..., 
    to_do=71) at fileops.c:433
#4  0x00007ffff73ef858 in _IO_new_file_sync (fp=0x555555828040)
    at fileops.c:813
#5  0x00007ffff73e395d in __GI__IO_fflush (fp=0x555555828040) at iofflush.c:40
#6  0x000055555555d5ec in setup_dictionary (cmdfd=0x555555828040)
    at initdb.c:1675
#7  0x000055555555f838 in initialize_data_directory () at initdb.c:2909
#8  0x0000555555560234 in main (argc=3, argv=0x7fffffffded8) at initdb.c:3228

这个故障的潜在原因是什么???? SIGPIPE信号???希望有人能帮助我!!!谢谢。

您有来自错误进程的核心转储。

initdb 以独立模式启动 PostgreSQL 服务器并将目录内容通过管道传输给它。现在您正在编写的数据中的某些内容是错误的,并且独立的后端退出。然后 initdb 如果它写入管道并崩溃,则会得到一个 SIGPIPE。

您想调试 PostgreSQL 服务器,而不是 initdb