pg.ddx.io pgsql-ports@postgresql.org mailing list archive
help / color / mirror / Atom feedmemcpy SEGV on AIX 5.3
3+ messages / 3 participants
[nested] [flat]
* memcpy SEGV on AIX 5.3
@ 2005-10-24 22:17 Seneca Cunningham <scunning@ca.afilias.info>
2005-10-25 18:39 ` Re: memcpy SEGV on AIX 5.3 Stefan Kaltenbrunner <mm-mailinglist@madness.at>
0 siblings, 1 reply; 3+ messages in thread
From: Seneca Cunningham @ 2005-10-24 22:17 UTC (permalink / raw)
To: pgsql-hackers@postgresql.org; +Cc: pgsql-ports
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)
inline patch 1: dynahash.c (+5/-1 lines) download inline-1.patch
--- 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: memcpy SEGV on AIX 5.3
2005-10-24 22:17 memcpy SEGV on AIX 5.3 Seneca Cunningham <scunning@ca.afilias.info>
@ 2005-10-25 18:39 ` Stefan Kaltenbrunner <mm-mailinglist@madness.at>
2005-10-26 07:02 ` Re: memcpy SEGV on AIX 5.3 Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kaltenbrunner @ 2005-10-25 18:39 UTC (permalink / raw)
To: Seneca Cunningham <scunning@ca.afilias.info>; +Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Seneca Cunningham wrote:
> 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.
looks like I'm seeing a similiar problem(using -HEAD) on AIX 5.3ML3
using the IBM AIX c-compiler. initdb just hangs after "selecting default
max_connections ..." in a 100% CPU-loop.
Stefan
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: memcpy SEGV on AIX 5.3
2005-10-24 22:17 memcpy SEGV on AIX 5.3 Seneca Cunningham <scunning@ca.afilias.info>
2005-10-25 18:39 ` Re: memcpy SEGV on AIX 5.3 Stefan Kaltenbrunner <mm-mailinglist@madness.at>
@ 2005-10-26 07:02 ` Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kaltenbrunner @ 2005-10-26 07:02 UTC (permalink / raw)
To: PostgreSQL-development <pgsql-hackers@postgresql.org>; +Cc: Seneca Cunningham <scunning@ca.afilias.info>
Stefan Kaltenbrunner wrote:
> Seneca Cunningham wrote:
>
>>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.
>
>
> looks like I'm seeing a similiar problem(using -HEAD) on AIX 5.3ML3
> using the IBM AIX c-compiler. initdb just hangs after "selecting default
> max_connections ..." in a 100% CPU-loop.
yeah this seems to be the very same issue. A backtrace of a stuck
initdb-process looks like:
(gdb) bt
#0 0x10006f10 in bcopy ()
#1 0x1001d398 in hash_search (hashp=0x1001d85c, keyPtr=0xf020f9fc,
action=804399456, foundPtr=0x20029d78 "")
at dynahash.c:673
#2 0x100a5e58 in formrdesc (relationName=0x2006bf38 "t\emplat\e1",
relationReltype=0, hasoids=0 '\0', natts=0,
att=0x200100f8) at relcache.c:1295
#3 0x100a818c in RelationCacheInitialize () at relcache.c:2160
#4 0x102016ec in InitPostgres (dbname=0xd025b7f0 "\200A", username=0x2
"") at postinit.c:424
#5 0x102009e8 in BootstrapMain (argc=271528, argv=0xb0002) at
bootstrap.c:445
#6 0x10000578 in main (argc=0, argv=0x0) at main.c:285
#7 0x1000022c in __start ()
Stefan
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-10-26 07:02 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-24 22:17 memcpy SEGV on AIX 5.3 Seneca Cunningham <scunning@ca.afilias.info>
2005-10-25 18:39 ` Stefan Kaltenbrunner <mm-mailinglist@madness.at>
2005-10-26 07:02 ` Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox