Thread: Query about 'initdb' error

Query about 'initdb' error

From
"杨逸存"
Date:
Dear hacker:
    I am a student from Nanjing University. I have some troubles about command 'initdb'. After I modify sth about system catalog, I use initdb to init the database. But it caused this problem: 
    'performing post-bootstrap initialization ... Segmentation fault (core dumped)'
    'child process exited with exit code 139'
    
    When I do 'make' and 'make install', there is no warning or error infomation appeared. Compilation step seems to have no problem. Also, I use gdb to backtrace initdb, the result is as below:

performing post-bootstrap initialization ... Segmentation fault (core dumped)

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
    I am not able to fully recognize the insight of backtrace, but it's strange that it receives 'signal SIGPIPE, Broken pipe'.
    Looking forward to your reply. Yours sincerely.

Re: Query about 'initdb' error

From
Tom Lane
Date:
"=?gb18030?B?0e7S3bTm?=" <1057206466@qq.com> writes:
>     When I do 'make' and 'make install', there is no warning or error infomation appeared. Compilation step
seemsto have no problem. Also, I use gdb to backtrace initdb, the result is as below: 

> performing post-bootstrap initialization ... Segmentation fault (core dumped)
> Program received signal SIGPIPE, Broken pipe.

> I am not able to fully recognize the insight of backtrace, but it's
> strange that it receives 'signal SIGPIPE, Broken pipe'.   
> Looking forward to your reply. Yours sincerely.

At this phase, initdb is just shoving SQL commands down a pipe to a
"standalone backend" that's doing the real work.  Evidently your
backend dumped core, and you need to be looking at that dump not
initdb itself.  Depending on how your machine is set up, you might
need to use initdb's --noclean option to keep it from throwing away
the incomplete data directory, as the backend might have dropped core
in there.

            regards, tom lane