X-Original-To: pgsql-ports-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 57BE1DAD8C; Mon, 24 Oct 2005 19:17:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70911-07; Mon, 24 Oct 2005 22:17:05 +0000 (GMT) Received: from mail.libertyrms.com (unknown [207.219.45.62]) by svr1.postgresql.org (Postfix) with ESMTP id 1F907DADC2; Mon, 24 Oct 2005 19:17:02 -0300 (ADT) Received: from dev5.int.libertyrms.com ([10.1.3.42]) by mail.libertyrms.com with esmtp (Exim 4.22) id 1EUAcr-00004r-6R; Mon, 24 Oct 2005 18:17:05 -0400 Message-ID: <435D5D60.7040800@ca.afilias.info> Date: Mon, 24 Oct 2005 18:17:04 -0400 From: Seneca Cunningham User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Cc: pgsql-ports@postgresql.org Subject: memcpy SEGV on AIX 5.3 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: scunning@ca.afilias.info X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.531 required=5 tests=[FORGED_RCVD_HELO=0.05, INFO_TLD=0.481] X-Spam-Level: X-Archive-Number: 200510/15 X-Sequence-Number: 2231 On an powerPC AIX 5.3 box, initdb from 8.1beta4 segfaults at src/backend/utils/hash/dynahash.c:673. No segfaults occur and all 98 regression tests pass if a test is added to see if keycopy is memcpy and if it is, go through a loop memcpying one byte at a time instead of memcpying everything at once. Configuration details: -bash-2.05b$ gcc -v Using built-in specs. Target: powerpc-ibm-aix5.3.0.0 Configured with: /opt/src/gcc4/gcc-4.0.1/configure --prefix=/opt/dbs/gcc4 --enable-languages=c,c++ Thread model: aix gcc version 4.0.1 -bash-2.05b$ oslevel -r 5300-03 ./configure --prefix=/opt/dbs/pgsql81b4-afilias-AIX53-2005-10-24 --with-includes=/opt/freeware/include --enable-debug --enable-thread-safety --with-libraries=/opt/freeware/lib --enable-casert InitPostgres `-> RelationCacheInitialize `-> formrdesc `-> RelationCacheInsert `-> hash_search `-> keycopy (keycopy == memcpy) --- dynahash.c.orig 2005-10-14 22:49:33.000000000 -0400 +++ dynahash.c 2005-10-24 18:00:51.785106864 -0400 @@ -670,7 +670,14 @@ /* copy key into record */ currBucket->hashvalue = hashvalue; - hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize); + if (hashp->keycopy == memcpy) + { + int tempfoo; + for (tempfoo = 0; tempfoo < keysize; tempfoo++) + memcpy(ELEMENTKEY(currBucket)+tempfoo, keyPtr+tempfoo, 1); + } + else + hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize); /* caller is expected to fill the data field on return */ -- Seneca Cunningham scunning@ca.afilias.info