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.
|
When possible you’re much better off using the VMSimulator to examine an image. > On 18-09-2017, at 4:25 PM, Phil B <[hidden email]> 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; [hidden email]; http://www.rowledge.org/tim "Bother" said Pooh, as his rucksack opened whilst skydiving |
Tim, I'm open to that... any tutorials on that front would be appreciated 😀. The last time I tried (around the spur conversion timeframe) I was unable to run an image in the simulator for more than a few minutes without problems. (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...) Phil On Sep 18, 2017 7:38 PM, "tim Rowledge" <[hidden email]> wrote:
|
In reply to this post by Phil B
On Mon, Sep 18, 2017 at 8:25 PM, Phil B <[hidden email]> wrote:
Of course, it's still outdated but it may help you. It's very basic, thought. There some other VM + gdb posts that may help you: https://marianopeck.wordpress.com/tag/gdb/ Cheers, |
In reply to this post by Phil B
On Tue, Sep 19, 2017 at 8:07 AM, Phil B <[hidden email]> wrote:
Clement wrote a nice tutorial https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/ derived from... and if you dig deeper into C side, you might also find my rough drawings here useful... (I need to get back to finishing them (dependent on finishing my UFFI Clang interface to anaylse and chart with Roassal))
Should be as easy as... $ 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. @Luke, could you refresh me on how to kick off a Nix Pharo VM build on a non-NixOS platform? cheers -ben
|
In reply to this post by Phil B
I'm curious about your use case, that is, what problem are you actually trying to debug? - Bert - |
In reply to this post by Ben Coman
Ben and Mariano, Very much appreciated, I'll check those links out. Thanks, Phil On Sep 18, 2017 11:12 PM, "Ben Coman" <[hidden email]> wrote:
|
In reply to this post by Bert Freudenberg
In short, I seem to have a knack for finding hard to debug issues. 1) I have an issue related to some parsers I'm working on re: large # of stack pages in use. Eliot provided some helpful tips a couple of months ago that really helped here. It turns out I had two different issues related to this, one resolved (thanks to the image side VM params he pointed me to) the other still outstanding (probably a deeper structural issue and I'm thinking that the easier way to debug it will be to dial back the stack pages and let it crash earlier). These are bugs in my code and not not the VM. 2) Under heavy load I'm having problems with Event Tickler spiking in CPU usage (50% or more) and the image becoming generally unresponsive. Event Tickler never seems to recover once in this state. 4) Generally needing to be able to more quickly troubleshoot plugin and FFI issues. My images are heavy users of both and I've run into a variety of edge cases where I segfault the VM. Over time, I seem to keep running into issues like these so that's why I'm looking to improve my debugging skills at the VM/image boundary. On Sep 19, 2017 8:12 AM, "Bert Freudenberg" <[hidden email]> wrote:
|
In reply to this post by Ben Coman
On Sep 18, 2017 11:12 PM, "Ben Coman" <[hidden email]> wrote:
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. Thanks, Phil
|
On Thu, Sep 21, 2017 at 12:03 AM, Phil B <[hidden email]> wrote:
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.
|
I made a new vmmaker image via Eliot’s script just last week. I posted a small fix to avoid an annoying wait-for-user deprecation trap. What I can't test right now is making the reader image for the simple simulator testing because the a) default VM picked up from bintray does not have the Bochs simulator plugin b) the buldspurtrunkreaderimage.sh explicitly tries to copy an image that will not exist; changing lines 10 & 11 to refer to trunk6.image seems to help. I’d commit it to git except… git. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- Got into the gene pool while the lifeguard wasn't watching. |
In reply to this post by Clément Béra
Clément, On Sep 20, 2017 7:04 PM, "Clément Bera" <[hidden email]> wrote:
Well that explains a whole lot right there. I fairly regularly rebuild my images from scratch (too many bad experiences with image drift using deltas) and get concerned when I can't do so. I guess I'll not worry about VMMaker for a while on that front if it's a known issue.
I actually have a 5.0-based VMMaker image so I guess I'll try updating (ugh... 😀) it. Since I'm only a casual viewer/user of these scripts, I'll defer to others who know how they want things to work to update it rather than potentially creating more work for them.
Thanks, I'll try as you suggest.
This is a place I've been running into trouble: I've browsed the print* functions and have naively been trying to poke around but it's been a slog. Hopefully, the pointers you and the others have provided will help me get moving a bit faster.
Thanks, Phil
|
One additional thought on this...
On Sep 20, 2017 7:28 PM, "Phil B" <[hidden email]> wrote:
This seems to be an issue (problems building a good VMMaker image) that I've run into several times and others likely have as well. This is understandable since you folks are moving fast. Something the Squeak and Pharo teams might want to consider when doing a release is to also create a snapshot VMMaker image (i.e. this is what we used to build this release) so people like myself who aren't intimately familiar with VM development can easily get to the last known working/stable version of it for just building/debugging. Thanks, Phil |
In reply to this post by timrowledge
Hi Tim-- > ...I’d commit it to git except… git. Have you tried the GitHub Desktop macOS app from GitHub? I find it to be not scary. -C -- Craig Latta Black Page Digital Amsterdam :: San Francisco [hidden email] +31 6 2757 7177 (SMS ok) + 1 415 287 3547 (no SMS) |
Administrator
|
Craig Latta wrote > Have you tried the GitHub Desktop macOS app from GitHub? I find it > to be not scary. +1. I have been pleasantly surprised by its ease of use, although I'm using it less now because I can now handle my workflow* in Iceberg. Also, don't be mislead by the name; you can manage any git repo, not just those w. GH remotes. You just get a few extra convenience features for GH projects (e.g. open GH repo page in web browser). * unless I have to do something non-standard, like unwind a mistaken push to remote, in which case I drop down to the command line ----- Cheers, Sean -- Sent from: http://forum.world.st/Squeak-VM-f104410.html
Cheers,
Sean |
In reply to this post by Phil B
On Thu, Sep 21, 2017 at 7:28 AM, Phil B <[hidden email]> wrote:
Maybe useful... cheers -ben
|
I just did a double-check on this and all you need to do is the git dance to download cd blah-blah/image ./buildspurtrunkvmmakerimage.sh wait a couple of minutes. Done. As expected. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: XYZZY: Branch and Play Adventure |
That's not what I'm seeing. (Just tried again) I get a 6k TrunkImage.zip download and an unzip error basically telling me it's an invalid archive... Which it is. When I look at the zip file it appears to instead be a HTML page for Travis CI complaining about JavaScript being disabled... On Sep 21, 2017 12:51 PM, "tim Rowledge" <[hidden email]> wrote:
|
> On 22-09-2017, at 1:46 PM, Phil B <[hidden email]> wrote: > > That's not what I'm seeing. (Just tried again) I get a 6k TrunkImage.zip download and an unzip error basically telling me it's an invalid archive... Which it is. When I look at the zip file it appears to instead be a HTML page for Travis CI complaining about JavaScript being disabled… Well that’s not good. Try running the script with shell debugging on to show everything it does. See http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html for a basic explanation if you’re not already familiar. It almost makes sense to me. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful Latin Phrases:- Te precor dulcissime supplex! = Pretty please with a cherry on top! |
In reply to this post by Phil B
> On 22.09.2017, at 22:46, Phil B <[hidden email]> wrote: > > That's not what I'm seeing. (Just tried again) I get a 6k TrunkImage.zip download and an unzip error basically telling me it's an invalid archive... Which it is. When I look at the zip file it appears to instead be a HTML page for Travis CI complaining about JavaScript being disabled... > Sounds as if your checkout is out of date? Can you check that your image/getlatesttrunkimage.sh looks like that? https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/image/getlatesttrunkimage.sh Best regards -Tobias > On Sep 21, 2017 12:51 PM, "tim Rowledge" <[hidden email]> wrote: > > I just did a double-check on this and all you need to do is > the git dance to download > cd blah-blah/image > ./buildspurtrunkvmmakerimage.sh > wait a couple of minutes. > Done. As expected. > > tim > -- > tim Rowledge; [hidden email]; http://www.rowledge.org/tim > Strange OpCodes: XYZZY: Branch and Play Adventure > > |
Free forum by Nabble | Edit this page |