caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jeffrey Loren Shaw" <shawjef3@msu.edu>
To: caml-list@inria.fr
Subject: crash under macos x but not win32
Date: Mon, 09 Apr 2007 20:19:45 -0400	[thread overview]
Message-ID: <E1Hb45K-0007eN-K8@sys29.mail.msu.edu> (raw)

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


             reply	other threads:[~2007-04-10  0:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10  0:19 Jeffrey Loren Shaw [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Hb45K-0007eN-K8@sys29.mail.msu.edu \
    --to=shawjef3@msu.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).