Hello, I would just like to report something that happened to me today."ient; width: 1. graphic strokeStyle: _strokeStyle" So, reportedly, the name of the method was "ient;" ... Basically I had many methods where the source code was just random chunks of other methods. The funnier thing is that everything worked perfectly fine during execution. I tried to look at different backup images I had to see when everything began to go wrong and I realised I had been working with broken source code for about a week. So if I understand correctly, I probably messed up with the .changes file (I don't remembr how but maybe I copied the .image without the .changes or renamed the .image or i don't know). And now the compiled code is okay but the source code is lost so everything is working fine until the system tries to recompile everything ? Now my question is : is there a way to fix the issue ? I tried exporting the package to a .mcz but I had bugs everywhere. I imported the old working package to an .mcz and tried browsing the differences with the broken one just to manually get back eveything I changed during this week. But I couldn't cause there were bugs everytime I tried to browse the changes. Basically, are all my changes definitely lost or is there a way to get it back somehow (at least the raw source code) ? I know that I fucked up and this is my fault but it would have been nice if something (anything) told me earlier that I did something wrong. I've been adding / modifying lots of methods and even executing the program for a week now and absolutely nothing told me that something was wrong until I tried adding an instance variable. I am in a situation where I actually wrote and "saved" code and now it seems lost... that's frustrating :( Thanks, Matthieu |
2015-07-06 9:55 GMT+02:00 Matthieu Lacaton <[hidden email]>:
What image version did you use?
Maybe you can iterator over all methods decompile, and save as new code? Maybe you can open the image without the changes file and try to create a package or file out the package?
No, not your fault, this should not happen. The changes file is for "recover if you messed up the image". If the changes file gets corrupted, then this is a serious bug.
|
What image version did you use? I used number 50074
I manually looked inside many of my .changes with Notepad++ and I couldn't find any of the related methods. If I open the image without the changes file I can't export anything. By the way, when I try the "Recover lost changes" from inside the image I cannot go back very far. I have a big .changes with about 200 snapshots but I can only go back to the last ~~ 20s or so. Is it normal ? It's the first time I use the .changes file so I don't really know how it works. No, not your fault, this should not happen. The changes file is for "recover if you messed up the image". If the changes file gets corrupted, then this is a serious bug. Well I really don't know :s The only thing I can tell is that I have an image with some totally broken "written" methods but their execution works just fine. The "normal" source code of these methods apparently is nowhere to be found. However, inside the .changes some more recent methods are correctly registered so the problem probably happened only once with a bunch of methods I wrote at a given time (actually broken methods are not methods I wrote entirely but methods I changed). I did some testings and I found a way to reproduce what I experienced :If you manually rename an image without renaming the .changes you cannot browse the code inside Nautilus without getting errors. However, you can use the finder just fine to find any method. These methods are decompiled methods (with variable names in t1 t2 etc.) but you can modify them without getting errors. Then you can save your image and it works fine. Now if you rename the image to the name it had in the first place you can use it properly but the method you modified in between will be broken at some point. But to be honest, even if it kinds of reproduce my problem I am not sure this is what i did. Maybe I manually renamed the image, that's definitely possible, but i don't remember re-renaming it to its prior name. Moreover, when doing so you end up with a new .changes file which is very small and has the source code of the methods you modified and I don't have any small .changes file. I am still quite unsure at this point. 2015-07-06 10:36 GMT+02:00 Nicolai Hess <[hidden email]>:
|
2015-07-06 14:39 GMT+02:00 Matthieu Lacaton <[hidden email]>:
There is a hard-coded limit in the recover last changes. Last time I had to help someone do a difficult recovery, I had to change that limit in a method somewhere... don't remember which one. Don't trust the changes anyway. It's bound to be replaced. The strategy I suggest is: - Use Monticello and makes frequent saves of your packages - Practice rebuilding your image: write a script or a makefile which loads everything and set your settings. -> Better still: include both your build script and your packages inside the same repository so that they can be versionned together. Git works very well this way, and you can use filetree or GitFileTree for that.
Looks like a set of shifted source pointers. If you dare, what you could do is regenerate the source for all those methods by decompilation and recompiling them. You would get all thoses t2, t3 etc... but you would be then able to redocument them at your rythm (and get Nautilus working again).
If you find any way to confirm what you did, please share. Maybe there is a bug somewhere and, given the consequences, we need to correct it. Thierry |
In reply to this post by Matthieu
Mathieu
This is really strange, I also got the same problem a couple of weeks ago. I imgaine that you are working with a 50 image. We may have introduced a regression. As a general principle I tried to publish often. Now you can also get in this situation when you open twice the same image and do parallel edits. Can you open your change file with emacs and see a bit the code? Stef Le 6/7/15 09:55, Matthieu Lacaton a écrit : > Hello, > > I would just like to report something that happened to me today. > > As I was working on a project, I tried inserting an instance variable > to one of my classes. > Starting from this moment something became very weird. First, some > subclasses were not listed as subclasses anymore, then I realised > during the execution that allocating my new instance variable was > actually modifying another instance variable. > > I tried digging up a bit and I found out that many of my methods were > a complete mess. > When browsing with Nautilus the title of the method was for example: > "addProperty:key:". However the corpse of the method was totally > random with something like that for example: > "ient; > width: 1. > graphic strokeStyle: _strokeStyle" > > So, reportedly, the name of the method was "ient;" ... > > Basically I had many methods where the source code was just random > chunks of other methods. > > The funnier thing is that everything worked perfectly fine during > execution. > > I tried to look at different backup images I had to see when > everything began to go wrong and I realised I had been working with > broken source code for about a week. > > So if I understand correctly, I probably messed up with the .changes > file (I don't remembr how but maybe I copied the .image without the > .changes or renamed the .image or i don't know). > And now the compiled code is okay but the source code is lost so > everything is working fine until the system tries to recompile > everything ? > > Now my question is : is there a way to fix the issue ? I tried > exporting the package to a .mcz but I had bugs everywhere. I imported > the old working package to an .mcz and tried browsing the differences > with the broken one just to manually get back eveything I changed > during this week. But I couldn't cause there were bugs everytime I > tried to browse the changes. Basically, are all my changes definitely > lost or is there a way to get it back somehow (at least the raw source > code) ? > > I know that I fucked up and this is my fault but it would have been > nice if something (anything) told me earlier that I did something > wrong. I've been adding / modifying lots of methods and even executing > the program for a week now and absolutely nothing told me that > something was wrong until I tried adding an instance variable. > > I am in a situation where I actually wrote and "saved" code and now it > seems lost... that's frustrating :( > > Thanks, > > Matthieu |
In reply to this post by Matthieu
Mathieu
if your image is running and your tests are green then we should be able to recover the decompiled version.
This is normal: the image is executing bytecodes and it uses the source files (changes) only for us the human ie when we open a tool that requires showing text. when we do so if the sources is not available, the system decompile the bytecodes and present to us a version based on bytecodes. Stef
|
This is really strange, I also got the same problem a couple of weeks ago. I imgaine that you are working with a 50 image. Yes, image number 50074. Now you can also get in this situation when you open twice the same image and do parallel edits. Yesterday I spent some time looking inside the .changes to try to understand and reproduce what I did. Apparently, from what I understood in the .changes file, it seems like I managed to somehow open twice the same image and save both of them under different names. So basically the image I opened first is working correctly and the one I opened second is not because it couldn't write in the .changes file. Now, I'm pretty sure I didn't really work with twice the same image, however, I remember clearly that while I was working on this image, I wanted to open another one and I failed and I opened the same one. When I saw the warning message I realized what I did and wanted to close the image. But here I failed again and I hit "save and quit" instead of just "quit". I still have this image in this state and everytime I open it I can see the warning message fading. Now i'm not sure what it means inside the .image. So, what I think I did was : 1) Opened an image and made some changes and executed them. 2) Opened the same image and immediately hit "save and quit" 3) Continued working with the 1rst image and then saved it with another name. However, I can never reproduce anything when I try. Either nothing bad happens either Pharo tells me it cannot write in a read-only file. Another thing I don't understand is that I have two images that come from the same initial one but there is never any mention of a quit and / or startup in the .changes file. .changes of B : ----SNAPSHOT----2015-06-30T09:35:50.61325+02:00 A.image priorSource: 13729471! List of changes ... ----SNAPSHOT----2015-06-30T09:47:17.45725+02:00 B.image priorSource: 13734344! Some other changes ... etc. .changes of C : ----SNAPSHOT----2015-06-30T09:35:50.61325+02:00 2015-06-30_A.image priorSource: 13729471! List of changes ... (exactly the same ones than above) ----SNAPSHOT----2015-06-30T14:15:02.7975+02:00 C.image priorSource: 13740384! ----SNAPSHOT----2015-06-30T14:16:46.1275+02:00 C.image priorSource: 13740384! ----STARTUP----2015-06-30T14:26:03.18475+02:00 as D:\MyPath\C.image! Some other changes ... (different from the ones above) So what bothers me is that after saving the A.image to B.image I also saved A.image to C.image but there is no mention of a Startup of A.image in between. Also I don't know what the "priorSource" means. So I still don't really know :( if your image is running and your tests are green then we should be able to recover the decompiled version. I found an image which had the decompiled version in it so I backed up everything and I should be fine now :) Thanks ! But i'd still like to find a way to reproduce this for the record. Okay, thank you for the explanations. I find it funny, however, that in this situation Nautilus does not allow me to do anything whereas I can do (almost ?) everything I want with the finder.This is normal: 2015-07-06 21:40 GMT+02:00 stepharo <[hidden email]>:
|
Free forum by Nabble | Edit this page |