X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8D3FED1B57C for ; Tue, 17 Feb 2004 20:14:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 22449-05 for ; Tue, 17 Feb 2004 16:14:11 -0400 (AST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by svr1.postgresql.org (Postfix) with ESMTP id 390A2D1B49E for ; Tue, 17 Feb 2004 16:14:09 -0400 (AST) Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AtBbd-0000xH-00 for pgsql-interfaces@postgresql.org; Tue, 17 Feb 2004 21:14:09 +0100 Received: from [80.128.68.77] (helo=FRITZweb) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1AtBbc-00047A-00 for pgsql-interfaces@postgresql.org; Tue, 17 Feb 2004 21:14:09 +0100 From: =?iso-8859-1?Q?J=FCrgen_Cappel?= To: "pgsql-interfaces" Subject: Re: ECPG Segfault and variable usage question. Date: Tue, 17 Feb 2004 21:15:20 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:18ffa34e0aa20c651c9363a5f5f711d8 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/49 X-Sequence-Number: 4742 Hello Michael, some more info: the segmentation fault still occurs under Linux (SuSE 8.0) with today's snapshot. No options used, just the filename as the only arg. I tried it on Solaris 8 today where it compiles fine. It works on Linux when I change the variable name from "var" to "myvar" or add a variable in the DECLARE section, but that can't be the solution. Any idea on how to find the problem ? Oh, BTW: the expression :myarray[index[10]] compiles OK as of pgc.l version 1.125 2004/02/15 Thanks for your help ! Jürgen -----Ursprüngliche Nachricht----- Von: pgsql-interfaces-owner@postgresql.org [mailto:pgsql-interfaces-owner@postgresql.org]Im Auftrag von Michael Meskes Gesendet: Sonntag, 15. Februar 2004 14:42 An: Jürgen Cappel Cc: pgsql-interfaces Betreff: Re: [INTERFACES] ECPG Segfault and variable usage question. On Thu, Feb 12, 2004 at 08:00:12PM +0100, Jürgen Cappel wrote: > this is a code snippet that causes ECPG to segfault. It's quite tricky I took this code as a.pgc and ran 'ecpg a.pgc' without any problem. Do you use any special options for ecpg? > Stack trace was obtained using a snapshot from about 2 weeks ago, ECPG from > the 7.4.1 release segfaults also. Hmm, my 7.4.1 version also compiles this snippet cleanly. > Another problem that's giving me headaches trying to find a workaround for > is the following use of variables as data sources in INSERT/UPDATE > statements: > > :myarray[index[10]] > > Any comments, suggestions, hints ? Thanks a lot, Could you please try if the following patch helps you? --- /home/postgres/pgsql-ecpg/preproc/pgc.l 2003-12-29 14:53:04.000000000 +0100 +++ pgc.l 2004-02-15 14:38:43.000000000 +0100 @@ -183,7 +183,7 @@ identifier {ident_start}{ident_cont}* -array ({ident_cont}|{whitespace}|[\+\-\*\%\/\(\)])* +array ({ident_cont}|{whitespace}|[\[\]\+\-\*\%\/\(\)])* typecast "::" /* This will make it into CVS soon. 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! ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend