title: Java App Crash under OSX
body: <p>I am writing a network application on Java and I have come across a weird bug. The application is sending text between two clients.Some works of the text are highlighted. When that happens I get an OSX crash report.This is some of it :</p>
  
  <pre><code>Crashed Thread:  19  Java: AWT-EventQueue-0
  
  Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
  Exception Codes: 0x000000000000000d, 0x0000000000000000
  
  VM Regions Near 0:
  --&gt; 
      __TEXT                 00000001070ba000-00000001070c2000 [   32K] r-x/rwx SM=COW  /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
  
  Application Specific Information:
  objc[1293]: garbage collection is OFF
  
  Java information:
   Exception type: Bus Error (0xa) at pc=7fff96a7b698
  
   Java VM: Java HotSpot(TM) 64-Bit Server VM (20.4-b02-402 mixed mode macosx-amd64)
  </code></pre>
  
  <p>Also in the IDE (netbeans) this message appears : <code>Invalid memory access of location 0x0 rip=0x7fff96a7b698</code></p>
  
  <p>Finally sometimes when I reproduce the exception in a different way this exception is thrown in the IDE :</p>
  
  <pre><code>2012-03-20 23:15:40.025 java[1071:e503] -[__NSCFNumber ctFontRef]: unrecognized selector sent to instance 0x7fad326dd490
  Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Non-Java exception raised, not handled! (Original problem: -[__NSCFNumber ctFontRef]: unrecognized selector sent to instance 0x7fad326dd490)
  </code></pre>
  
  <p>I asked a friend to test this application on his windows machine and it turned out it worked (Although I am not 100% sure that he followed the steps correctly for causing the bug).</p>
  
  <p>Any suggestions as to what might cause this , or possible solutions ?
  If you need some more info let me know.</p>