Bug in user-defined types?

From: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
To: Postgresql <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Bug in user-defined types?
Date: 2001-04-02 07:53:37
Message-ID: 3AC83001.B1F9902D@albourne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

In response to comments made here, I have been rewriting the unsigned
types as externally loadable. Using the same routines that worked fine
when linked statically into the backend gives me core-dumps only.
Creating only a single uint2 type with I/O routines, I get

test=# create table u2 ( u uint2);
CREATE
test=# insert into u2 values (12::uint2);
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.

Running this under gdb (I tried this on alpha as well)

backend> insert into u2 values (12::uint2);
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x40115573 in memcpy () from /lib/libc.so.6
(gdb) where
#0 0x40115573 in memcpy () from /lib/libc.so.6
#1 0x80cfb92 in _copyConst ()
#2 0x80d25d9 in copyObject ()
#3 0x80ebad9 in expression_tree_mutator ()
#4 0x80eb407 in eval_const_expressions_mutator ()
#5 0x80ebe42 in expression_tree_mutator ()
#6 0x80eb407 in eval_const_expressions_mutator ()
#7 0x80ebdf2 in expression_tree_mutator ()
#8 0x80eb407 in eval_const_expressions_mutator ()
#9 0x80eaf87 in eval_const_expressions ()
#10 0x80e6d2a in preprocess_expression ()
#11 0x80e6751 in subquery_planner ()
#12 0x80e66c0 in planner ()
#13 0x81036e7 in pg_plan_query ()
#14 0x81038d9 in pg_exec_query_string ()
#15 0x81049d4 in PostgresMain ()
#16 0x80ce884 in main ()
#17 0x400d8a42 in __libc_start_main () from /lib/libc.so.6
(gdb)

It never seems to get to my code. So either I've defined something
incorrectly or there is a bug. I'd appreciate it if somebody more
knowledgable than I could have a look at it. I've included a tar with
the definitions.

BTW it may be good to update the complex example to the new C-calling
interface, as there is no example of creating a type with the new
calling interface.

Cheers,

Adriaan

Attachment Content-Type Size
utest.tar.gz application/x-gzip 3.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2001-04-02 08:19:24 CVS commits
Previous Message Thomas Lockhart 2001-04-02 06:49:53 Re: Call for platforms