public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libmudflap/44661]  New: Link order (?) might cause threaded libmudflap to assert
@ 2010-06-25  5:08 davi dot arnaut at sun dot com
  2010-06-28  0:48 ` [Bug libmudflap/44661] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: davi dot arnaut at sun dot com @ 2010-06-25  5:08 UTC (permalink / raw)
  To: gcc-bugs

Tweaking the order of library names might cause the mudflap runtime to assert.

$ cat foo.c 
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>

static void *routine(void* arg)
{
  pthread_t thr = pthread_self();
  printf("foo %d\n", 1);
  return NULL;
}

int main()
{
  pthread_t thr;
  pthread_create(&thr, NULL, routine, NULL);
  pthread_join(thr, NULL);
  return 0;
}

$ gcc -o foo foo.c  -fmudflapth -lpthread -lmudflapth 
$ ./foo 
mf: erroneous reentrancy detected in `__mf_check'
Aborted (core dumped)
$ gcc -o foo foo.c  -fmudflapth -lmudflapth -lpthread
$ ./foo 
foo 1

g++ (Ubuntu 20100621-0ubuntu1) 4.6.0 20100621 (experimental) [trunk revision
161065]
GNU gold (GNU Binutils for Ubuntu 2.20.51-system.20100617) 1.9


-- 
           Summary: Link order (?) might cause threaded libmudflap to assert
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libmudflap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davi dot arnaut at sun dot com


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


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <bug-44661-4@http.gcc.gnu.org/bugzilla/>]

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-25  5:08 [Bug libmudflap/44661] New: Link order (?) might cause threaded libmudflap to assert davi dot arnaut at sun dot com
2010-06-28  0:48 ` [Bug libmudflap/44661] " pinskia at gcc dot gnu dot org
2010-07-21 23:53 ` pinskia at gcc dot gnu dot org
2010-07-22  7:53 ` jakub at gcc dot gnu dot org
2010-07-22 10:54 ` davi dot arnaut at sun dot com
     [not found] <bug-44661-4@http.gcc.gnu.org/bugzilla/>
2013-03-02 20:42 ` g_sauthoff at web dot de
2013-03-02 20:44 ` pinskia at gcc dot gnu.org
2013-11-10  5:49 ` pinskia 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).