Re: initdb SegFault

2019-11-19 Thread Kyotaro Horiguchi
At Tue, 19 Nov 2019 12:06:50 -0500, Tom Lane wrote in > Andres Freund writes: > > Agreed wrt this specific failure scenario. It does however seem not > > great that callsites for PQExpBuffer ought to check every call for > > allocation failures, in the general case. > > It is possible to check

Re: initdb SegFault

2019-11-19 Thread Tom Lane
Andres Freund writes: > Agreed wrt this specific failure scenario. It does however seem not > great that callsites for PQExpBuffer ought to check every call for > allocation failures, in the general case. It is possible to check just once at the end, using the PQExpBufferBroken API, and I believe

Re: initdb SegFault

2019-11-19 Thread Andres Freund
Hi, On 2019-11-19 10:16:02 -0500, Tom Lane wrote: > vignesh C writes: > > createPQExpBuffer allocates memory and returns the pointer, there is a > > possibility that createPQExpBuffer can return NULL pointer in case of > > malloc failiure, but initdb's main function does not check this > > condit

Re: initdb SegFault

2019-11-19 Thread Tom Lane
vignesh C writes: > createPQExpBuffer allocates memory and returns the pointer, there is a > possibility that createPQExpBuffer can return NULL pointer in case of > malloc failiure, but initdb's main function does not check this > condition. During malloc failure when pointer is accessed it result

initdb SegFault

2019-11-19 Thread vignesh C
Hi, While checking initdb code, I found one segmentation fault, stack trace for the same is: Core was generated by `./initdb -D data6'. Program terminated with signal 11, Segmentation fault. #0 0x0040ea22 in main (argc=3, argv=0x7ffc82237308) at initdb.c:3340 3340printf(_("\nSucce