Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jul 2010 04:46:21 +0100
From:      Christopher Key <cjk32@cam.ac.uk>
To:        ports@freebsd.org
Subject:   Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
Message-ID:  <4C43CA8D.3090404@cam.ac.uk>
In-Reply-To: <alpine.BSF.2.00.1007170911460.9805@tiktik.epipe.com>
References:  <20100717041919.70411.qmail@exxodus.fedaykin.here>	 <4C414AB5.1060305@gwdg.de>	 <alpine.BSF.2.00.1007170744070.9805@tiktik.epipe.com> <alpine.BSF.2.00.1007170911460.9805@tiktik.epipe.com>

next in thread | previous in thread | raw e-mail | index | archive | help
cjk32@cam.ac.uk wrote:
> Someone who understands the perl threading internals needs to figure
> this out.
>
>   
Simple solution, there was a missing -lpthread, patch available from:

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/148648


For some reason, linking binaries without -lpthread succeeds, but the
pthread calls in the resulting binary do nothing.

#v+
# cat pthread.c
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

int main(void) {

  int i;
  pthread_key_t k;

  k = 1234;
  i = pthread_key_create(&k, NULL);
  fprintf(stderr, "%d %d\n", i, (int) k);

  return 0;

}
# gcc pthread.c -o pt1
# gcc pthread.c -lpthread -o pt2
# ./pt1
0 1234
# ./pt2
0 0
#v-




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C43CA8D.3090404>