Re: fgets failure in Solaris after patching

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Stephan, Richard" <RStephan(at)nyiso(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: fgets failure in Solaris after patching
Date: 2012-07-27 19:25:08
Message-ID: 9403.1343417108@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Stephan, Richard" <RStephan(at)nyiso(dot)com> writes:
> More information (9.0.8):

> $ pg_ctl start
> Killed
> fgets failure: Error 0
> The program "postgres" is needed by pg_ctl but was not found in the
> same directory as "/opt/postgres/9.0/bin/pg_ctl".
> Check your installation.

> $ postgres -V
> ld.so.1: postgres: fatal: libc.so.1: version `SUNW_1.22.7' not found (required by file /opt/postgres/9.0/bin/postgres)
> ld.so.1: postgres: fatal: /usr/lib/libc.so.1: wrong ELF class: ELFCLASS32
> Killed

Ah-hah, so your problem is a library mismatch between where you compiled
postgres and where you're trying to run it.

This is not the first time we've had to suggest that people run
"postgres -V" manually to debug a problem. I see that find_other_exec()
intentionally routes the stderr output of that to /dev/null:

snprintf(cmd, sizeof(cmd), "\"%s\" -V 2>%s", retpath, DEVNULL);

It strikes me that this is just a damfool idea. Generally there should
be no stderr output, and if there is some, hiding it from the user is
not helpful. Does anyone object to removing that redirection?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hartrc 2012-07-27 19:30:14 Postgresql Developer Privileges
Previous Message Ing.Edmundo.Robles.Lopez 2012-07-27 18:29:32 Re: REINDEX and COPY is wainting since Jun 21!

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Creager 2012-07-27 20:05:31 Build failures with Mountain Lion
Previous Message Stephan, Richard 2012-07-27 18:13:05 Re: fgets failure in Solaris after patching