Valgrind run error with Postgres on OSX

Started by Pavel Borisovabout 5 years ago1 messages
#1Pavel Borisov
pashkin.elfe@gmail.com
1 attachment(s)

Hi, hackers!

I tried to run PG in a Valgrind on OSX 10.13 with Clang 9/10 and get an
assertion error inside Valgrind

valgrind --leak-check=no --gen-suppressions=all --time-stamp=yes \
--error-markers=VALGRINDERROR-BEGIN,VALGRINDERROR-END \
--log-file=%p.log --trace-children=yes postgres -D ./pgdata \
--log_line_prefix="%m %p " --log_statement=all

Then I got an assertion error in Valgrind
m_signals.c:1106 (void handle_SCSS_change(Bool)):
Assertion 'ksa_old.sa_flags == skss_old.skss_per_sig[sig].skss_flags'
failed

I am not very much sure it has much do to with Postgres and I will report
this error to Valgrind community but it is not raised when I try to run
different programs under Valgrind on the same system. I haven't dived deep
into the issue and I am not sure that this patch is not an utter hack but
it heals an issue which may be useful for some of you.

If you have ideas on the issue please share.

--
Best regards,
Pavel Borisov

Postgres Professional: http://postgrespro.com <http://www.postgrespro.com&gt;

Attachments:

v1-0001-Fix-for-bug-when-running-Valgrind-on-OSX.patchapplication/octet-stream; name=v1-0001-Fix-for-bug-when-running-Valgrind-on-OSX.patchDownload
From f8b929e9eb646690727eee756e53650919271af5 Mon Sep 17 00:00:00 2001
From: Pavel Borisov <pashkin.elfe@gmail.com>
Date: Wed, 28 Oct 2020 15:17:50 +0400
Subject: [PATCH v1] Fix for bug when running Valgrind on OSX

When running VG on OSX 10.13 and Clang 10 and try to run PostgreSQL

valgrind --leak-check=no --gen-suppressions=all --time-stamp=yes \
--error-markers=VALGRINDERROR-BEGIN,VALGRINDERROR-END  \
--log-file=%p.log --trace-children=yes postgres -D ./pgdata \
--log_line_prefix="%m %p " --log_statement=all

I got an assertion error in Valgrind
m_signals.c:1106 (void handle_SCSS_change(Bool)):
Assertion 'ksa_old.sa_flags == skss_old.skss_per_sig[sig].skss_flags' failed

NOTE: This fixes the issue, however I am not very much sure it is done
in right and accurate way
---
 coregrind/m_signals.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c
index 720fb5f66..f1c20320d 100644
--- a/coregrind/m_signals.c
+++ b/coregrind/m_signals.c
@@ -1102,8 +1102,8 @@ static void handle_SCSS_change ( Bool force_update )
             VG_(sigfillset)( &ksa_old.sa_mask );
          }
 #        endif
-         vg_assert(ksa_old.sa_flags 
-                   == skss_old.skss_per_sig[sig].skss_flags);
+//         vg_assert(ksa_old.sa_flags 
+//                   == skss_old.skss_per_sig[sig].skss_flags);
 #        if !defined(VGP_ppc32_linux) && \
             !defined(VGP_x86_darwin) && !defined(VGP_amd64_darwin) && \
             !defined(VGP_mips32_linux) && !defined(VGP_mips64_linux) && \
-- 
2.28.0