Menu

#491 pgxc_ctl segfaults when run to get the config template

Development Queue
open
nobody
None
5
2015-02-03
2014-10-29
knienart
No

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

Discussion

  • knienart

    knienart - 2014-10-29
    (gdb) bt
    #0  __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:210
    #1  0x00000000004050b1 in checkResourceConflict (srcNames=srcNames@entry=0x42b912 "gtmProxyNames", 
        srcServers=srcServers@entry=0x42b92d "gtmProxyServers", srcPorts=srcPorts@entry=0x42b94a "gtmProxyPorts", srcPoolers=srcPoolers@entry=0x0, 
        srcDirs=srcDirs@entry=0x42b965 "gtmProxyDirs", destNames=destNames@entry=0x42bb09 "datanodeNames", 
        destServers=destServers@entry=0x42a36d "datanodeMasterServers", destPorts=destPorts@entry=0x42bb24 "datanodePorts", 
        destPoolers=destPoolers@entry=0x0, destDirs=destDirs@entry=0x42a3b1 "datanodeMasterDirs", destOnly=destOnly@entry=1, checkName=checkName@entry=1)
        at config.c:821
    #2  0x0000000000405f7b in verifyResource () at config.c:1001
    #3  0x0000000000407267 in check_configuration () at config.c:1083
    #4  0x00000000004035fd in main (argc=3, argv=0x7fffffffdf88) at pgxc_ctl.c:535
    
     

    Last edit: knienart 2014-10-29
  • knienart

    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.

     
  • knienart

    knienart - 2014-10-29

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.