[Bug gdb/29311] [gdb] ThreadSanitizer: data race (/lib64/libtsan.so.2+0x4c5e2) in free

vries at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Wed Jul 13 11:15:09 GMT 2022


https://sourceware.org/bugzilla/show_bug.cgi?id=29311

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
I tried to reproduce the problem outside gdb using:
...
$ cat test.c
#include <iconv.h>
#include <pthread.h>

const char *from = "UTF-8";
const char *to = "UTF-32LE";

static void
bar (void)
{
  int i;
  for (i = 0; i < 1000; ++i)
    {
      iconv_t handle = iconv_open (to, from);
      iconv_close (handle);
    }
}

static void *
foo (void *arg)
{
  bar ();
  return NULL;
}

int
main (void)
{
  pthread_t threadId;

  int i;
  for (i = 0; i < 4; ++i)
    {
      pthread_create (&threadId, NULL, &foo, NULL);
      pthread_detach (threadId);
    }

  bar ();

  return 0;
}
...
but no luck there.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list