lang/perl5.12 segfault (amd64 - 8-STABLE)

Christopher Key cjk32 at cam.ac.uk
Mon Jul 19 03:46:24 UTC 2010


cjk32 at 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-



More information about the freebsd-ports mailing list