Embedded SQL library bug
============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================
Your name : David Flater
Your email address : dflater@nist.gov
System Configuration
---------------------
Architecture (example: Intel Pentium) : Sun Ultrasparc 60
Operating System (example: Linux 2.4.18) : SunOS 5.8
PostgreSQL version (example: PostgreSQL-7.4.2): PostgreSQL-7.4.2
Compiler used (example: gcc 2.95.2) : gcc 3.2
Please enter a FULL description of your problem:
------------------------------------------------
In Embedded SQL, sometimes get segmentation faults on selecting part
or all of a float8[] array into a char array.
(gdb) where
#0 0xff233da0 in strncpy () from /usr/lib/libc.so.1
#1 0xff376780 in ECPGget_data () from /private/pgsql/lib/libecpg.so.4
#2 0xff37345c in ECPGstore_result () from /private/pgsql/lib/libecpg.so.4
#3 0xff374cc8 in ECPGexecute () from /private/pgsql/lib/libecpg.so.4
#4 0xff3751dc in ECPGdo () from /private/pgsql/lib/libecpg.so.4
#5 0x00010a58 in main (argc=1, argv=0xffbef384) at crashme.pgc:45
The attached example reproduces the failure on PostgreSQL 7.4.2 under
Solaris. The problem was also experienced by a colleague who was
using Linux but I haven't tested the example under Linux.
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
I have attached a tar file containing a program, makefile, and log of
my results.
Do this:
createdb crashme
make
./crashme
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
N/A
--
David Flater, National Institute of Standards and Technology, U.S.A.
Attachments:
On Fri, May 21, 2004 at 05:03:40PM -0400, David Flater wrote:
In Embedded SQL, sometimes get segmentation faults on selecting part
or all of a float8[] array into a char array.
Thanks for the report. The problem is that ecpg does not know that it
gets an array of floats but expects a character string since the
variable is char[]. Seeing that it gets more than one value it tries to
bulk load the data into an array of strings which obviously doesn't
exist.
I will have to see what solution is best for this.
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
On Fri, May 21, 2004 at 05:03:40PM -0400, David Flater wrote:
In Embedded SQL, sometimes get segmentation faults on selecting part
or all of a float8[] array into a char array.
I just committed a patch to cvs HEAD that should fix your problem.
Please try it and tell me if it works correctly.
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!