public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
@ 2013-11-19 14:26 Joost.VandeVondele at mat dot ethz.ch
  2013-11-19 14:52 ` [Bug sanitizer/59188] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2013-11-19 14:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

            Bug ID: 59188
           Summary: [4.9 Regression] lib64/libtsan.so: undefined reference
                    to `sigsetjmp'
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

looks like it is not possible to use -fsanitize=thread with current trunk.

> cat test.c
int main()
{
 return 0;
}

> gcc  -fsanitize=thread -pie -fPIC test.c 
/data/vjoost/gnu/gcc_trunk/install/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../lib64/libtsan.so:
undefined reference to `sigsetjmp'
collect2: error: ld returned 1 exit status


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
@ 2013-11-19 14:52 ` rguenth at gcc dot gnu.org
  2013-11-19 14:53 ` jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19 14:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
  2013-11-19 14:52 ` [Bug sanitizer/59188] " rguenth at gcc dot gnu.org
@ 2013-11-19 14:53 ` jakub at gcc dot gnu.org
  2013-11-19 15:13 ` dvyukov at google dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-11-19 14:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
glibc (at least the 2.17 I have around) doesn't have sigsetjmp function at all,
it only conditionally has sigsetjmp as a macro:
#ifdef  __USE_POSIX
...
/* Store the calling environment in ENV, also saving the
   signal mask if SAVEMASK is nonzero.  Return 0.  */
# define sigsetjmp(env, savemask)       __sigsetjmp (env, savemask)
...
#endif

so
extern "C" int setjmp(void *env);
extern "C" int _setjmp(void *env);
extern "C" int sigsetjmp(void *env);
extern "C" int __sigsetjmp(void *env);
DEFINE_REAL(int, setjmp, void *env)
DEFINE_REAL(int, _setjmp, void *env)
DEFINE_REAL(int, sigsetjmp, void *env)
DEFINE_REAL(int, __sigsetjmp, void *env)

is just asking for trouble.  Not to mention that the arguments are wrong even
for __sigsetjmp, which has two arguments rather than just one.  So, if it works
with clang, must be purely by accident, perhaps the difference is that
__USE_POSIX is defined in one case and not in the other one, or something, but
still, it can't really work in either case.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
  2013-11-19 14:52 ` [Bug sanitizer/59188] " rguenth at gcc dot gnu.org
  2013-11-19 14:53 ` jakub at gcc dot gnu.org
@ 2013-11-19 15:13 ` dvyukov at google dot com
  2013-11-19 15:16 ` dvyukov at google dot com
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dvyukov at google dot com @ 2013-11-19 15:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

Dmitry Vyukov <dvyukov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dvyukov at google dot com

--- Comment #3 from Dmitry Vyukov <dvyukov at google dot com> ---
Hi,

Can you please try the following patch?
If it does not work, please check what else references sigsetjmp.


--- rtl/tsan_interceptors.cc    (revision 194823)
+++ rtl/tsan_interceptors.cc    (working copy)
@@ -2034,6 +2034,9 @@
   Die();
 }

+extern "C" uptr dlsym(uptr, const char*);
+const uptr RTLD_NEXT = -1;
+
 void InitializeInterceptors() {
   CHECK_GT(cur_thread()->in_rtl, 0);

@@ -2048,10 +2051,11 @@

   SANITIZER_COMMON_INTERCEPTORS_INIT;

-  TSAN_INTERCEPT(setjmp);
-  TSAN_INTERCEPT(_setjmp);
-  TSAN_INTERCEPT(sigsetjmp);
-  TSAN_INTERCEPT(__sigsetjmp);
+  *(uptr*)&REAL(setjmp) = dlsym(RTLD_NEXT, "setjmp");
+  *(uptr*)&REAL(_setjmp) = dlsym(RTLD_NEXT, "_setjmp");
+  *(uptr*)&REAL(sigsetjmp) = dlsym(RTLD_NEXT, "sigsetjmp");
+  *(uptr*)&REAL(__sigsetjmp) = dlsym(RTLD_NEXT, "__sigsetjmp");
+
   TSAN_INTERCEPT(longjmp);
   TSAN_INTERCEPT(siglongjmp);


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (2 preceding siblings ...)
  2013-11-19 15:13 ` dvyukov at google dot com
@ 2013-11-19 15:16 ` dvyukov at google dot com
  2013-11-19 15:24 ` Joost.VandeVondele at mat dot ethz.ch
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dvyukov at google dot com @ 2013-11-19 15:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

--- Comment #4 from Dmitry Vyukov <dvyukov at google dot com> ---
> glibc (at least the 2.17 I have around) doesn't have sigsetjmp function at all

this must be fine, we do not call it if it's not used

> Not to mention that the arguments are wrong even for __sigsetjmp

setjmp interception is a bit tricky (because one can't wrap libc setjmp into
another function, otherwise the saved context will be broken)
so it's actually called from tsan_rtl_amd64.S by a tail call here:

  // tail jump to libc sigsetjmp
  movl $0, %eax
  movq _ZN14__interception16real___sigsetjmpE@GOTPCREL(%rip), %rdx
  jmp *(%rdx)
  .cfi_endproc
.size __sigsetjmp, .-__sigsetjmp


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (3 preceding siblings ...)
  2013-11-19 15:16 ` dvyukov at google dot com
@ 2013-11-19 15:24 ` Joost.VandeVondele at mat dot ethz.ch
  2013-11-19 15:34 ` dvyukov at google dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2013-11-19 15:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Joost.VandeVondele at mat dot ethz
                   |                            |.ch

--- Comment #5 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
(In reply to Dmitry Vyukov from comment #3)
> Can you please try the following patch

compiles with warnings:

../../../../gcc/libsanitizer/tsan/tsan_interceptors.cc:2022:12: note: in
expansion of macro ‘REAL’
   *(uptr*)&REAL(_setjmp) = dlsym(RTLD_NEXT, "_setjmp");
            ^
../../../../gcc/libsanitizer/interception/interception.h:145:25: warning:
dereferencing type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]


However, it fixes the issue mentioned.
>From gcc-bugs-return-435088-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 19 15:32:00 2013
Return-Path: <gcc-bugs-return-435088-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27785 invoked by alias); 19 Nov 2013 15:31:59 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 27740 invoked by uid 48); 19 Nov 2013 15:31:56 -0000
From: "vmakarov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/59086] [4.9 Regression] error:=?UTF-8?Q? ‘asm’ operand has impossible constraints?Date: Tue, 19 Nov 2013 15:31:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vmakarov at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-59086-4-LAsoWzWhGC@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59086-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59086-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg01865.txt.bz2
Content-length: 773

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY086

Vladimir Makarov <vmakarov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at gcc dot gnu.org

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
There are not enough regs for the asm as frame pointer can not be used after
x86 tuning changes.  The root of the problem is an absence some functionality
in LRA preventing frame pointer elimination in presence of explicit sp changes.
 It also hurts performance for new tuning (there are PRs of this too).  I've
started to work on this problem.  I hope it will be solved in 2 weeks.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (4 preceding siblings ...)
  2013-11-19 15:24 ` Joost.VandeVondele at mat dot ethz.ch
@ 2013-11-19 15:34 ` dvyukov at google dot com
  2013-11-21 11:55 ` dvyukov at google dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dvyukov at google dot com @ 2013-11-19 15:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

--- Comment #6 from Dmitry Vyukov <dvyukov at google dot com> ---
Great, thanks!
I will prepare a real patch.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (5 preceding siblings ...)
  2013-11-19 15:34 ` dvyukov at google dot com
@ 2013-11-21 11:55 ` dvyukov at google dot com
  2013-11-21 15:02 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dvyukov at google dot com @ 2013-11-21 11:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

--- Comment #7 from Dmitry Vyukov <dvyukov at google dot com> ---
I've committed the fix into llvm:
http://llvm.org/viewvc/llvm-project?view=revision&revision=195345


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (6 preceding siblings ...)
  2013-11-21 11:55 ` dvyukov at google dot com
@ 2013-11-21 15:02 ` redi at gcc dot gnu.org
  2013-11-21 15:06 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2013-11-21 15:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Kostya Serebryany from comment #1)
> one other problem would be that we have zero tests for tsan in gcc :(

It would be great if someone could do something about that, even just a single
test would have shown this problem, which I think has been there for at least a
week.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (7 preceding siblings ...)
  2013-11-21 15:02 ` redi at gcc dot gnu.org
@ 2013-11-21 15:06 ` rguenth at gcc dot gnu.org
  2013-11-21 15:11 ` Joost.VandeVondele at mat dot ethz.ch
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-21 15:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed (works for me now).


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (8 preceding siblings ...)
  2013-11-21 15:06 ` rguenth at gcc dot gnu.org
@ 2013-11-21 15:11 ` Joost.VandeVondele at mat dot ethz.ch
  2013-11-22 11:06 ` rguenth at gcc dot gnu.org
  2013-11-22 11:11 ` kcc at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2013-11-21 15:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2013-11-21
         Resolution|FIXED                       |---
     Ever confirmed|0                           |1

--- Comment #10 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
(In reply to Richard Biener from comment #9)
> Fixed
unlikely, the fix only went to the llvm repo so far.
>  (works for me now).
depends on your libc


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (9 preceding siblings ...)
  2013-11-21 15:11 ` Joost.VandeVondele at mat dot ethz.ch
@ 2013-11-22 11:06 ` rguenth at gcc dot gnu.org
  2013-11-22 11:11 ` kcc at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-22 11:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|REOPENED                    |NEW


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug sanitizer/59188] [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp'
  2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
                   ` (10 preceding siblings ...)
  2013-11-22 11:06 ` rguenth at gcc dot gnu.org
@ 2013-11-22 11:11 ` kcc at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: kcc at gcc dot gnu.org @ 2013-11-22 11:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59188

--- Comment #11 from Kostya Serebryany <kcc at gcc dot gnu.org> ---
planing next merge from llvm to gcc in ~1 week.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-11-22 11:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 14:26 [Bug sanitizer/59188] New: [4.9 Regression] lib64/libtsan.so: undefined reference to `sigsetjmp' Joost.VandeVondele at mat dot ethz.ch
2013-11-19 14:52 ` [Bug sanitizer/59188] " rguenth at gcc dot gnu.org
2013-11-19 14:53 ` jakub at gcc dot gnu.org
2013-11-19 15:13 ` dvyukov at google dot com
2013-11-19 15:16 ` dvyukov at google dot com
2013-11-19 15:24 ` Joost.VandeVondele at mat dot ethz.ch
2013-11-19 15:34 ` dvyukov at google dot com
2013-11-21 11:55 ` dvyukov at google dot com
2013-11-21 15:02 ` redi at gcc dot gnu.org
2013-11-21 15:06 ` rguenth at gcc dot gnu.org
2013-11-21 15:11 ` Joost.VandeVondele at mat dot ethz.ch
2013-11-22 11:06 ` rguenth at gcc dot gnu.org
2013-11-22 11:11 ` kcc at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).