WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] caml stubdom crashes

To: Patrick Colp <pjcolp@xxxxxxxxx>, Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] caml stubdom crashes
From: "George S. Coker, II" <gscoker@xxxxxxxxxxxxxx>
Date: Thu, 02 Apr 2009 13:19:10 -0400
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Delivery-date: Thu, 02 Apr 2009 10:19:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49D4E640.6080603@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmztyK9GdHY+MFSPUOQc0Y5Z5PxLg==
Thread-topic: [Xen-devel] caml stubdom crashes
User-agent: Microsoft-Entourage/12.15.0.081119


On 4/2/09 12:22 PM, "Patrick Colp" <pjcolp@xxxxxxxxx> wrote:

> Alex Zeffertt wrote:
>> Hello ocaml minios stubdomain experts (that's narrowed down the list
>> somewhat!)
>> 
>> I've been playing with the caml version of the "hello world" example
>> stubdomain that can be found in xen-unstable.hg/stubdom/caml/.
>> 
>> If I make the following trivial modification to stubdom/caml/hello.ml
>> the stub domain page faults.  According to addr2line the page fault is
>> in ungetc.c:0.
>> 
>> --- a/stubdom/caml/hello.ml    Mon Mar 30 11:42:16 2009 +0100
>> +++ b/stubdom/caml/hello.ml    Thu Apr 02 15:15:45 2009 +0100
>> @@ -1,4 +1,6 @@
>> +let yr = 2009
>> +
>>  let main arg =
>> -  Printf.printf "Hello, world!\n%!."
>> +  Printf.printf "Hello, world %d!\n%!." yr
>> 
>>  let _ = Callback.register "main" main
>> 
>> 
>> Without the above change the stub domain runs as expected, i.e. it does
>> not page fault.
>> 
>> I suspect the problem is that the caml-stubdom target in
>> stubdom/caml/Makefile compiles stubdom/caml/hello.ml and links it with
>> $(CAMLLIB)/libasmrun.a.  But this is a library compiled for the
>> development machine platform (linux-i386-glibc) not for the stubdomain
>> platform (minios-i386-newlib).
>>

I don't think this is a linux-i386-glibc vs minios-i386-newlib issue but
rather the FORTIFY compiler options that introduce the
__fprintf_chk/__sprintf_chk funcs.  There is still something about the
behavior of the FORTIFY options that I am still not accounting for.  As
Patrick points out, special ports of ocaml should not be (and have not been)
necessary.
 
>> Maybe the original hello.ml only worked through luck, and the fact that
>> it used so very little of the ocaml language.
> 
> What environment did you use to compile the stubdom? I tried using Ubuntu
> with George Coker's patch and got the same result as you (page faulting).
> Interestingly, I could use a %s and a string and that seems to work OK, but
> not %d with an int.
> 
> When I instead used Debian to compile the stubdom (which requires no
> patch), then I could compile and run your code just fine (no page faults).
> Maybe this is the problem you're having?
> 
> 
>> In order to run a non trivial ocaml application in a stubdomain (e.g.
>> ocaml xenstored) do I need to port ocaml to minios-i386-newlib?
> 
> No, it should be possible as is. In fact, I've gotten my OCaml XenStore to
> run in a caml-stubdom (compiled in a Debian domain).
> 
> I'll soon be releasing a patch against the recently released disaggregated
> C xenstored stuff that uses my OCaml XenStore in a caml-stubdom instead.
> 
> 
> Patrick

-- 
George S. Coker, II <gscoker@xxxxxxxxxxxxxx>



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel