Ungraceful handling of fatal flex errors

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Ungraceful handling of fatal flex errors
Date: 2001-01-27 14:25:03
Message-ID: Pine.LNX.4.30.0101271518550.1492-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

A fatal scanner error (likely a memory exhaustion problem) causes a
straight exit() without clean up, which causes a system-wide restart.
This should fix it:

*** scan.l 2001/01/24 19:43:03 1.85
--- scan.l 2001/01/27 14:14:29
***************
*** 55,60 ****
--- 55,62 ----
/* No reason to constrain amount of data slurped per myinput() call. */
#define YY_READ_BUF_SIZE 16777216

+ #define YY_FATAL_ERROR(msg) elog(FATAL, "%s", (msg))
+
#else /* !FLEX_SCANNER */

#undef input

But you will now get an unavoidable

scan.c:2145: warning: `yy_fatal_error' defined but not used

Objections or concerns?

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-01-27 14:45:08 Re: wrong query plan in 7.1beta3
Previous Message Vince Vielhaber 2001-01-27 14:09:15 Re: Which version?