Re: pgsql: Get rid of backtracking in jsonpath_scan.l

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Alexander Korotkov <akorotkov(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Get rid of backtracking in jsonpath_scan.l
Date: 2019-03-26 21:25:16
Message-ID: 91ff584f-75d2-471f-4d9e-9ee8f09cdc1d@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


On 3/26/19 12:36 PM, Andrew Dunstan wrote:
> On 3/26/19 11:22 AM, Alvaro Herrera wrote:
>> On 2019-Mar-26, Andrew Dunstan wrote:
>>
>>> On 3/25/19 8:44 AM, Alexander Korotkov wrote:
>>>> Get rid of backtracking in jsonpath_scan.l
>>>>
>>>> Non-backtracking flex parsers work faster than backtracking ones. So, this
>>>> commit gets rid of backtracking in jsonpath_scan.l. That required explicit
>>>> handling of some cases as well as manual backtracking for some cases. More
>>>> regression tests for numerics are added.
>>> jacana appears to be having trouble with this:
>>>
>>>
>>> 2019-03-26 00:49:02.208 EDT [5c99ae9e.20cc:6] LOG: server process (PID 8368) was terminated by exception 0xC0000028
>> 0xC0000028 is STATUS_BAD_STACK, per
>> https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
>> Not sure how credible/useful a stack trace is going to be.
>>
>
> Right, and getting stack traces isn't easy in any case. There is a
> gadget from Google that is supposed to trap exceptions and produce a
> stack trace on the fly in mingw. I'm going to take a look at it,
> although loading it might be ... interesting.
>
>

Still working on this. However, I have another data point. On a shiny
new Msys2/WS2019 system (on AWS/EC2) this does not reproduce, even
though jacana seems to be producing it quite reliably.

To get the backtrace gadget working I think I'm going to have to add
some code like:

#if defined(WIN32) && defined(LOAD_BACKTRACE)

    LoadLibraryA("backtrace.dll");

#endif

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-03-26 21:35:55 Re: pgsql: Collations with nondeterministic comparison
Previous Message Tom Lane 2019-03-26 18:25:52 Re: pgsql: Get rid of backtracking in jsonpath_scan.l

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-03-26 21:39:24 Re: partitioned tables referenced by FKs
Previous Message Thomas Munro 2019-03-26 20:14:47 Re: Usage of epoch in txid_current