Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit936f569

Browse files
Exclude Threadsanitizer instrumentation in exit check
When building libpq there is a check to ensure that we're notlinking against code that calls exit(). This check is using aheuristic grep with exclusions for known false positives. TheThreadsanitizer library instrumentation for function exits isnamed such that it triggers the check, so add an exclusion.This fix is only applied to the Makefile since the meson buildfiles don't yet have this check. Adding the check to meson isoutside the scope of this patch though.Reported-by: Roman Lozko <lozko.roma@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CAEhC_BmNGKgj2wKArH2EAU11BsaHYgLnrRFJGRm5Vs8WJzyiQA@mail.gmail.com
1 parent9d1a535 commit936f569

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/interfaces/libpq/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,17 @@ backend_src = $(top_srcdir)/src/backend
105105
# build toolchains insert abort() calls, e.g. to implement assert().)
106106
# If nm doesn't exist or doesn't work on shlibs, this test will do nothing,
107107
# which is fine. The exclusion of __cxa_atexit is necessary on OpenBSD,
108-
# which seems to insert references to that even in pure C code.
108+
# which seems to insert references to that even in pure C code. Excluding
109+
# __tsan_func_exit is necessary when using ThreadSanitizer data race detector
110+
# which use this function for instrumentation of function exit.
109111
# Skip the test when profiling, as gcc may insert exit() calls for that.
110112
# Also skip the test on platforms where libpq infrastructure may be provided
111113
# by statically-linked libraries, as we can't expect them to honor this
112114
# coding rule.
113115
libpq-refs-stamp:$(shlib)
114116
ifneq ($(enable_coverage), yes)
115117
ifeq (,$(filter aix solaris,$(PORTNAME)))
116-
@if nm -A -u $< 2>/dev/null | grep -v __cxa_atexit | grep exit; then \
118+
@if nm -A -u $< 2>/dev/null | grep -v-e__cxa_atexit -e __tsan_func_exit | grep exit; then \
117119
echo 'libpq must not be calling any function which invokes exit'; exit 1; \
118120
fi
119121
endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp