Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQZjd-0007NK-Ih for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Jun 2018 14:48:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQZjc-0002FL-6w for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Jun 2018 14:48:24 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQZjb-0002FB-TQ for pgsql-bugs@lists.postgresql.org; Wed, 06 Jun 2018 14:48:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQZjV-0006RE-7S for pgsql-bugs@postgresql.org; Wed, 06 Jun 2018 14:48:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w56Em9Qr007091; Wed, 6 Jun 2018 10:48:09 -0400 From: Tom Lane To: Michael Paquier cc: Sergei Kornilov , "K S, Sandhya (Nokia - IN/Bangalore)" , "'pgsql-bugs@postgresql.org'" Subject: Re: psql crashes found when executing slash commands In-reply-to: <20180606075911.GL1442@paquier.xyz> References: <2802591528270961@web59j.yandex.ru> <20180606075911.GL1442@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Wed, 06 Jun 2018 16:59:11 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7089.1528296489.1@sss.pgh.pa.us> Date: Wed, 06 Jun 2018 10:48:09 -0400 Message-ID: <7090.1528296489@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Wed, Jun 06, 2018 at 10:42:41AM +0300, Sergei Kornilov wrote: >> Hmm. What operating system are you using? Hardware architecture? Do >> you compile postgresql yourself or install some precompiled packages? >> We have tests for psql slash-commands and they are not broken. > My bet is on an issue with the version of flex used for compilation, and > that those binaries have been manually compiled. psql does some, um, interesting stuff with sharing lexer state between separately-built flex lexers. I would not be too surprised if it crashes if you build psqlscan.l and psqlscanslash.l with different versions of flex, or perhaps even just different flex switches. So that might be an avenue to check into. Another theory is that the OP is using something that's not flex at all, or is some version we've never seen before, and this coding technique doesn't work at all with it :-( regards, tom lane