pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash)
6+ messages / 3 participants
[nested] [flat]

* libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash)
@ 2005-03-16 14:12 Christof Petig <christof@petig-baender.de>
  2005-03-16 15:30 ` Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc Christof Petig <christof@petig-baender.de>
  2005-03-18 10:01 ` Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Michael Meskes <meskes@postgresql.org>
  0 siblings, 2 replies; 6+ messages in thread

From: Christof Petig @ 2005-03-16 14:12 UTC (permalink / raw)
  To: pgsql-patches@postgresql.org; pgsql-bugs@postgresql.org; +Cc: pgsql-interfaces

NB: The crossposting is actually suggested on the mailing list description:
"If you've found a bug in PostgreSQL, please send it both to this list
and also to the pgsql-patches list."

Amd64 and powerpc share an ABI design which enables variable passing in
registers and which makes va_list a complex datatype. Due to gcc not
implementing a part of the C9x standard
(http://mail-index.netbsd.org/tech-toolchain/2003/11/11/0011.html)
taking a pointer to a va_list will fail on these platforms. The
corresponding bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8262) is
closed, so the gcc developers seem not to plan to change this.

So I propose the following hack (feel free to improve it!) to go into
mainline. Since only powerpc and amd64 are affected (and the old method
does not work at all here at all) the patch should not be controversial.

    Christof

PS: I don't know about other architectures. I can't believe that only
ppc and amd64 pass parameters in registers.
PPS: I could not test it on amd64, but all docs indicate the same behaviour.

Attachments:

  [application/x-gzip] ecpg_ppc.patch.gz (1.1K, ../../42383EE8.5070503@petig-baender.de/2-ecpg_ppc.patch.gz)
  download

  [application/pgp-signature] signature.asc (255B, ../../42383EE8.5070503@petig-baender.de/3-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc
  2005-03-16 14:12 libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Christof Petig <christof@petig-baender.de>
@ 2005-03-16 15:30 ` Christof Petig <christof@petig-baender.de>
  1 sibling, 0 replies; 6+ messages in thread

From: Christof Petig @ 2005-03-16 15:30 UTC (permalink / raw)
  To: ; +Cc: pgsql-interfaces

Christof Petig schrieb:
> So I propose the following hack (feel free to improve it!) to go into
> mainline. Since only powerpc and amd64 are affected (and the old method
> does not work at all here at all) the patch should not be controversial.

I failed to mention that call by reference is the default for va_list on
these platforms (that's actually the cause of the bug).

    Christof

Attachments:

  [application/pgp-signature] signature.asc (255B, ../../423850F8.3030008@petig-baender.de/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash)
  2005-03-16 14:12 libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Christof Petig <christof@petig-baender.de>
@ 2005-03-18 10:01 ` Michael Meskes <meskes@postgresql.org>
  2005-06-16 14:45   ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Christof Petig <christof@petig-baender.de>
  1 sibling, 1 reply; 6+ messages in thread

From: Michael Meskes @ 2005-03-18 10:01 UTC (permalink / raw)
  To: Christof Petig <christof@petig-baender.de>; +Cc: pgsql-interfaces

Patch committed. Thanks.

Michael

-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc
  2005-03-16 14:12 libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Christof Petig <christof@petig-baender.de>
  2005-03-18 10:01 ` Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Michael Meskes <meskes@postgresql.org>
@ 2005-06-16 14:45   ` Christof Petig <christof@petig-baender.de>
  2005-06-28 00:47     ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Bruce Momjian <pgman@candle.pha.pa.us>
  2005-07-04 19:05     ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 2 replies; 6+ messages in thread

From: Christof Petig @ 2005-06-16 14:45 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; +Cc: pgsql-interfaces

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Meskes schrieb:
> Patch committed. Thanks.

I have to admit that I got the case of the preprocessor symbol on amd64
wrong. __AMD64__ is not defined, __amd64__ is.

Sorry, corrected patch attached
  Christof
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCsZCmng+R+0ucfO0RAoABAKDKnokBW+tgXMKgeEMecpZsFXRFTQCeKeBu
YsdWP056cqxKtNAx5Gh/Wis=
=b2Og
-----END PGP SIGNATURE-----

Attachments:

  [text/x-patch] ecpglib.patch (2.0K, ../../42B190A6.7010409@petig-baender.de/2-ecpglib.patch)
  download | inline diff:
Index: src/interfaces/ecpg/ecpglib/execute.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v
retrieving revision 1.40
diff -u -u -r1.40 execute.c
--- src/interfaces/ecpg/ecpglib/execute.c	2 Jun 2005 12:35:11 -0000	1.40
+++ src/interfaces/ecpg/ecpglib/execute.c	16 Jun 2005 14:35:09 -0000
@@ -70,7 +70,7 @@
 	return res;
 }
 
-#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
+#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
 #define APREF ap
 #else
 #define APREF *ap
@@ -178,7 +178,7 @@
 			if (!(var = (struct variable *) ECPGalloc(sizeof(struct variable), lineno)))
 				return false;
 
-#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
+#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
 			ECPGget_variable(ap, type, var, true);
 #else
 			ECPGget_variable(&ap, type, var, true);
Index: src/interfaces/ecpg/ecpglib/extern.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/ecpg/ecpglib/extern.h,v
retrieving revision 1.13
diff -u -u -r1.13 extern.h
--- src/interfaces/ecpg/ecpglib/extern.h	2 Jun 2005 12:35:11 -0000	1.13
+++ src/interfaces/ecpg/ecpglib/extern.h	16 Jun 2005 14:35:09 -0000
@@ -125,7 +125,7 @@
 bool ECPGstore_result(const PGresult *results, int act_field,
 				 const struct statement * stmt, struct variable * var);
 bool		ECPGstore_input(const int, const bool, const struct variable *, const char **, bool *);
-#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
+#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
   // work around a gcc/ABI bug with va_lists on ppc+amd64
 void		ECPGget_variable(va_list, enum ECPGttype, struct variable *, bool);
 #else

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc
  2005-03-16 14:12 libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Christof Petig <christof@petig-baender.de>
  2005-03-18 10:01 ` Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Michael Meskes <meskes@postgresql.org>
  2005-06-16 14:45   ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Christof Petig <christof@petig-baender.de>
@ 2005-06-28 00:47     ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 6+ messages in thread

From: Bruce Momjian @ 2005-06-28 00:47 UTC (permalink / raw)
  To: Christof Petig <christof@petig-baender.de>; +Cc: Michael Meskes <meskes@postgresql.org>; pgsql-interfaces


Your patch has been added to the PostgreSQL unapplied patches list at:

	http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------


Christof Petig wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Michael Meskes schrieb:
> > Patch committed. Thanks.
> 
> I have to admit that I got the case of the preprocessor symbol on amd64
> wrong. __AMD64__ is not defined, __amd64__ is.
> 
> Sorry, corrected patch attached
>   Christof
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFCsZCmng+R+0ucfO0RAoABAKDKnokBW+tgXMKgeEMecpZsFXRFTQCeKeBu
> YsdWP056cqxKtNAx5Gh/Wis=
> =b2Og
> -----END PGP SIGNATURE-----


> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc
  2005-03-16 14:12 libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Christof Petig <christof@petig-baender.de>
  2005-03-18 10:01 ` Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Michael Meskes <meskes@postgresql.org>
  2005-06-16 14:45   ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Christof Petig <christof@petig-baender.de>
@ 2005-07-04 19:05     ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 6+ messages in thread

From: Bruce Momjian @ 2005-07-04 19:05 UTC (permalink / raw)
  To: Christof Petig <christof@petig-baender.de>; +Cc: Michael Meskes <meskes@postgresql.org>; pgsql-interfaces


Patch applied.  Thanks.

---------------------------------------------------------------------------


Christof Petig wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Michael Meskes schrieb:
> > Patch committed. Thanks.
> 
> I have to admit that I got the case of the preprocessor symbol on amd64
> wrong. __AMD64__ is not defined, __amd64__ is.
> 
> Sorry, corrected patch attached
>   Christof
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFCsZCmng+R+0ucfO0RAoABAKDKnokBW+tgXMKgeEMecpZsFXRFTQCeKeBu
> YsdWP056cqxKtNAx5Gh/Wis=
> =b2Og
> -----END PGP SIGNATURE-----

[ text/x-patch is unsupported, treating like TEXT/PLAIN ]

> Index: src/interfaces/ecpg/ecpglib/execute.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v
> retrieving revision 1.40
> diff -u -u -r1.40 execute.c
> --- src/interfaces/ecpg/ecpglib/execute.c	2 Jun 2005 12:35:11 -0000	1.40
> +++ src/interfaces/ecpg/ecpglib/execute.c	16 Jun 2005 14:35:09 -0000
> @@ -70,7 +70,7 @@
>  	return res;
>  }
>  
> -#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
> +#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
>  #define APREF ap
>  #else
>  #define APREF *ap
> @@ -178,7 +178,7 @@
>  			if (!(var = (struct variable *) ECPGalloc(sizeof(struct variable), lineno)))
>  				return false;
>  
> -#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
> +#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
>  			ECPGget_variable(ap, type, var, true);
>  #else
>  			ECPGget_variable(&ap, type, var, true);
> Index: src/interfaces/ecpg/ecpglib/extern.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/interfaces/ecpg/ecpglib/extern.h,v
> retrieving revision 1.13
> diff -u -u -r1.13 extern.h
> --- src/interfaces/ecpg/ecpglib/extern.h	2 Jun 2005 12:35:11 -0000	1.13
> +++ src/interfaces/ecpg/ecpglib/extern.h	16 Jun 2005 14:35:09 -0000
> @@ -125,7 +125,7 @@
>  bool ECPGstore_result(const PGresult *results, int act_field,
>  				 const struct statement * stmt, struct variable * var);
>  bool		ECPGstore_input(const int, const bool, const struct variable *, const char **, bool *);
> -#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
> +#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
>    // work around a gcc/ABI bug with va_lists on ppc+amd64
>  void		ECPGget_variable(va_list, enum ECPGttype, struct variable *, bool);
>  #else

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2005-07-04 19:05 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-16 14:12 libecpg (8.0 and CVS) hits a gcc bug on powerpc and amd64 (crash) Christof Petig <christof@petig-baender.de>
2005-03-16 15:30 ` Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc Christof Petig <christof@petig-baender.de>
2005-03-18 10:01 ` Michael Meskes <meskes@postgresql.org>
2005-06-16 14:45   ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Christof Petig <christof@petig-baender.de>
2005-06-28 00:47     ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Bruce Momjian <pgman@candle.pha.pa.us>
2005-07-04 19:05     ` Re: libecpg (8.0 and CVS) hits a gcc bug on powerpc Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox