#19 Fix #423426 - erratic RTE232


The attached patch fixes


An erratic Runtime Error 232 (exception in non-Kylix
thread) is triggered although

The fundamental reason for this (mis)behaviour is a
flawed detection of "Kylix threads". The bug report
mentioned above provides a 99% work-around (which will
fail in the extreme corner case of a callback from
foreign threads).

The patch tackles the root of the problem and *changes
the API* of System.pas, allowing for querying whether
a thread is a Kylix thread or not. Two new interface-
public functions are introduced:

function IsDelphiThread: Boolean;
procedure SetIsDelphiThread(Value: Boolean);

Internally, System.pas will now keep track of the fact
whether a thread is a Kylix thread (or not); the OS
signal handling code in SysUtils.pas uses this
information to either throw RTE232 or to continue
processing the signal.

Note that the condition to identify a Kylix thread in
SysUtils.pas is

IsDelphiThread or IsLibrary

i.e. if the signal handler resides in a library
(shared object), then each and every thread is
identified as a Kylix thread. This is harmless in so
far as the RTL by default does *not install* the
signal handler if the exception handling code is
initialized from a library - see

Again, be warned that this patch modifies the API of
System.pas - and this completely breaks binary
compatibility with each and every existing DCU/DPU
(and package) file out in the wild.


  • bugger

    bugger - 2001-05-15
  • bugger

    bugger - 2001-05-15
  • bugger

    bugger - 2001-05-15
  • bugger

    bugger - 2001-05-15
  • Chuck Jazdzewski

    • assigned_to: nobody --> cjaz

Log in to post a comment.