caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* crash under macos x but not win32
@ 2007-04-10  0:19 Jeffrey Loren Shaw
  2007-04-10  1:07 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 7+ messages in thread
From: Jeffrey Loren Shaw @ 2007-04-10  0:19 UTC (permalink / raw)
  To: caml-list

The following works as intended in Win32 (the ui counts slowly from 0 to 5), 
but crashes in Mac OS X with "Bus Error". I'm running ocaml 3.09.3 installed 
with macports. For windows I used the Ocaml 3.09.3 MinGW binary 
distribution. 

(* looptest.ml *) 

open Tk 

let testone () =
 let top = openTk () in
 let l = Label.create top in
 let loopfun () =
   ignore
     (
	Thread.create
	  (fun () ->
	    for i=0 to 5 do
	      Thread.delay 1.;
	      Label.configure ~text:(string_of_int i) l
	    done
	  )
	  ()
     )
 in
 let b = Button.create ~text:"Run the test" ~command:loopfun top in
 pack  [l];
 pack [b];
 mainLoop ();; 

testone () 

(* end looptest.ml *) 

runs with: ocaml -I +labltk -I +threads unix.cma threads.cma labltk.cma 
looptest.ml 

Any ideas? Perhaps the following information will help, I don't know. 

Thread 3 Crashed:
0   com.tcltk.tklibrary  	0x9acead88 Tk_FreeGC + 30
1   com.tcltk.tklibrary  	0x9acbe64d TkButtonWorldChanged + 117
2   com.tcltk.tklibrary  	0x9acbed53 ConfigureButton + 1400
3   com.tcltk.tklibrary  	0x9acbf68f ButtonWidgetObjCmd + 416
4   com.tcltk.tcllibrary 	0x9ac2b2c3 TclInvokeObjectCommand + 264
5   dlllabltk.so         	0x000e294b camltk_tcl_direct_eval + 623
6   ocamlrun             	0x00012ba3 caml_interprete + 6262
7   ocamlrun             	0x0000e0ba caml_callbackN_exn + 185
8   ocamlrun             	0x0000e103 caml_callback_exn + 38
9   dllthreads.so        	0x000d73e8 caml_thread_start + 80
10  libSystem.B.dylib    	0x90024147 _pthread_body + 84 

Thread 3 crashed with X86 Thread State (32-bit):
 eax: 0x00000000  ebx: 0x9acead78  ecx: 0x0c5a9048  edx: 0x00000015
 edi: 0x01668608  esi: 0x00000000  ebp: 0xb0203838  esp: 0xb0203810
  ss: 0x0000001f  efl: 0x00010286  eip: 0x9acead88   cs: 0x00000017
  ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-04-10  5:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-10  0:19 crash under macos x but not win32 Jeffrey Loren Shaw
2007-04-10  1:07 ` [Caml-list] " Jacques Garrigue
2007-04-10  2:08   ` skaller
2007-04-10  2:41     ` Jacques Garrigue
2007-04-10  3:56   ` Jeffrey Loren Shaw
2007-04-10  4:15     ` Jacques Garrigue
2007-04-10  5:52       ` skaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).