PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

Post by Kenji Sugi » Thu, 03 Jul 2003 15:49:19



It seems that a value of addr->ai_socktype returned by getaddrinfo in
pg_stat.c is not SOCK_DGRAM.

Kenji Sugita                                      

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command

 
 
 

PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

Post by Bruce Momji » Thu, 03 Jul 2003 23:06:54


I don't see any pg_stat.c in the source tree.  Can you show us the exact
line, and perhaps the failure.

---------------------------------------------------------------------------


> It seems that a value of addr->ai_socktype returned by getaddrinfo in
> pg_stat.c is not SOCK_DGRAM.

> Kenji Sugita                                      

> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command


--
  Bruce Momjian                        |  http://candle.pha.pa.us

  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

 
 
 

PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

Post by Kurt Roec » Fri, 04 Jul 2003 02:18:17



> I don't see any pg_stat.c in the source tree.  Can you show us the exact
> line, and perhaps the failure.

He means pgstat.c of course.

Kurt

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command

 
 
 

PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

Post by Kurt Roec » Fri, 04 Jul 2003 02:20:11



> It seems that a value of addr->ai_socktype returned by getaddrinfo in
> pg_stat.c is not SOCK_DGRAM.

What system are you running on, and does it have a getaddrinfo()
or not?

If I tell getaddrinfo() it should return a SOCK_DGRAM, it can
only mean that getaddrinfo() is broken.

Kurt

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

 
 
 

PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

Post by Kurt Roec » Fri, 04 Jul 2003 03:52:00




> > It seems that a value of addr->ai_socktype returned by getaddrinfo in
> > pg_stat.c is not SOCK_DGRAM.

> What do you base this on?

> My guess is that it returns an ipv6 address while you do not have
> IPv6 support in the kernel.  If that is the case, the attached
> patch should fix it.

Oops typo, fixed in new attachment.

Kurt

  pgstat.diff
< 1K Download

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

 
 
 

PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

Post by Kurt Roec » Fri, 04 Jul 2003 03:35:00



> It seems that a value of addr->ai_socktype returned by getaddrinfo in
> pg_stat.c is not SOCK_DGRAM.

What do you base this on?

My guess is that it returns an ipv6 address while you do not have
IPv6 support in the kernel.  If that is the case, the attached
patch should fix it.

Kurt

  pgstat.diff
< 1K Download

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

 
 
 

PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

Post by Kenji Sugi » Fri, 04 Jul 2003 10:57:15





Date: Wed, 2 Jul 2003 19:20:11 +0200

;;; What system are you running on, and does it have a getaddrinfo()
;;; or not?

Red Hat Linux and Mac OS X 10.2.6. Both nm libc display getaddrinfo as follows:

$ nm /lib/libc.so.6 | grep getaddrinfo
0009fe3c T getaddrinfo
$

$ nm /usr/lib/libc.dylib | grep getaddrinfo
/usr/lib/libc.dylib(getaddrinfo.o):
90037dc0 T _getaddrinfo
         U _getaddrinfo
$

;;; If I tell getaddrinfo() it should return a SOCK_DGRAM, it can
;;; only mean that getaddrinfo() is broken.

What value shuld be passed to a following socket call with addr->ai_socktype?

====  pgstats.c  ====
        if ((pgStatSock = socket(addr->ai_family,
                addr->ai_socktype, addr->ai_protocol)) < 0)
        {
                elog(LOG, "PGSTAT: socket() failed: %m");
                goto startup_failed;
        }


Subject: Re: [HACKERS] PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument
Date: Wed, 2 Jul 2003 20:52:00 +0200



;;; > > It seems that a value of addr->ai_socktype returned by getaddrinfo in
;;; > > pg_stat.c is not SOCK_DGRAM.
;;; >
;;; > What do you base this on?

Red Hat Linux 6.2 base.

    $ uname -rs  
    Linux 2.2.18-0ph1smp
    $

For Mac OS X it produces LOG:  PGSTAT: socket() failed: Protocol not supported.

;;; > My guess is that it returns an ipv6 address while you do not have
;;; > IPv6 support in the kernel.  If that is the case, the attached
;;; > patch should fix it.
;;; >
;;;
;;; Oops typo, fixed in new attachment.

I tried it for current build.

Index: postmaster/pgstat.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/pgstat.c,v
retrieving revision 1.37
diff -u -r1.37 pgstat.c
--- postmaster/pgstat.c 12 Jun 2003 07:36:51 -0000      1.37

        /*
         * Create the UDP socket for sending and receiving statistic messages
         */
-       hints.ai_flags = AI_PASSIVE;
+       hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
        hints.ai_family = PF_UNSPEC;
        hints.ai_socktype = SOCK_DGRAM;
        hints.ai_protocol = 0;
$

And then:

$ postmaster (on Red Hat)
...
2003-07-03 10:19:38 [29761] LOG:  XX000: PGSTAT: getaddrinfo2() failed: Name or service not known
LOCATION:  pgstat_init, pgstat.c:193
...

Kenji Sugita                                      

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

 
 
 

1. IpcMemoryCreate: shmget failed (Invalid argument)

I get this error when trying to start postgres with a block size > the
default of 64...


/usr/local/pgsql/data
IpcMemoryCreate: shmget failed (Invalid argument) key=5432001,
size=33652736, permission=600
This type of error is usually caused by an improper
shared memory or System V IPC semaphore configuration.
For more information, see the FAQ and platform-specific
FAQ's in the source directory pgsql/doc or on our
web site at http://www.postgresql.org.
FATAL 1:  ShmemCreate: cannot create region

I am running PG 7.03, and I assume that you'll want to need to know my
OS...


Linux roam 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown

(RedHat 6.2)

Thanks.

- JT
________________________________________
James Thornton, http://jamesthornton.com

2. MS Tech support recomends NOT using the ADO Ole DB controls

3. Distributed databases

4. IpcSemaphoreKill: ...) failed: Invalid argument

5. Normalisation tips

6. 7.4devel auth failed

7. Warning: Supplied argument is not a valid PostgreSQL link resource

8. Invalid Argument - openening a recordset

9. Invalid procedure call or argument MS Access on Win95

10. Error 3001: Invalid argument