misc/164637: Problem with vsnprintf in libc.so when compiled with clang

Pierre-Luc Drouin pldrouin at pldrouin.net
Mon Jan 30 15:20:09 UTC 2012

>Number:         164637
>Category:       misc
>Synopsis:       Problem with vsnprintf in libc.so when compiled with clang
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 30 15:20:08 UTC 2012
>Originator:     Pierre-Luc Drouin
>Release:        9.0-STABLE
FreeBSD wdaemon 9.0-STABLE FreeBSD 9.0-STABLE #0: Mon Jan 23 16:02:56 EST 2012     /usr/obj/usr/src/sys/KERNEL  i386
When FreeBSD world (and kernel) is built using clang, the resulting code generated for vsnprintf in the library libc.so does not work properly, causing a segmentation fault. The problem was discovered when attempting to use java on FreeBSD.
Compile and run the following C code on FreeBSD 9.0-STABLE built with clang:

#include <stdio.h>
#include <string.h>

int main(int nargrs, const char* args[])
  const char* msg="Hello World!";
  int length=strlen(msg);
  printf("length is %i\n",length);
  char string0[256];
  char string[256];

  return 0;

Alternatively, try launching java or javac from jdk16, diablo-jdk16 or openjdk6


More information about the freebsd-bugs mailing list