Getting information from broken image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting information from broken image

Mateusz Grotek
Hi.
Is there a way to get data from broken image. I suppose I should split
my question in two:
1. Is there a way to get source code from broken image?
2. Is there a way to get objects from broken image and put it into
another one?
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Getting information from broken image

David T. Lewis
On Wed, Jun 01, 2011 at 07:11:19AM +0200, Mateusz Grotek wrote:
> Hi.
> Is there a way to get data from broken image. I suppose I should split
> my question in two:
> 1. Is there a way to get source code from broken image?
> 2. Is there a way to get objects from broken image and put it into
> another one?

Here are a couple of links that will help with your first question:

  <http://www.youtube.com/watch?v=Q1nOqsSg8Ik>

  <http://wiki.squeak.org/squeak/2168>

Question 2 may be a little more difficult. Can you say how the image
became broken?

Dave

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Getting information from broken image

Mateusz Grotek
David T. Lewis pisze:

> On Wed, Jun 01, 2011 at 07:11:19AM +0200, Mateusz Grotek wrote:
>> Hi.
>> Is there a way to get data from broken image. I suppose I should split
>> my question in two:
>> 1. Is there a way to get source code from broken image?
>> 2. Is there a way to get objects from broken image and put it into
>> another one?
>
> Here are a couple of links that will help with your first question:
>
>   <http://www.youtube.com/watch?v=Q1nOqsSg8Ik>
>
>   <http://wiki.squeak.org/squeak/2168>
>
> Question 2 may be a little more difficult. Can you say how the image
> became broken?

The problem is old, and I've already solved it (I used become in the
wrong way). So the question is more theoretical. I donno how the image
is organized, but if it's like a filesystem maybe it would be possible
to create some tool to extract objects from it. I wondered if there is
such a tool. (I suppose the answer is no). Thanks.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Getting information from broken image

Casey Ransberger-2
Hi,

On Jun 2, 2011, at 3:12 AM, Mateusz Grotek <[hidden email]> wrote:

(big snip)

I donno how the image
is organized, but if it's like a filesystem maybe it would be possible
to create some tool to extract objects from it. I wondered if there is
such a tool. (I suppose the answer is no). Thanks.

So it's a big heap of objects, which are comprised mostly of references to other objects. 

I struggled quite a bit at first to map the persistent object memory onto something that I could really recognize, like a filesystem. 

I'm not sure how useful this metaphor is, but here's a try: it's almost like a filesystem in which almost everything is a symbolic link to something else, if you envision the objects as analogous to directories. Oh, and there are cyclical references going on, I don't think the weak metaphor I'm using here can hold that part up very well:)

I can't say anything of real use WRT extracting stuff from a completely hosed image; I've needed at least a recovery console to open in order to make it back to a state that I can recover objects from. Basically the image format is currently beyond my experience, but if I wanted to find out how it works, the first thing I would try is pulling down VMMaker and looking at the Slang code for the object memory itself. This could be terrible advice though, so I'd go for a second opinion if I was you:)

If just you want to move some objects between two images, you might want to check out SmartRefStream. 

I've also longed to see some tools for image exploration/visualization. I'm really excited about the work of Craig Latta in this area. I would strongly recommend that you check out Spoon when you can. 

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re[2]: [Newbies] Getting information from broken image

Herbert König
In reply to this post by Mateusz Grotek
Hi Mateusz,

>>> 2. Is there a way to get objects from broken image and put it into
>>> another one?
http://lists.squeakfoundation.org/pipermail/vm-dev/2010-August/005242.html
might help. It describes the format of the image fileand it from the thread
"[squeak-dev] reading objects of a dead image" on Squeak dev from May
14th 2011.

I seem to remember there was a discussion about a tool to do this but
my Google fu was not strong enough.

--
Cheers,

Herbert  

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Getting information from broken image

Mateusz Grotek
> http://lists.squeakfoundation.org/pipermail/vm-dev/2010-August/005242.html
> might help. It describes the format of the image fileand it from the thread
> "[squeak-dev] reading objects of a dead image" on Squeak dev from May
> 14th 2011.
>

Thanks.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Getting information from broken image

David T. Lewis
In reply to this post by Mateusz Grotek
On Thu, Jun 02, 2011 at 12:12:17PM +0200, Mateusz Grotek wrote:

> David T. Lewis pisze:
> > On Wed, Jun 01, 2011 at 07:11:19AM +0200, Mateusz Grotek wrote:
> >> Hi.
> >> Is there a way to get data from broken image. I suppose I should split
> >> my question in two:
> >> 1. Is there a way to get source code from broken image?
> >> 2. Is there a way to get objects from broken image and put it into
> >> another one?
> >
> > Here are a couple of links that will help with your first question:
> >
> >   <http://www.youtube.com/watch?v=Q1nOqsSg8Ik>
> >
> >   <http://wiki.squeak.org/squeak/2168>
> >
> > Question 2 may be a little more difficult. Can you say how the image
> > became broken?
>
> The problem is old, and I've already solved it (I used become in the
> wrong way). So the question is more theoretical. I donno how the image
> is organized, but if it's like a filesystem maybe it would be possible
> to create some tool to extract objects from it. I wondered if there is
> such a tool. (I suppose the answer is no). Thanks.

This may not really be a beginners topic, but in principle you can
operate on your broken image, and potentially get access to the objects
in it. The Squeak virtual machine (the executable program that runs your
image file) is actually written mainly in Squeak (but translated to C
for speed). This is described in an important paper that every new
Squeak user should take a moment to read:
  http://ftp.squeak.org/docs/OOPSLA.Squeak.html

The Squeak virtual machine (VM), written in Squeak, along with some
classes and methods that take the place of the "platform support code"
(high performance code usually written in C to interface the VM to
the operating system, such as Windows or Linux), give you a Squeak
program that we refer to as the "Interpreter Simulator", which basically
means the VM itself running within Squeak. All of this code was
originally distributed in early Squeak images as part of the base
system, but nowadays is maintained separately in the VMMaker package
on www.squeaksource.com.

How does all of this relate to your question? If you have a valid
image file on your disk, as opposed to a corrupt file, and if this
image has some sort of problem caused by using #become in a bad
way (who among us has not tried that?), then in principle you can
load that image file into an InterpretSimulator in another Squeak
image. Once loaded, the VM and the object memory and all of the
objects in your broken image are available to be explored and
manipulated directly in Squeak. So the tool for exploring your
broken image file is .... Squeak itself.

To be realistic, you probably will never actually use this approach,
at least not unless your broken image contains some very valuable
objects, because exploring your image in this way will require
some real knowledge and experience. But it is possible, and it
is at least interesting to know that you could do such a thing
if you have enough curiosity and patience to undertake it.

Dave


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
bpi
Reply | Threaded
Open this post in threaded view
|

Re: Getting information from broken image

bpi
In reply to this post by Mateusz Grotek
Hi Mateusz,

Yoshiki Ohshima created a tool called ImageBrowser to read an image file in 2002. I don't know if it works in a current image. See the following links:
http://thread.gmane.org/gmane.comp.lang.smalltalk.squeak.general/96105
http://map.squeak.org/package/92e8f376-ba20-4c38-8b3a-abfb2bf24624

Cheers,
Bernhard

Am 01.06.2011 um 07:11 schrieb Mateusz Grotek:

> Hi.
> Is there a way to get data from broken image. I suppose I should split
> my question in two:
> 1. Is there a way to get source code from broken image?
> 2. Is there a way to get objects from broken image and put it into
> another one?
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Getting information from broken image

Yoshiki Ohshima-2
At Tue, 7 Jun 2011 13:21:25 +0200,
Bernhard Pieber wrote:
>
> Hi Mateusz,
>
> Yoshiki Ohshima created a tool called ImageBrowser to read an image file in 2002. I don't know if it works in a current image. See the following links:
> http://thread.gmane.org/gmane.comp.lang.smalltalk.squeak.general/96105
> http://map.squeak.org/package/92e8f376-ba20-4c38-8b3a-abfb2bf24624

  Oh, yes.  I remember that.  Thank you.  Theoretically, you can take
full code diff by using it.  Also, perhaps starting from
http://www.squeaksource.com/MethodAuthorship.html, you can load one
version of .sources and .changes and then load another and see the
diff, maybe.

-- Yoshiki
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners