]> granicus.if.org Git - postgresql/commit
Fix unsafe references to errno within error messaging logic.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Jan 2014 01:04:14 +0000 (20:04 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Jan 2014 01:04:14 +0000 (20:04 -0500)
commit01b882fd8468ad019f9dfeb4f7b0d286cc9ffbe5
tree02d70ceeca40c1655b640c0eed2e0280462ad3bb
parent5525529db191b6f4b893d445e5c801bc456ba3bb
Fix unsafe references to errno within error messaging logic.

Various places were supposing that errno could be expected to hold still
within an ereport() nest or similar contexts.  This isn't true necessarily,
though in some cases it accidentally failed to fail depending on how the
compiler chanced to order the subexpressions.  This class of thinko
explains recent reports of odd failures on clang-built versions, typically
missing or inappropriate HINT fields in messages.

Problem identified by Christian Kruse, who also submitted the patch this
commit is based on.  (I fixed a few issues in his patch and found a couple
of additional places with the same disease.)

Back-patch as appropriate to all supported branches.
src/backend/port/sysv_sema.c
src/backend/port/sysv_shmem.c