This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libmudflap/44661] New: Link order (?) might cause threaded libmudflap to assert


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]