Re: NOFIXADE / NOPRINTADE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NOFIXADE / NOPRINTADE
Date: 2004-09-23 14:35:23
Message-ID: 25886.1095950123@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> Does anyone have any idea what this code is intended to do, and why it
> is necessary?

A bit of googling (I used "SSIN_UACPROC") will turn up enough info to
clue you in. Apparently, on these machines an unaligned memory access
causes a trap to the kernel, but the default behavior of the kernel is
to emulate the desired memory access and then return control. Fine,
but *really* *slow*. So good programming practice is to disable the
emulation and fix any thereby-revealed bugs in your code instead.
Which is what we're doing in this code.

The UAC_SIGBUS option turns off the emulation and makes an unaligned
access result in SIGBUS instead. The UAC_NOPRINT option suppresses
the "unaligned access" warning message that the kernel may helpfully
print about it. I'm not sure why we have the latter as dead code
(it is dead, because NOPRINTADE doesn't get defined anywhere).
The code samples I found on the net mostly tended to go
int buffer[] = {SSIN_UACPROC, UAC_SIGBUS | UAC_NOPRINT};

I would be inclined to get rid of the separate NOPRINTADE code and make
NOFIXADE select both flags.

The MIPS_FIXADE seems to be the same deal but a different OS' API.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-09-23 14:48:54 Re: Use of zlib
Previous Message Tom Lane 2004-09-23 14:08:15 Re: BUG: possible busy loop when connection is closed while trying to establish SSL connection