Issue Details (XML | Word | Printable)

Key: PCC-252
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Igor Zinovik
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

pcc -current (22 feb 2011) fails to compile PostgreSQL 9.0.3 on OpenBSD/i386 -current

Created: 22/Feb/11 09:12 PM   Updated: 28/Apr/11 08:13 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File aset.c (36 kB)
2. File dependency.c (80 kB)
3. File fmgroids.h (55 kB)
4. File noblock.c (1 kB)
5. File pg_proc.h (413 kB)
6. File plperl.c (87 kB)
7. File postinit.c (30 kB)

Environment: pcc 1.1.0.DEVEL 20110221 for i386-unknown-openbsd4.9


 Description  « Hide
I'm trying to compile PostgreSQL database server 9.0.3 on OpenBSD/i386 -current.

I'm trying to compile PostrgreSQL using OpenBSD ports framework. PostgreSQL port
has some patches for database server itself, but files dependency.c and pf_proc.h are NOT patched.

pcc fails with following message:
/usr/local/bin/pcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/include/kerberosV -c -o dependency.o dependency.c
../../../src/include/catalog/pg_proc.h:4654: error: out of macro space!


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 26/Feb/11 07:38 AM
Can you please recheck this with latest cpp sources? I have just checked in a fix for memory leakage in macro expansion.

Igor Zinovik added a comment - 26/Feb/11 10:20 AM
Several minutes ago I checked out pcc sources compiled and installed it.
It reports it self as:
pcc 1.1.0.DEVEL 20110221 for i386-unknown-openbsd4.9, zinovik@i386.zinovik.ru

DATESTAMP should be updated i think. But it still cannot compile PosgreSQL server 9.0.3:

/usr/local/bin/pcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -I../../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/include/kerberosV -c -o postinit.o postinit.c
../../../../src/include/utils/fmgroids.h:1852: error: out of macro space!

Igor Zinovik added a comment - 12/Mar/11 01:53 PM
Today i updated pcc to latest cvs snapshot:
pcc 1.1.0.DEVEL 20110221 for i386-unknown-openbsd4.9,

I think this commit fixed PostgreSQL compilation:
http://marc.info/?l=pcc-commit-list&m=129991444413548&w=2

But when i try to initialize directory that will hold data PostgreSQL crashes:
# sudo -u _postgresql initdb -D /var/postgresql/data -U postgres -A md5 -W
The files belonging to this database system will be owned by user "_postgresql".
This user must also own the server process.

The database cluster will be initialized with locale C.
The default database encoding has accordingly been set to SQL_ASCII.
The default text search configuration will be set to "english".

fixing permissions on existing directory /var/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 12MB
creating configuration files ... ok
creating template1 database in /var/postgresql/data/base/1 ... PANIC: invalid xlog info mask 01
Abort trap (core dumped)
child process exited with exit code 134
initdb: removing contents of data directory "/var/postgresql/data"

Anders Magnusson added a comment - 12/Mar/11 05:41 PM
I need help here to find what is failing, it is almost impossible for me to try to find out exactly why a specific program crashes.

Igor Zinovik added a comment - 19/Mar/11 02:12 PM
I compiled PostgreSQL server 9.0.3 with debugging symbols (-ggdb).
Now i want to initialize postgres directory where it will store all data.
# gdb -q /usr/local/bin/initdb
(gdb) run -D /var/postgresql/data -U postgres -A md5 -W
Starting program: /usr/local/bin/initdb -D /var/postgresql/data -U postgres -A md5 -W
The files belonging to this database system will be owned by user "_postgresql".
This user must also own the server process.

The database cluster will be initialized with locale C.
The default database encoding has accordingly been set to SQL_ASCII.
The default text search configuration will be set to "english".

fixing permissions on existing directory /var/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 20
selecting default shared_buffers ... 1600kB
creating configuration files ... ok
creating template1 database in /var/postgresql/data/base/1 ... PANIC: invalid xlog info mask 01
Abort trap (core dumped)

Program received signal SIGPIPE, Broken pipe.
0x00a84ec9 in write () from /usr/lib/libc.so.58.0
(gdb) bt full
#0 0x00a84ec9 in write () from /usr/lib/libc.so.58.0
No symbol table info available.
#1 0x00add9c4 in __swrite (cookie=0x20a70140,
    buf=0x8b291000 "insert OID = 303 ( float48gt 11 10 12 1 0 0 f f f t f i 2 0 16 \"700 701\" _null_ _null_ _null_ _null_ float48gt _null_ _null_ _null_ )\n\n)\n_ )\n )\nnull_ )\nnull_ )\n", n=134)
    at /home/src/lib/libc/stdio/stdio.c:66
No locals.
#2 0x00adcf9e in __sflush (fp=0x20a70140) at /home/src/lib/libc/stdio/fflush.c:79
        p = (
    unsigned char *) 0x8b291000 "insert OID = 303 ( float48gt 11 10 12 1 0 0 f f f t f i 2 0 16 \"700 701\" _null_ _null_ _null_ _null_ float48gt _null_ _null_ _null_ )\n\n)\n_ )\n )\nnull_ )\nnull_ )\n"
        n = 134
        t = Variable "t" is not available.
(gdb) disassemble
Dump of assembler code for function write:
0x00a84ec2 <write+0>: mov $0x4,%eax
0x00a84ec7 <write+5>: int $0x80
0x00a84ec9 <write+7>: jb 0xa84eac <mount+10>
0x00a84ecb <write+9>: ret
0x00a84ecc <write+10>: nop
0x00a84ecd <write+11>: nop
0x00a84ece <write+12>: nop
0x00a84ecf <write+13>: nop
End of assembler dump.

Igor Zinovik added a comment - 23/Apr/11 04:04 PM
pcc-current can not compile PostgreSQL 9.0.3 anymore:

/usr/local/bin/pcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -I../../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/include/kerberosV -c -o aset.o aset.c
aset.c, line 235: syntax error

Anders Magnusson added a comment - 25/Apr/11 01:32 PM - edited
Now this last bug should be fixed at least.

Igor Zinovik added a comment - 26/Apr/11 07:43 AM
It still fails (cvs updated, compiled with itself and installed):
/usr/local/bin/pcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
 -fno-strict-aliasing -fwrapv -fpic -DPIC -I. -I. -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/i
nclude -I/usr/local/include -I/usr/include/kerberosV -I/usr/libdata/perl5/i386-openbsd/5.12.2/CORE -c -o plperl.o
plperl.c
plperl.c, line 977: unknown structure/union/enum

This file is not pached by OpenBSD ports infrastructure.

Igor Zinovik added a comment - 27/Apr/11 07:32 AM
Updated pcc today:
# pcc -v
pcc 1.1.0.DEVEL 20110424 for i386-unknown-openbsd4.9, zinovik@i386.zinovik.ru

Today error message is:
...
/usr/local/bin/pcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -fpic -DPIC -I. -I. -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/include/kerberosV -I/usr/libdata/perl5/i386-openbsd/5.12.2/CORE -c -o plperl.o plperl.c
plperl.c, line 741: compiler error: usednodes == 1332, inlnodecnt 1328

Igor Zinovik added a comment - 27/Apr/11 07:46 AM
In previous comment i was wrong about DATESTAMP. Right now pcc
cannot compile itself:
...
/usr/local/bin/pcc -DLIBEXECDIR=\"/usr/local/libexec/\" -DGCC_COMPAT -DINCLUDEDIR=\"/usr/local/include/\" -DPCCINCDIR=\"/usr/local/lib/pcc/i386-unknown-openbsd4.9/1.1.0.DEVEL/include/\" -DPCCLIBDIR=\"/usr/local/lib/pcc/i386-unknown-openbsd4.9/1.1.0.DEVEL/lib/\" -Dos_openbsd -DTARGMACH=i386 -Dmach_i386 -I../.. -I../../os/openbsd -I../../mip -I../../arch/i386 -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wsign-compare -Wtruncate -c cc.c
/usr/include//stdio.h:377: warning: conversion to 'unsigned char' from 'int' may alter its value
cc.c, line 1230: compiler error: Coalesce: src class 2, dst class 1

Igor Zinovik added a comment - 27/Apr/11 12:08 PM
Here is latest news about this situtaion:
- PostgreSQL port was updated to 9.0.4
- first pcc (20110427) was builded with gcc 4.2.1
- then pcc builded itself
- then i tried to compile PostgreSQL 9.0.4

Here is what i got:
/usr/local/bin/pcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -I../../src/port -DFRONTEND -I../../src/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/include/kerberosV -c -o noblock.o noblock.c
noblock.c, line 31: compiler error: Coalesce: src class 1, dst class 2

noblock.c is not patched by ports infrastructure.

Igor Zinovik added a comment - 28/Apr/11 08:13 AM
% pcc -v
pcc 1.1.0.DEVEL 20110428 for i386-unknown-openbsd4.9, zinovik@i386.zinovik.ru

Still same error:
/usr/local/bin/pcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -fpic -DPIC -I. -I. -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/include/kerberosV -I/usr/libdata/perl5/i386-openbsd/5.12.2/CORE -c -o plperl.o plperl.c
plperl.c, line 977: unknown structure/union/enum
gmake[3]: *** [plperl.o] Error 1