/ Zope / Apsis / Pound Mailing List / Archive / 2006 / 2006-02 / problems compiling pound 2.0

[ << ] [ >> ]

[ segfault in svc.c if no session regex / Zed Shaw ... ] [ Pound now available as solaris pkg / alessio ... ]

problems compiling pound 2.0
Alessio Cervellin <a.cervellin(at)acm.org>
2006-02-05 17:40:30 [ FULL ]
I was succesfully compiling Pound 1.9 (on solaris), but Pound 2.0 now
gives the following problem:

gcc -DF_CONF=\"/opt/csw/etc/pound.cfg\" -DVERSION=\"`cat VERSION`\"
-mcpu=v8 -D_REENTRANT -pthreads -DUPER -DNEED_STACK
-DHAVE_SYSLOG_H=1 -DMISS_FACILITYNAMES -I/opt/csw/include  -D_REENTRANT
-D_THREAD_SAFE -Wstrict-prototypes -pipe   -c -o
  pound.o pound.c
In file included from pound.c:249:
pound.h:292: error: parse error before numeric constant

Similar error using the Sun C compiler too:

cc -DF_CONF=\"/opt/csw/etc/pound.cfg\" -DVERSION=\"`cat VERSION`\"
-xarch=v8 -D_REENTRANT  -DUPER -DNEED_STACK -DHAVE_SY
SLOG_H=1 -DMISS_FACILITYNAMES -I/opt/csw/include  -D_REENTRANT
-D_THREAD_SAFE   -c -o pound.o pound.c
"pound.h", line 292: syntax error before or at: 4
cc: acomp failed for pound.c

Any clue?

Thanks,
Alessio.

Re: [Pound Mailing List] problems compiling pound 2.0
"Sergio Freire" <etfreire(at)ua.pt>
2006-02-05 20:45:08 [ FULL ]
Hi,
are you using 2.0 final?
About GCC and CC, which versions are you using?
Regards,
Sergio Freire

----- Original Message ----- 
From: "Alessio Cervellin" <a.cervellin(at)acm.org>
To: <pound(at)apsis.ch>
Sent: Sunday, February 05, 2006 4:40 PM
Subject: [Pound Mailing List] problems compiling pound 2.0

[...]

Re: [Pound Mailing List] problems compiling pound 2.0
"Sergio Freire" <etfreire(at)ua.pt>
2006-02-05 20:59:04 [ FULL ]
After a search on the net, it seems that in your OS you might have some 
variable like S_HEADER defined elsewhere.
Do a test: change S_HEADER to S_HEADERX in  config.c, pound.h and svc.c.. 
Try to compile it again and please post the results.
Regards,
Sergio Freire


----- Original Message ----- 
From: "Alessio Cervellin" <a.cervellin(at)acm.org>
To: <pound(at)apsis.ch>
Sent: Sunday, February 05, 2006 4:40 PM
Subject: [Pound Mailing List] problems compiling pound 2.0

[...]

Re: [Pound Mailing List] problems compiling pound 2.0
Alessio Cervellin <a.cervellin(at)acm.org>
2006-02-05 22:15:55 [ FULL ]
Sergio Freire ha scritto:[...]

i tried bu that error is still there:

bash-3.00$ grep S_HE *
config.c:                svc->sess_type = S_HEADERX;
config.c:            if(svc->sess_type != S_COOKIE &&
svc->sess_type != 
S_PARM && svc->sess_type != S_HEADERX) {
config.c:            if((svc->sess_type == S_COOKIE || svc->sess_type == 
S_PARM || svc->sess_type == S_HEADERX)
config.c:            } else if(svc->sess_type == S_HEADERX) {
pound.h:typedef enum    { S_NONE, S_IP, S_COOKIE, S_PARM, S_HEADERX, 
S_BASIC }   SESS_TYPE;
svc.c:    /* this will match S_COOKIE, S_HEADERX and S_BASIC */
svc.c:        /* this works for S_BASIC, S_HEADERX and S_COOKIE */

bash-3.00$ gmake
cc -DF_CONF=\"/opt/csw/etc/pound.cfg\" -DVERSION=\"`cat VERSION`\" 
-xarch=v8 -D_REENTRANT  -DUPER -DNEED_STACK -DHAVE_SY
SLOG_H=1 -DMISS_FACILITYNAMES -I/opt/csw/include  -D_REENTRANT 
-D_THREAD_SAFE   -c -o pound.o pound.c
"pound.h", line 292: syntax error before or at: 4
cc: acomp failed for pound.c
gmake: *** [pound.o] Error 2

Re: [Pound Mailing List] problems compiling pound 2.0
Alessio Cervellin <a.cervellin(at)acm.org>
2006-02-05 22:42:42 [ FULL ]
Sergio Freire ha scritto:
[...]

I found the guilty symbol, it's S_NONE... i replaced it with S_NONEX. 
This allow me to compile pound.c and http.c, but then i get the 
following error when compiling config.c:

cc -DF_CONF=\"/opt/csw/etc/pound.cfg\" -DVERSION=\"`cat VERSION`\" 
-xarch=v8 -D_REENTRANT  -DUPER -DNEED_STACK -DHAVE_SY
SLOG_H=1 -DMISS_FACILITYNAMES -I/opt/csw/include  -D_REENTRANT 
-D_THREAD_SAFE   -c -o config.o config.c
"config.c", line 246: undefined symbol: LOG_AUTHPRIV
"config.c", line 246: non-constant initializer: op "NAME"
"config.c", line 249: undefined symbol: LOG_FTP
"config.c", line 249: non-constant initializer: op "NAME"
cc: acomp failed for config.c

Re: [Pound Mailing List] problems compiling pound 2.0
Alessio Cervellin <a.cervellin(at)acm.org>
2006-02-05 22:59:55 [ FULL ]
Sergio Freire ha scritto:
[...]

yes, i just downloaded it from this link today:
http://www.apsis.ch/pound/Pound-2.0.tgz
[...]

I use this Sun CC:

bash-3.00$ cc -V
cc: Sun C 5.7 2005/01/07

I also tried gcc (got same errors), anyway my aim is to build with Sun 
CC as i did fine with Pound 1.9:

bash-3.00$ gcc -v
Reading specs from /opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.4/specs
Configured with: ../sources/gcc-3.4.4/configure --prefix=/opt/csw/gcc3 
--with-local-prefix=/opt/csw --without-gnu-as --w
ith-as=/usr/ccs/bin/as --without-gnu-ld --with-ld=/usr/ccs/bin/ld 
--enable-threads=posix --enable-shared --enable-multil
ib --enable-nls --with-included-gettext --with-libiconv-prefix=/opt/csw 
--with-x --enable-java-awt=xlib --enable-languag
es=all
Thread model: posix
gcc version 3.4.4

Re: [Pound Mailing List] problems compiling pound 2.0
"Sergio Freire" <etfreire(at)ua.pt>
2006-02-05 23:10:15 [ FULL ]
Check your sys/syslog.h and see if it has  LOG_FTP and LOG_AUTHPRIV 
defined..
you might have to update syslog.
If you just want to compile it, you can change LOG_FTP and LOG_AUTHPRIV to 
LOG_LOCAL0 for example, but this is just a workaround until you update 
syslog.
About S_NONE maybe its better to change that name to something else... 
Robert?

BTW: I dont have Solaris, I dont even worked with it in my life :)  I just 
wanna help.

Regards,
Sergio Freire


----- Original Message ----- 
From: "Alessio Cervellin" <a.cervellin(at)acm.org>
To: <pound(at)apsis.ch>
Sent: Sunday, February 05, 2006 9:42 PM
Subject: Re: [Pound Mailing List] problems compiling pound 2.0

[...][...][...]

Re: [Pound Mailing List] problems compiling pound 2.0
"Sergio Freire" <etfreire(at)ua.pt>
2006-02-05 23:16:44 [ FULL ]
Concerning S_NONE name on Solaris... its defined in signal.h
one way to override this is to add this to the source code in pound.h jusr 
before the typedef at line 242 if i remember and in config.h after the 
include "signal.h"

#undef S_NONE // Solaris defines it in sys/signal.h



Some reference:
http://lists.kde.org/?l=kde-bugs-dist&m=105197391529692&w=2

Sergio Freire

----- Original Message ----- 
From: "Sergio Freire" <etfreire(at)ua.pt>
To: <pound(at)apsis.ch>
Sent: Sunday, February 05, 2006 10:10 PM
Subject: Re: [Pound Mailing List] problems compiling pound 2.0

[...][...]
>>> variable like S_HEADER defined elsewhere.
>>> Do a test: change S_HEADER to S_HEADERX in  config.c, pound.h and 
>>> svc.c.. Try to compile it again and please post the
results.[...][...]

Re: [Pound Mailing List] problems compiling pound 2.0
"Sergio Freire" <etfreire(at)ua.pt>
2006-02-05 23:23:42 [ FULL ]
About Syslog, after a search it seems that Solaris and other systems like 
Freebsd might not define those symbols in syslog.h

A good approach is to have something like:

static CODE facilitynames[] = {
....
    /* LOG_AUTHPRIV is defined on GNU/Linux, but not FreeeBSD or Solaris */
#ifdef LOG_AUTHPRIV
    { "authpriv", LOG_AUTHPRIV },
#endif /* LOG_AUTHPRIV */
    /* LOG_FTP is defined on GNU/Linux, but not FreeBSD or Solaris */
#ifdef LOG_FTP
    { "ftp", LOG_FTP },

,,,,

as suggested in this good example:
http://lists.nongnu.org/archive/html/bug-cvs/2004-06/msg00126.html

Regards,
Sergio Freire

----- Original Message ----- 
From: "Alessio Cervellin" <a.cervellin(at)acm.org>
To: <pound(at)apsis.ch>
Sent: Sunday, February 05, 2006 9:42 PM
Subject: Re: [Pound Mailing List] problems compiling pound 2.0

[...][...][...]

Re: [Pound Mailing List] problems compiling pound 2.0
Alessio Cervellin <a.cervellin(at)acm.org>
2006-02-05 23:26:41 [ FULL ]
Sergio Freire ha scritto:
[...]

it doesn't... here it is:

#define LOG_KERN        (0<<3)  /* kernel messages */
#define LOG_USER        (1<<3)  /* random user-level messages */
#define LOG_MAIL        (2<<3)  /* mail system */
#define LOG_DAEMON      (3<<3)  /* system daemons */
#define LOG_AUTH        (4<<3)  /* security/authorization messages */
#define LOG_SYSLOG      (5<<3)  /* messages generated internally by 
syslogd */
#define LOG_LPR         (6<<3)  /* line printer subsystem */
#define LOG_NEWS        (7<<3)  /* netnews subsystem */
#define LOG_UUCP        (8<<3)  /* uucp subsystem */
#define LOG_CRON        (15<<3) /* cron/at subsystem */
         /* other codes through 15 reserved for system use */
#define LOG_LOCAL0      (16<<3) /* reserved for local use */
#define LOG_LOCAL1      (17<<3) /* reserved for local use */
#define LOG_LOCAL2      (18<<3) /* reserved for local use */
#define LOG_LOCAL3      (19<<3) /* reserved for local use */
#define LOG_LOCAL4      (20<<3) /* reserved for local use */
#define LOG_LOCAL5      (21<<3) /* reserved for local use */
#define LOG_LOCAL6      (22<<3) /* reserved for local use */
#define LOG_LOCAL7      (23<<3) /* reserved for local use */

#define LOG_NFACILITIES 24      /* maximum number of facilities */
#define LOG_FACMASK     0x03f8  /* mask to extract facility part */

#define LOG_EMERG       0       /* system is unusable */
#define LOG_ALERT       1       /* action must be taken immediately */
#define LOG_CRIT        2       /* critical conditions */
#define LOG_ERR         3       /* error conditions */
#define LOG_WARNING     4       /* warning conditions */
#define LOG_NOTICE      5       /* normal but signification condition */
#define LOG_INFO        6       /* informational */
#define LOG_DEBUG       7       /* debug-level messages */

#define LOG_PRIMASK     0x0007  /* mask to extract priority part 
(internal) */

#define LOG_MASK(pri)   (1 << (pri))            /* mask for one priority
*/
#define LOG_UPTO(pri)   ((1 << ((pri)+1)) - 1)  /* all priorities 
through pri */

[...]

I can't...
[...]

Ok, with this fix it works... i hope that this LOG-related source code 
will change, it's sad to see it lost "native" compatibility with solaris :(

Last note, there's this minor warning:
"svc.c", line 950: warning: old-style declaration or incorrect type for: 
init_RSAgen

Re: [Pound Mailing List] problems compiling pound 2.0
Alessio Cervellin <a.cervellin(at)acm.org>
2006-02-05 23:33:55 [ FULL ]
Sergio Freire ha scritto:
[...]

I totally agree :)

Re: [Pound Mailing List] problems compiling pound 2.0
"Sergio Freire" <etfreire(at)ua.pt>
2006-02-05 23:46:22 [ FULL ]
Great, we got it working!
With the suggestions I made its possible to keep the compatibility with 
solaris and others, so people dont need to change the source code.
About  line 950 of svc.c, the declaration should be, I think, changed from:

init_RSAgen()

to

int init_RSAgen()

Just a minor change along with the others for syslog compatibility and 
S_NONE workaround for Solaris that will for sure be in the next release :) 
Its up to Robert.
Regards,
Sergio Freire

----- Original Message ----- 
From: "Alessio Cervellin" <a.cervellin(at)acm.org>
To: <pound(at)apsis.ch>
Sent: Sunday, February 05, 2006 10:26 PM
Subject: Re: [Pound Mailing List] problems compiling pound 2.0

[...][...][...][...][...][...][...]

Re: [Pound Mailing List] problems compiling pound 2.0
Alessio Cervellin <a.cervellin(at)acm.org>
2006-02-05 23:56:55 [ FULL ]
Sergio Freire ha scritto:
[...]

yes, that's it! :)

Re: [Pound Mailing List] problems compiling pound 2.0
Robert Segall <roseg(at)apsis.ch>
2006-02-06 11:54:28 [ FULL ]
On Sun, 2006-02-05 at 23:56 +0100, Alessio Cervellin wrote:[...]

So, to summarise:

1. We need to look if LOG_FTP and LOG_AUTHPRIV are defined, and if not
define them privately.

2. Move away from S_NONE, as that is defined in signal.h

3. Define init_RSAgen() as a void everywhere (which is how it should
be).

If I understand you correctly, with these changes Pound should compile
cleanly on Solaris?[...]

RE: [Pound Mailing List] problems compiling pound 2.0
"Sergio Freire" <sergio-s-freire(at)ptinovacao.pt>
2006-02-06 12:17:25 [ FULL ]
Yup.
If you define init_RSAgen as void, you shouldn't return any int from
within the function.
About point 1, I think you should follow something similar to the link I
sent in the other email.
About point 2, maybe its better to change the name.
Regards,
Sergio Freire


-----Original Message-----
From: Robert Segall [mailto:roseg(at)apsis.ch] 
Sent: Monday, February 06, 2006 10:54 AM
To: pound(at)apsis.ch
Subject: Re: [Pound Mailing List] problems compiling pound 2.0

On Sun, 2006-02-05 at 23:56 +0100, Alessio Cervellin wrote:[...]
changed from:[...]

So, to summarise:

1. We need to look if LOG_FTP and LOG_AUTHPRIV are defined, and if not
define them privately.

2. Move away from S_NONE, as that is defined in signal.h

3. Define init_RSAgen() as a void everywhere (which is how it should
be).

If I understand you correctly, with these changes Pound should compile
cleanly on Solaris?[...]

Re: [Pound Mailing List] problems compiling pound 2.0
Si et JP <sietjp(at)free.fr>
2006-02-07 19:51:18 [ FULL ]
Hi all,

My website has been linked by another big big website and a lot of hits 
seems to make pound not work.
I have very often the error "Error 503 - The service is not available. 
Please try again later"

The apache srever seems to be working well. Could you tell me what 
config parameter should I try to change to find the good config?

Thanks a lot![...]

Re: [Pound Mailing List] problems compiling pound 2.0
Robert Segall <roseg(at)apsis.ch>
2006-02-08 12:12:09 [ FULL ]
On Tue, 2006-02-07 at 19:51 +0100, Si et JP wrote:[...]

Without the log messages I can't tell you much about it, as a 503 can be
generated in 6 different places.
[...]

1. What version of Pound are you using?
2. What does your log show?
3. Are you absolutely sure your Apache can actually take the load on its
own? A 503 most often occurs when the response time from a back-end is
too long.[...]

MailBoxer