Thread: 7.0beta1: bugs appearing on cygwin

7.0beta1: bugs appearing on cygwin

From
Marko Kreen
Date:
----- Forwarded message from owner-bugs@postgreSQL.org -----

From: owner-bugs@postgreSQL.org
Date: Mon, 28 Feb 2000 06:08:12 -0500 (EST)
To: owner-bugs@postgreSQL.org, marko@l-t.ee
Subject: BOUNCE pgsql-bugs@postgreSQL.org:    Non-member submission from [Marko Kreen <marko@l-t.ee>]

From: Marko Kreen <marko@l-t.ee>
To: pgsql-bugs@postgresql.org
Subject: 7.0beta1: bugs appearing on cygwin

============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               :       Marko Kreen
Your email address      :       marko@l-t.ee


System Configuration
---------------------
  Architecture (example: Intel Pentium)         : Intel Pentium 100

  Operating System (example: Linux 2.0.26 ELF)  : winnt4/cygwin 20.1

  PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-7.0beta1

  Compiler used (example:  gcc 2.8.0)           : egcs-2.91.57 (cygwin default)

Please enter a FULL description of your problem:
------------------------------------------------

1) ecpg does not honour HAVE_SNPRINTF being undefined.  make fails :(
----
gcc -o ecpg preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o keywords.o c_keywords.o ../lib/typename.o
descriptor.ovariable. 
  -L/usr/local/lib -lcrypt -lm -lreadline -ltermcap -lncurses -lcygipc -g
descriptor.o: In function `ECPGnumeric_lvalue':
/home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:55: undefined reference to `snprintf'
descriptor.o: In function `ECPGstring_buffer':
/home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:78: undefined reference to `snprintf'
descriptor.o: In function `ECPGstring_length':
/home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:94: undefined reference to `snprintf'
/home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:101: undefined reference to `snprintf'
descriptor.o: In function `ECPGdata_assignment':
/home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:152: undefined reference to `snprintf'
descriptor.o:/home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:165: more undefined references to `snprintf'
follow
collect2: ld returned 1 exit status
make[3]: *** [ecpg] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
----

2) gcc warns about redefine of CURRENT_TIME. Nothing
serious (I mean the compile does not fail..), I just thought I mention.

defined in backend/parse.h & <sys/ipc.h> (cygwin32_ipc-1.03)

ok, I chacked.  In different .c files they are included in different
order.

ipc.h:     #define CURRENT_TIME    time(0)
parse.h: #define CURRENT_TIME    287

How it affects the program, I do not know.  Maybe this is serious...


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

snoopy$ uname -a
CYGWIN_NT-4.0 SNOOPY 20.1 (0.3/1/1) 1998-12-3 20:39:18 i586 unknown
snoopy$ make


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Somebody with a clue should look into it.



----- End forwarded message -----


<offtopic>
<!-- well, you can ignore it -->

Is this really the Right Thing(tm) to have bug-reporting list
available only to subscribers?  I mean it should be encouraged to
be on list but enforced?  There should be decent anti-spam software
floating around?
</offtopic>

Re: [BUGS] 7.0beta1: bugs appearing on cygwin

From
Bruce Momjian
Date:
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)         : Intel Pentium 100
>
>   Operating System (example: Linux 2.0.26 ELF)  : winnt4/cygwin 20.1
>
>   PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-7.0beta1
>
>   Compiler used (example:  gcc 2.8.0)           : egcs-2.91.57 (cygwin default)
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> 1) ecpg does not honour HAVE_SNPRINTF being undefined.  make fails :(
> ----
> gcc -o ecpg preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o keywords.o c_keywords.o ../lib/typename.o
descriptor.ovariable. 
>   -L/usr/local/lib -lcrypt -lm -lreadline -ltermcap -lncurses -lcygipc -g
> descriptor.o: In function `ECPGnumeric_lvalue':
> /home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:55: undefined reference to `snprintf'
> descriptor.o: In function `ECPGstring_buffer':
> /home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:78: undefined reference to `snprintf'
> descriptor.o: In function `ECPGstring_length':
> /home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:94: undefined reference to `snprintf'
> /home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:101: undefined reference to `snprintf'
> descriptor.o: In function `ECPGdata_assignment':
> /home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:152: undefined reference to `snprintf'
> descriptor.o:/home/src/pgsql/src/interfaces/ecpg/preproc/descriptor.c:165: more undefined references to `snprintf'
follow
> collect2: ld returned 1 exit status
> make[3]: *** [ecpg] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all] Error 2
> make: *** [all] Error 2
> ----

OK, I am confused.  We have HAVE_SNPRINTF, but I don't see it being used
anywhere.  Is it still relivant to our code?  Does NT not have snprintf?


> 2) gcc warns about redefine of CURRENT_TIME. Nothing
> serious (I mean the compile does not fail..), I just thought I mention.
>
> defined in backend/parse.h & <sys/ipc.h> (cygwin32_ipc-1.03)
>
> ok, I chacked.  In different .c files they are included in different
> order.
>
> ipc.h:     #define CURRENT_TIME    time(0)

Seems this is getting in our way.  We could try  undefining it before
defining it, I guess.  I don't think it affects the compile.

> parse.h: #define CURRENT_TIME    287
>
> How it affects the program, I do not know.  Maybe this is serious...
>
>
> Please describe a way to repeat the problem.   Please try to provide a
> concise reproducible example, if at all possible:
> ----------------------------------------------------------------------
>
> snoopy$ uname -a
> CYGWIN_NT-4.0 SNOOPY 20.1 (0.3/1/1) 1998-12-3 20:39:18 i586 unknown
> snoopy$ make

Running NT.  I know it works on that because we have gotten patches from
people.


> Is this really the Right Thing(tm) to have bug-reporting list
> available only to subscribers?  I mean it should be encouraged to
> be on list but enforced?  There should be decent anti-spam software
> floating around?
> </offtopic>

The bugs list is open to anyone, right?  It should be.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: [BUGS] 7.0beta1: bugs appearing on cygwin

From
Tom Lane
Date:
> OK, I am confused.  We have HAVE_SNPRINTF, but I don't see it being used
> anywhere.  Is it still relivant to our code?  Does NT not have snprintf?

Probably ecpg needs to import the ports/snprintf module if it exists.
See psql, which does this already.

>> 2) gcc warns about redefine of CURRENT_TIME. Nothing
>> serious (I mean the compile does not fail..), I just thought I mention.
>> defined in backend/parse.h & <sys/ipc.h> (cygwin32_ipc-1.03)
>
> Seems this is getting in our way.  We could try  undefining it before
> defining it, I guess.  I don't think it affects the compile.

I wonder whether it is possible to avoid including <sys/ipc.h> in the
files that need to include parse.h.  Which files show the warning,
anyway?

>> Is this really the Right Thing(tm) to have bug-reporting list
>> available only to subscribers?  I mean it should be encouraged to
>> be on list but enforced?  There should be decent anti-spam software
>> floating around?

> The bugs list is open to anyone, right?  It should be.

I think it's set to filter out nonsubscribers just like all the other
pgsql lists.  Considering the amount of spam we were getting before
we put in those filters, I'm not eager to just remove the filter.
Better ideas are welcome...

One idea: does anyone know whether bug submissions via the webpage form
go through if sent by a nonsubscriber?  If not, maybe we could arrange
an exception in the filter for that case.

BTW, you can (should) subscribe to "pgsql-loophole", and then you'll be
allowed to post to any of the pgsql lists.  However, that's no help for
someone who's not already involved in the community, but is just coming
along and trying to report a bug.

            regards, tom lane

Re: [BUGS] 7.0beta1: bugs appearing on cygwin

From
Bruce Momjian
Date:
> > OK, I am confused.  We have HAVE_SNPRINTF, but I don't see it being used
> > anywhere.  Is it still relivant to our code?  Does NT not have snprintf?
>
> Probably ecpg needs to import the ports/snprintf module if it exists.
> See psql, which does this already.

Doing that now.  Thanks.

>
> >> 2) gcc warns about redefine of CURRENT_TIME. Nothing
> >> serious (I mean the compile does not fail..), I just thought I mention.
> >> defined in backend/parse.h & <sys/ipc.h> (cygwin32_ipc-1.03)
> >
> > Seems this is getting in our way.  We could try  undefining it before
> > defining it, I guess.  I don't think it affects the compile.
>
> I wonder whether it is possible to avoid including <sys/ipc.h> in the
> files that need to include parse.h.  Which files show the warning,
> anyway?

Probably possible.  Not sure.  Perhaps the user can supply a patch.
Even:

    #ifndef CURRENT_TIME
    #include <ipc.h>
    #endif

may work.


--
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: [BUGS] 7.0beta1: bugs appearing on cygwin

From
Marko Kreen
Date:
On Mon, Feb 28, 2000 at 06:26:54PM -0500, Bruce Momjian wrote:
> > >> 2) gcc warns about redefine of CURRENT_TIME. Nothing
> > >> serious (I mean the compile does not fail..), I just thought I mention.
> > >> defined in backend/parse.h & <sys/ipc.h> (cygwin32_ipc-1.03)
> > >
> > > Seems this is getting in our way.  We could try  undefining it before
> > > defining it, I guess.  I don't think it affects the compile.
> >
> > I wonder whether it is possible to avoid including <sys/ipc.h> in the
> > files that need to include parse.h.  Which files show the warning,
> > anyway?
>
> Probably possible.  Not sure.  Perhaps the user can supply a patch.
> Even:
>
>     #ifndef CURRENT_TIME
>     #include <ipc.h>
>     #endif
>
> may work.
Well.  IMHO (after looking into it) the CURRENT_TIME has no business
of being in ipc.h in the first place.  Here follows a patch that moves
it into a private header file of cygwin32_ipc.

As the http://penguin.cz/~horak/cygwin32_ipc-1.03.tar.gz seems to
be the "official" (only) place of cygwin32_ipc, it should be easy to
push a next version or something. Or to include the patch with postgresql.

If this is wrong, I can look what should be done to PostgreSQL about it.

BTW, about doc/README.NT: There is a line:
> 12. Initdb --username=jkr (do not run this command as administrator)

but initdb does not have option --username ...
Also there is a patch attached (for cygwin32_ipc, it seems), but nothing said
what should be done about it.


--
marko


diff -ur cygwin32_ipc-1.03.orig/include/IpcNtExt.h cygwin32_ipc-1.03/include/IpcNtExt.h
--- cygwin32_ipc-1.03.orig/include/IpcNtExt.h    Wed Jun 17 15:08:04 1998
+++ cygwin32_ipc-1.03/include/IpcNtExt.h    Tue Feb 29 12:08:50 2000
@@ -51,6 +51,8 @@
 #include "IpcNtStr.h"
 #include <windows.h>

+#define CURRENT_TIME        time(0)
+
 EXTERN HANDLE GSemSem, GSemShm, GSemMsg ;

 EXTERN CYGWIN32_IPCNT_SEMSTR *GStrSem ;
diff -ur cygwin32_ipc-1.03.orig/include/sys/ipc.h cygwin32_ipc-1.03/include/sys/ipc.h
--- cygwin32_ipc-1.03.orig/include/sys/ipc.h    Wed May 13 23:26:28 1998
+++ cygwin32_ipc-1.03/include/sys/ipc.h    Tue Feb 29 12:08:28 2000
@@ -35,7 +35,6 @@

 #include <sys/types.h>

-#define CURRENT_TIME        time(0)
 #define IPC_PRIVATE ((key_t) 0)

 struct ipc_perm