When pgxc_ctl is called as described in the Pgxc_ctl Primer to create a stub config file it segfaults as the config produced is not coherent and verification seems to have a bug:
Reading symbols from pgxc_ctl...done.
(gdb) set args mypgxc_ctl.conf
(gdb) r
Starting program: /home/postgres/xc/bin/pgxc_ctl mypgxc_ctl.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
bash_handler.c:install_pgxc_ctl_bash(34) Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.
pgxc_ctl.c:build_configuration_path(232) ERROR: File "/home/postgres/pgxc_ctl/pgxc_ctl.conf" not found or not a regular file. No such file or directory
bash_handler.c:install_pgxc_ctl_bash(34) Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.
pgxc_ctl.c:read_configuration(254) Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.conf
pgxc_ctl.c:read_configuration(264) Finished to read configuration.
config.c:checkConfiguredAndSize(565) ERROR: Number of elements in datanode master definitions are different datanodeNames and datanodeMasterDirs. Check your configuration
config.c:verifyResource(925) ERROR: Found fundamental configuration error.
Program received signal SIGSEGV, Segmentation fault.
__strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:210
Also it seems 'prepare' command listed in the Primer example for pgxc_ctl is spurious as have no reflection in the code.
Cheers,
Krzysztof
Last edit: knienart 2014-10-29
This seems related to the variables that were deleted from the first version (I use trunk)
dnMstrDi=$HOME/pgxc/nodes/dn_master
dnSlvDir=$HOME/pgxc/nodes/dn_slave
dnALDir=$HOME/pgxc/nodes/datanode_archlog
these are undefined in the current version hence segfault.
So setting the variables creates fixes the template creation and I must rollback the statement from the issue description:
"Also it seems 'prepare' command listed in the Primer example for pgxc_ctl is spurious as have no reflection in the code." is not true after checking the code carefully. It is used.