Postgresql - Segmentation fault (core dumped) I'm working on postgresql code (server side).
I installed a version from source code following the official tutorial:
http://www.postgresql.org/docs/8.4/interactive/install-short.html

I did same modification on code, so I need to install again postgresql, but this time my version.

I renamed the /usr/local/pgsql/ in /usr/local/pgsql2/ and I did:

make distclean
./configure
make
sudo make install
sudo mkdir /usr/local/pgsql/data
sudo chown darkcoffeelinux /usr/local/pgsql/data


until now everything went well, but with the command

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/


I got this error:

The files belonging to this database system will be owned by user "darkcoffeelinux".
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".

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 24MB
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... ok
initializing pg_authid ... Segmentation fault (core dumped)
child process exited with exit code 139
initdb: removing contents of data directory "/usr/local/pgsql/data"


Additional information: I'm using kubuntu, postgresql 8.4.15
I think the permissions are correct because otherwise you wouldn't have gotten here.

My guess is that a modification you have made has caused the problem.  This is particularly the case given that it is a segmentation fault.  What you really need to do is look at the call stack at the time the core was dumped and see if you can isolate where in the code this is happening, and then back track to see what modifications you have made may have caused this.  Given that you have modified the code, the first step is to check and see if you can reproduce as kgrittn says, but I am willing to bet that this will only show up with your modified code.

The next step is likely to be to run initdb inside a debugger and review the conditions at time of crash.  At this point standard C debugging practices are really your best bet.