BUG #14334: vacuumdb.c build failure on openbsd

Started by Nonameover 9 years ago10 messagesbugs
Jump to latest
#1Noname
jungleboogie0+psql@gmail.com

The following bug has been logged on the website:

Bug reference: 14334
Logged by: sean farrell
Email address: jungleboogie0+psql@gmail.com
PostgreSQL version: 9.6rc1
Operating system: openbsd current
Description:

Hello,

I'm attempting to build postgresql on OpenBSD current with this config
option:
./configure --enable-cassert --enable-debug --with-perl \
--with-python --with-tcl --with-openssl --with-libxml \
--with-libxslt --with-includes=/usr/local/include

Here's part of the build where it fails:
gmake[5]: Entering directory '/home/sean/bin/postgres/src/backend'
gmake[5]: Nothing to be done for 'submake-errcodes'.
gmake[5]: Leaving directory '/home/sean/bin/postgres/src/backend'
gmake[4]: Leaving directory '/home/sean/bin/postgres/src/port'
/usr/local/bin/gmake -C ../../../src/common all
gmake[4]: Entering directory '/home/sean/bin/postgres/src/common'
/usr/local/bin/gmake -C ../backend submake-errcodes
gmake[5]: Entering directory '/home/sean/bin/postgres/src/backend'
gmake[5]: Nothing to be done for 'submake-errcodes'.
gmake[5]: Leaving directory '/home/sean/bin/postgres/src/backend'
gmake[4]: Leaving directory '/home/sean/bin/postgres/src/common'
/usr/local/bin/gmake -C ../../../src/fe_utils all
gmake[4]: Entering directory '/home/sean/bin/postgres/src/fe_utils'
gmake[4]: Nothing to be done for 'all'.
gmake[4]: Leaving directory '/home/sean/bin/postgres/src/fe_utils'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq
-I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include
-I/usr/local/include -c -o vacuumdb.o vacuumdb.c
vacuumdb.c:70: error: expected declaration specifiers or '...' before
'fd_set'
vacuumdb.c: In function 'main':
vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this
function)
vacuumdb.c:193: error: (Each undeclared identifier is reported only once
vacuumdb.c:193: error: for each function it appears in.)
vacuumdb.c: In function 'GetIdleSlot':
vacuumdb.c:733: error: 'fd_set' undeclared (first use in this function)
vacuumdb.c:733: error: expected ';' before 'slotset'
vacuumdb.c:734: warning: ISO C90 forbids mixed declarations and code
vacuumdb.c:740: warning: implicit declaration of function 'FD_ZERO'
vacuumdb.c:740: error: 'slotset' undeclared (first use in this function)
vacuumdb.c:745: warning: implicit declaration of function 'FD_SET'
vacuumdb.c:759: error: too many arguments to function 'select_loop'
vacuumdb.c:775: warning: implicit declaration of function 'FD_ISSET'
vacuumdb.c: At top level:
vacuumdb.c:870: error: expected declaration specifiers or '...' before
'fd_set'
vacuumdb.c: In function 'select_loop':
vacuumdb.c:873: error: 'fd_set' undeclared (first use in this function)
vacuumdb.c:873: error: expected ';' before 'saveSet'
vacuumdb.c:898: error: 'workerset' undeclared (first use in this function)
vacuumdb.c:898: error: 'saveSet' undeclared (first use in this function)
vacuumdb.c:899: warning: implicit declaration of function 'select'
gmake[3]: *** [<builtin>: vacuumdb.o] Error 1
gmake[3]: Leaving directory '/home/sean/bin/postgres/src/bin/scripts'
gmake[2]: *** [Makefile:40: all-scripts-recurse] Error 2
gmake[2]: Leaving directory '/home/sean/bin/postgres/src/bin'
gmake[1]: *** [Makefile:35: all-bin-recurse] Error 2
gmake[1]: Leaving directory '/home/sean/bin/postgres/src'
gmake: *** [GNUmakefile:11: all-src-recurse] Error 2
*** Error 2 in /home/sean/bin/postgres (Makefile:36 'all')

Vacuumdb.c was last updated earlier last month:
https://github.com/postgres/postgres/commits/master/src/bin/scripts/vacuumdb.c

Is there something I need to do differently to get Postgresql to build?

Currently installed:
# select version();
version
----------------------------------------------------------------------------------------------
PostgreSQL 10devel on i386-unknown-openbsd6.0, compiled by gcc (GCC) 4.2.1
20070719 , 32-bit

Thanks,
Sean

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Noname (#1)
Re: BUG #14334: vacuumdb.c build failure on openbsd

jungleboogie0+psql@gmail.com wrote:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq
-I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include
-I/usr/local/include -c -o vacuumdb.o vacuumdb.c
vacuumdb.c:70: error: expected declaration specifiers or '...' before
'fd_set'
vacuumdb.c: In function 'main':
vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this
function)

What does your select(2) manpage say about what includes are required?
My manpage says

/* According to POSIX.1-2001 */
#include <sys/select.h>

/* According to earlier standards */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

and we're not including <sys/select.h> anywhere that I can see;
apparently we should add something like

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3jungle Boogie
jungleboogie0@gmail.com
In reply to: Alvaro Herrera (#2)
Re: BUG #14334: vacuumdb.c build failure on openbsd

Hi Alvaro,
On 21 September 2016 at 10:57, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

jungleboogie0+psql@gmail.com wrote:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq
-I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include
-I/usr/local/include -c -o vacuumdb.o vacuumdb.c
vacuumdb.c:70: error: expected declaration specifiers or '...' before
'fd_set'
vacuumdb.c: In function 'main':
vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this
function)

What does your select(2) manpage say about what includes are required?
My manpage says

/* According to POSIX.1-2001 */
#include <sys/select.h>

/* According to earlier standards */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

http://man.openbsd.org/OpenBSD-current/man2/select.2

Also has #include <sys/select.h>

I'm checking out commit
https://github.com/postgres/postgres/commit/be7f7ee5ea73626c037600b515087e8f98038140

(day for the vacuum changes) to see if this will build. If not, maybe
it was a change within openbsd.

and we're not including <sys/select.h> anywhere that I can see;
apparently we should add something like

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: jungle Boogie (#3)
Re: BUG #14334: vacuumdb.c build failure on openbsd

jungle Boogie wrote:

http://man.openbsd.org/OpenBSD-current/man2/select.2

Also has #include <sys/select.h>

So "current" is 6.0? We don't have a lot of OpenBSD machines in the
buildfarm; would you be able to contribute one? The one we have
(curculio) runs 5.9 and has been running fine with the committed code.
https://wiki.postgresql.org/wiki/Buildfarm

It makes portability work easier if we see right away that a commit has
broken something.

Can you try HEAD with the following patch applied and let me know if it
works?

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

vacuumdb.patchtext/x-diff; charset=us-asciiDownload+4-0
#5jungle Boogie
jungleboogie0@gmail.com
In reply to: Alvaro Herrera (#4)
Re: BUG #14334: vacuumdb.c build failure on openbsd

Hi Alvaro,
On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

jungle Boogie wrote:

http://man.openbsd.org/OpenBSD-current/man2/select.2

Also has #include <sys/select.h>

So "current" is 6.0? We don't have a lot of OpenBSD machines in the
buildfarm; would you be able to contribute one? The one we have
(curculio) runs 5.9 and has been running fine with the committed code.
https://wiki.postgresql.org/wiki/Buildfarm

6.0 is a release version and will only receive patches for the base OS.

-current/snapshot is what I'm running and it's the development version
of openbsd. In a few months, current will be marked and released as
6.1. Basically I'm following the development branch of OpenBSD:
http://www.openbsd.org/faq/current.html

It makes portability work easier if we see right away that a commit has
broken something.

Can you try HEAD with the following patch applied and let me know if it
works?

I wrote to the maintainer of postgresql on openbsd and asked if he
could take a look at this email and see if he can reproduce the
problem.

Meanwhile, I came across this.
It looks like 8 days ago select.h was modified, but I have no idea if
this is causing the postgresql failure.
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/select.h

I will checkout buildfarm and see what it takes to run it!

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#6Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: jungle Boogie (#5)
Re: BUG #14334: vacuumdb.c build failure on openbsd

jungle Boogie wrote:

Hi Alvaro,
On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

So "current" is 6.0? We don't have a lot of OpenBSD machines in the
buildfarm; would you be able to contribute one? The one we have
(curculio) runs 5.9 and has been running fine with the committed code.
https://wiki.postgresql.org/wiki/Buildfarm

6.0 is a release version and will only receive patches for the base OS.

I see.

-current/snapshot is what I'm running and it's the development version
of openbsd. In a few months, current will be marked and released as
6.1. Basically I'm following the development branch of OpenBSD:
http://www.openbsd.org/faq/current.html

I think it'd be valuable to have a system running something that tracks
"current"; we already have a few "rolling" Linux distros and this seems
similar in spirit. It might even provide more feedback for those crazy
patches ...

Can you try HEAD with the following patch applied and let me know if it
works?

I wrote to the maintainer of postgresql on openbsd and asked if he
could take a look at this email and see if he can reproduce the
problem.

Good.

Meanwhile, I came across this.
It looks like 8 days ago select.h was modified, but I have no idea if
this is causing the postgresql failure.
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/select.h

Sounds very likely to me.

I will checkout buildfarm and see what it takes to run it!

Great. It's just a cron Perl script that builds Postgres and runs the
tests (plus a commitment that you'll give a look in case things fail for
odd reasons. We try not to bother you if your animal finds portability
issues in Postgres.)

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#7jungle Boogie
jungleboogie0@gmail.com
In reply to: Alvaro Herrera (#4)
Re: BUG #14334: vacuumdb.c build failure on openbsd

On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

Can you try HEAD with the following patch applied and let me know if it
works?

Your patch works!!

You probably made the patch on a Windows system because there were ^M
characters but I copied your three lines to vacuumdb.c and recompiled.

Is there a method to report the exact git commit postgresql is running?

--
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#8Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: jungle Boogie (#7)
Re: BUG #14334: vacuumdb.c build failure on openbsd

jungle Boogie wrote:

On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

Can you try HEAD with the following patch applied and let me know if it
works?

Your patch works!!

You probably made the patch on a Windows system because there were ^M
characters but I copied your three lines to vacuumdb.c and recompiled.

Windows!?!? I haven't touched that in two decades now (oh my). I just
":read" the patch file into the email body instead of using an
attachment. I got lazy there, sorry about that.

Anyway thanks for following up. I will push this, probably tomorrow.

Is there a method to report the exact git commit postgresql is running?

Not that I know of.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#9Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Alvaro Herrera (#8)
Re: BUG #14334: vacuumdb.c build failure on openbsd

Alvaro Herrera wrote:

jungle Boogie wrote:

On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

Can you try HEAD with the following patch applied and let me know if it
works?

Your patch works!!

You probably made the patch on a Windows system because there were ^M
characters but I copied your three lines to vacuumdb.c and recompiled.

Anyway thanks for following up. I will push this, probably tomorrow.

It took me a few more days than I intended, which meant this missed
9.6.0, but it's out now.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#10jungle Boogie
jungleboogie0@gmail.com
In reply to: Alvaro Herrera (#9)
Re: BUG #14334: vacuumdb.c build failure on openbsd

On 26 September 2016 at 21:09, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

Alvaro Herrera wrote:

jungle Boogie wrote:

On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

Can you try HEAD with the following patch applied and let me know if it
works?

Your patch works!!

You probably made the patch on a Windows system because there were ^M
characters but I copied your three lines to vacuumdb.c and recompiled.

Anyway thanks for following up. I will push this, probably tomorrow.

It took me a few more days than I intended, which meant this missed
9.6.0, but it's out now.

I don't know what the will mean in terms of the OpenBSD package/port
of it, but I'll let the maintainer know that it's now patched in
Postgres.

By the way, I updated to Postgres' master and installed without
problems. Thanks for quickly patching it!
I haven't forgotten about the buildfarm!

Best,
sean

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
-------
inum: 883510009027723
sip: jungleboogie@sip2sip.info

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs