Server Crash into contrib module ISN into 64bit OS

Поиск
Список
Период
Сортировка
От Rushabh Lathia
Тема Server Crash into contrib module ISN into 64bit OS
Дата
Msg-id 460abcb10811280419n2cdef3aeje04f04d543fc110f@mail.gmail.com
обсуждение исходный текст
Ответы Re: Server Crash into contrib module ISN into 64bit OS  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
<br clear="all" />Following test end up with the server crash into 8.4 cvs Head.<br /><br />uname -a<br />Linux
localhost.localdomain2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux<br /> <br
/>Testcasewith ISN contrib module:<br /> =========================<br /><br />CREATE OR REPLACE function
isbn_issn_proc()returns void as<br />$$<br />declare<br />v1 isbn;<br />BEGIN<br />        v1 :=
isbn_in('0-596-00270-x');<br/>END;<br />$$ LANGUAGE plpgsql;<br /><br /> select isbn_issn_proc();<br /><br
/>Analysis:<br/>=======<br /><br />Found that we are getting crash while doing the memcpy into datumCopy(). <br /><br
/>Datum<br />datumCopy(Datum value, bool typByVal, int typLen) <br />{ <br />... <br />       if
(DatumGetPointer(value)== NULL) <br />           return PointerGetDatum(NULL); <br /><br />       realSize =
datumGetSize(value,typByVal, typLen); <br /><br />       s = (char *) palloc(realSize); <br />       memcpy(s,
DatumGetPointer(value),realSize);  /* crash */<br />} <br /><br /> Actually we get crash while doing the
DatumGetPointer(),upon further investigation found that  in isbn_in() function we are using PG_RETURN_EAN13(), which
seemsto be returning the wrong address in case of 64bit OS.<br /><br />I was wondering that why its happening in PG
8.4;then found that we are having USE_FLOAT8_BYVAL into current version, because of the same not getting
correct/expectedDatum representation of the int64. <br /><br />postgres.h <br /><br />#ifdef USE_FLOAT8_BYVAL <br
/>#defineInt64GetDatum(X) ((Datum) SET_8_BYTES(X)) <br />#else <br />extern Datum Int64GetDatum(int64 X); <br />#endif
<br/><br />When I tried the same case with --disable-float8-byval option, test running as expected. <br /><br /><br
/><br/>Regards,<br />Rushabh Lathia<br /><br /><a href="http://www.EnterpriseDB.com">www.EnterpriseDB.com</a> 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Distinct types
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: HEAD build failure on win32 mingw