[Vm-dev] Has anyone done a tutorial on...

Clément Bera bera.clement at gmail.com
Wed Sep 20 23:04:07 UTC 2017


On Thu, Sep 21, 2017 at 12:03 AM, Phil B <pbpublist at gmail.com> wrote:

>
>
>
> On Sep 18, 2017 11:12 PM, "Ben Coman" <btc at openinworld.com> wrote:
>
>
>
>> (You folks do some nice work in VM-land... sure would be nice if it were
>> more easily reproducible by those of us who don't work with the internals
>> daily.  For example: what is the recommended way to build a VMMaker image
>> these days?  Tried the obvious ways in Squeak 5.1 and Pharo 6.1 and both
>> failed...)
>>
>
> Should be as easy as...
> $ git clone https://github.com/OpenSmalltalk/opensmalltalk-vm.git
> $ cd opensmalltalk-vm/build.linux..../pharo.cog.spur/build.debug/
> $ ./mvm
> ...and look for binaries in "products" directory.
>
> Maybe there are times when your installed autotools versions conflicts
> (IIUC Eliot sometimes has problems on newer Linux versions).
> If you hit such problems, one path forward may be to leverage Luke's work
> to produce a Nix build, which "should" be entirely reproducible on anyone's
> environment.
>   http://forum.world.st/Fwd-Nix-package-for-Pharo-flavor-of-op
> ensmalltalk-vm-td4942450.html
>   http://forum.world.st/nix-based-build-system-was-problem-
> with-configure-and-libGL-on-CentOS-6-5-td4944335.html
> @Luke, could you refresh me on how to kick off a Nix Pharo VM build on a
> non-NixOS platform?
>
> cheers -ben
>
>
>
> Ben,
>
> Building the VM hasn't been my issue (it's been working nicely for me in a
> variety of Linux environments), building the VMMaker image has been the
> problem.  A while back I was using Eliot's buildsqueaktrunkvmmakerimage.sh
> script but that stopped working for me (I think the last time it
> successfully ran for me was pre-github migration).  Last week I tried to
> manually install the VMMaker package in Squeak and got an error, this week
> I tried to install it via Pharo and got a different error.  So rather than
> try to debug any of these approaches which may be obsolete, I was really
> trying to ask for pointers to the currently recommended method to build a
> VMMaker image.
>

In practice, all the people using the simulator have images that were built
when Eliot's script was working, and we update the image with the new
VMMaker code but don't rebuild them. I know its not good but we had to keep
things working with limited ressources.

So there are 2 solutions:
- you ask someone with a working image to give it to you and you start from
there (by loading the most recent code, etc.).
- you fix Eliot's script or you bug him until he fixes it.


I read quickly your report but it looks to me that 1 can be debugged
through the simulator while 2,3,4 needs to be debugged with gdb. I am not
sure with 3 since Eliot added some simulation support for sockets at some
points.

For gdb with the VM the main things to know are:
- Debug VM is very slow, Assert VM is half the perf of prod VM for most
things (though stack page switch for example is much slower in Assert VM).
- in general you want an assert or debug VM and put a breakpoint on
warning, so when an assertion fails gdb stops and you can try to figure
things out.
- you need to compile the debug VM to access C variables if you need so.
- you can call debug functions printStackAllStack, printFrame,
printCogMethod, etc. in gdb. You can try to look in Slang in the VMMaker
code for the list of debug functions available (<api> pragma). You often
need to manually cast parameters to usqint / sqint in gdb to correctly call
those functions.

As always for simulator or gdb the best is to save an image about to crash,
start it on the debug platform and make it crash.

Good luck and have fun.


Thanks,
> Phil
>
>
>> Thanks,
>> Phil
>>
>> On Sep 18, 2017 7:38 PM, "tim Rowledge" <tim at rowledge.org> wrote:
>>
>>
>> When possible you’re much better off using the VMSimulator to examine an
>> image.
>>
>> > On 18-09-2017, at 4:25 PM, Phil B <pbpublist at gmail.com> wrote:
>> >
>> > Using gdb to explore a running image?  Blog post or video format is
>> great.  Most of what I've run across is related to the internals of the VM
>> rather than debugging an image.  My gdb skills are pretty rusty plus I
>> suspect that not knowing all of the helper functions available in the VM
>> (and how to best use them in a debugging workflow) is slowing me down.
>>
>>
>> tim
>> --
>> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
>> "Bother" said Pooh, as his rucksack opened whilst skydiving
>>
>>
>>
>>
>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170921/00bef655/attachment.html>


More information about the Vm-dev mailing list