Skip site navigation (1) Skip section navigation (2)

Re: Text search segmentation fault

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Tommy Gildseth <tommy(dot)gildseth(at)usit(dot)uio(dot)no>, General Postgres Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Text search segmentation fault
Date: 2009-01-29 17:05:19
Message-ID: 25986.1233248719@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Teodor Sigaev <teodor(at)sigaev(dot)ru> writes:
> Tom Lane wrote:
>> Hmm, seems it's not so much a "64 bit" error as a "signed vs unsigned
>> char" issue?  

> Yes, but I don't understand why it worked in 32-bit box.

You were casting to unsigned int.  So the offset added to the base
pointer for, say, 255 in the char would be equivalent to -1 on a 32-bit
box, or 0xFFFFFFFF on 64-bit.  The latter would likely provoke SIGSEGV
due to indexing out of the allocated process workspace, the former just
in scribbling on the byte adjacent to where it should have.  Still
broken, but not a segfault.

			regards, tom lane

In response to

pgsql-general by date

Next:From: Ivan Sergio BorgonovoDate: 2009-01-29 17:09:26
Subject: ssl to more than one server
Previous:From: Jason LongDate: 2009-01-29 17:04:17
Subject: Re: Pet Peeves?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group