Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install or get Polyphemus ? #26

Open
labordep opened this issue Mar 18, 2023 · 26 comments
Open

How to install or get Polyphemus ? #26

labordep opened this issue Mar 18, 2023 · 26 comments

Comments

@labordep
Copy link

I don't understand the way to get (or install) and use Polymphemus on my PC.

I have tried that :

Metacello new
   baseline: 'Polyphemus';
   repository: 'github://hogoww/Polyphemus:main';
	onConflictUseIncoming;
	ignoreImage;
   load.

But an exception is raised during the loading (DirectoryDoesNotExist: Path ... Pharo/images/Polyphemus/pharo-vm/smalltalksrc.

Can you add some documentation or a link to get it ?

@hogoww
Copy link
Owner

hogoww commented Mar 18, 2023

But an exception is raised during the loading (DirectoryDoesNotExist: Path ... Pharo/images/Polyphemus/pharo-vm/smalltalksrc.

Using the script, it works on my computer, although it hangs while dowloading VMMaker as a dependency, which can take a few minutes.
Could you post a screenshot of the stack please, to try to get an idea ?

@labordep
Copy link
Author

labordep commented Mar 18, 2023

Thanks for your answer.
I have this :

image

I have see that the Polyphemus project is store with FileTree, I am working always with Tonel.

My config :

  • Pharo-11.0.0+build.638
  • Windows 11 Pro 22621.1105

@labordep
Copy link
Author

There is this line in the baseline :

LibC runCommand: 'git clone https://github.com/pharo-project/pharo-vm.git'.

I haven't git on my PC (And I don't want to have it).
Another potential problem ?

@hogoww
Copy link
Owner

hogoww commented Mar 18, 2023

There is this line in the baseline :

LibC runCommand: 'git clone https://github.com/pharo-project/pharo-vm.git'.

I haven't git on my PC (And I don't want to have it). Another potential problem ?

I was about to tell you, but I encountered an infinite loop while trying to load on window.
This is an optimization that reduces the load time of VMMaker by about 4 minutes.
(CI went from 10 minutes to 4 !)
This should probably check whether git is installed somehow.

@labordep
Copy link
Author

I don't understand what is the problem, having git ? loading time ?

@hogoww
Copy link
Owner

hogoww commented Mar 18, 2023

I don't understand what is the problem, having git ? loading time ?

My issue, I do not know yet.
For you, it looks like the git optimization is the issue, as it is not able to download VMMaker.

Using git instead of Pharo to clone a project is way faster.

@labordep
Copy link
Author

Ok I understand, but for me the fast is not grave, I prefer having a maximum features with Pharo. I prefer limit multiple software installations on my PC. If it's possible to do git clone with Pharo it should be the default way.

@hogoww
Copy link
Owner

hogoww commented Mar 18, 2023

Yeah, in an ideal world that would be the case !

Regardless, in the meantime, I removed the git call so you can use it.
You have to install the Pharo-Project/Pharo-VM yourself by hand so it loads :)

@hogoww hogoww closed this as completed Mar 18, 2023
@labordep
Copy link
Author

I don't know how to get the Pharo-VM project, here is what I tried but it doesn't work:

Metacello new
   baseline: 'VMMaker';
   repository: 'github://pharo-project/pharo-vm/VMMaker:pharo-10/smalltalksrc';
	onConflictUseIncoming;
	ignoreImage;
   load.

What version of the Pharo image you need, 10, 11 ?
Why you don't offer a ready to start pharo image ? Because for the moment I don't want to rebuild it but just use it :)

@hogoww hogoww reopened this Mar 23, 2023
@hogoww
Copy link
Owner

hogoww commented Mar 23, 2023

Both Pharo 10 & 11 should work, although we mostly used to work on 11.
I do not use Metacello, but this seems to work for me:

Metacello new
   baseline: 'VMMaker';
   repository: 'github://pharo-project/pharo-vm:pharo-10';
	onConflictUseIncoming;
	ignoreImage;
   load.

/!\ This is slow , my image hangs for about 10/15 minutes while loading the Pharo VM./!\

Because I have a new job and we have moved on from this project.
Also, we had a ready to start Pharo Image, which didn't work for you.
I can provide small fixes as I did, or small advices as above but there will be no long term support without a paying contract.

@labordep
Copy link
Author

Thanks @hogoww I will test to load without Wifi.

@labordep
Copy link
Author

labordep commented Mar 25, 2023

  • Good, so ~5mn in my PC to load PharoVM

Then, on Polyphemus loading I have a problem : a lot of Prompt windows opened and closed in a loop... I don't know if this is normal or not but after a lot of minutes there is no evolution... and the number of windows increase.

I have captured a video :

Video.sans.titre.Realisee.avec.Clipchamp.mp4

All window prompt are similar like that :
image

Side Pharo the loading bar is freeze during these windows :
image

Do you have this problem ?

@hogoww
Copy link
Owner

hogoww commented Mar 25, 2023

I haven't on Linux / MaxOS, but that was the issue I encountered on Windows.
I thought it was related to metacello which executes the baseline script.
Now I'm thinking it might be related to paths in windows, because I download clean P11 images on baseline.

I'll try to take a look this weekend.

@labordep
Copy link
Author

Thanks :)

@hogoww
Copy link
Owner

hogoww commented Mar 25, 2023

You should be able to load it properly now.
Some test cases will not work, as they rely on online resources that I have disabled for Windows.
Basically, I am using wget explictly, which isn't available (at least by default) on windows.

Please let me know if you encounter further issues.

@hogoww
Copy link
Owner

hogoww commented Mar 25, 2023

I just also removed another "bug", which does not affect loading per se.
But now you should not have anymore error during loading.

@labordep
Copy link
Author

labordep commented Mar 31, 2023

Thank @hogoww, it works ! I can launch Polyphemus and play with it. But the problem is that I haven't any "square" in the graphical view :/ (last tabs) I send to you a screenshot when I have the image with me.

@hogoww
Copy link
Owner

hogoww commented Mar 31, 2023

Thank @hogoww, it works ! I can launch Polyphemus and play with it.

Good :)

But the problem is that I haven't any "square" in the graphical view :/ (last tabs) I send to you a screenshot when I have the image with me.

What image are you trying to open ?
A freshly downloaded one or something specific ?
Maybe a corrupted one?

@labordep
Copy link
Author

The image that I'm trying to open is an image that I cannot start (broken).
I don't know why this image is broken, that's why I'm trying to use Polyphemus to investigate the problem and eventually remove problematic instances. I suppose that an object instance have a problem inside because I'm using libraries with FFI calls like OS-Windows.

This is Pharo 11 64bits image, created last week with some OS-Windows libraries loaded inside.

Some screenshots after start an analysis :

image

image

image

image

@Alisu
Copy link
Collaborator

Alisu commented Mar 31, 2023

Hello, in the memory scripter tab you can inspect reifiedMemory (select and ctrl + i).
There, you should have a collection of broken references if there is some, a broken reference is reified as an AbnormalObject.
You can also recreate this collection with:

self select: [:anOop | anOop isAbnormalOop ]

In the case the collection is empty, it means that Polyphemus managed to read the file in its entirety.

You can find the list of objects in the objects collection (objects are ordered by address in there and you probably wants to look at the objects at the end).

If you need more help, PM me or continue in this issue.

@hogoww
Copy link
Owner

hogoww commented Mar 31, 2023

The image that I'm trying to open is an image that I cannot start (broken).
I don't know why this image is broken, that's why I'm trying to use Polyphemus to investigate the problem and eventually remove problematic instances. I suppose that an object instance have a problem inside because I'm using libraries with FFI calls like OS-Windows.

Have you tried to execute the image with the command line ?
The command line should report whether that's a meta error of the startup, or a corrupted image.
Other than that, what Alisu said !

@labordep
Copy link
Author

labordep commented Apr 1, 2023

The image that I'm trying to open is an image that I cannot start (broken).
I don't know why this image is broken, that's why I'm trying to use Polyphemus to investigate the problem and eventually remove problematic instances. I suppose that an object instance have a problem inside because I'm using libraries with FFI calls like OS-Windows.

Have you tried to execute the image with the command line ? The command line should report whether that's a meta error of the startup, or a corrupted image. Other than that, what Alisu said !

Thanks @Alisu, I'm starting to test your instructions.
@hogoww, for answer to you, I have no messages when I launch my broken image with a PowerShell prompt.

@labordep
Copy link
Author

labordep commented Apr 1, 2023

I have done that :)

When I'm inspecting reifiedMemory (focus on objects) :

image

I have objects :)

Here the result of self select: [:anOop | anOop isAbnormalOop ] DoIt :

image

This is empty and this is a good point if I understand you.

I continue to investigate, thanks :)

@hogoww
Copy link
Owner

hogoww commented Apr 1, 2023

@hogoww, for answer to you, I have no messages when I launch my broken image with a PowerShell prompt.

Oh.
That is very surprising to me.
I have no idea of why that could be right about now... u_u.
@Alisu You got anything?

Having no "Abnormal Objects" means that there does not seem to be any corruption in this image.
So that is indeed great !

@Alisu
Copy link
Collaborator

Alisu commented Apr 1, 2023

Interesting.
A thing to do would be something similar to branch recoveryFreeListV2.
We can modify the method OopAbstractObject >> allReifiedSlots to add an halt like this:

allReifiedSlots

	| errorBlock |
	
	errorBlock := [ 1halt. memory objectAt: memory nilObject ].
	^ (1 to: self numSlots) collect: [ :anIndex | 
		  [ self reifiedSlotAt: anIndex ] onErrorDo: errorBlock ]

then in reifiedMemory run the script:

self do: [ :anOop | anOop allReifiedSlots ]

It should force the traversal of every reference in the observed image. If it halts then there is a reference pointing to something that is not an object. If it does not halt then you don't have a corrupted memory.

In the second case, it means that you, very probably, have a runtime problem. It can be a really long processing that seems like the image hang, an infinite recursion or something even different (you never know with ffi).
Unfortunately Polyphemus does not handle runtime problems as it works with a static snapshot of the memory.
I started something in the branch HackDebugger in this sense but stopped because of ressources and time.

If you arrive to this point and you really want to recover this image, I advice you to run the vm with the image with LLDB and you can ask the Pharo team to help you with that.
Once you know what is the problem (in case of infinite recursion the method causing it) you can use again Polyphemus to modify it externally.

@hogoww
Copy link
Owner

hogoww commented Apr 1, 2023

Oh, an infinite loop in the startup would make a lot of sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants