corrupted changes file indices?

Tim Olson tim at jumpnet.com
Thu Apr 22 14:41:39 UTC 1999


In checking out the report of corrupted sources some more, I think that 
there is a problem.  I just downloaded the latest sea archive of 2.4a and 
still found a bunch of methods being displayed incorrectly.

The first corruption occurs in the Squeak2.4a.changes file for 
B3DRotation>>a:b:c:d: , and everything else after that seems to be off by 
19 bytes.  Could the indicies have been computed with a source having 
CRLF's in it, then later the LFs were stripped without updating the 
indicies in the compiledMethods?


Here's some code to fix up the incorrect indicies:

---- cut here ----
totalFixes _ 0.
parser _ Parser new.
f _ FileStream readOnlyFileNamed: 'Squeak2.4a.changes'.
Smalltalk allBehaviorsDo:
	[:c |
	c selectorsDo:
		[:s |
		m _ c compiledMethodAt: s.
		m fileIndex = 2 ifTrue:
			[oldPos _ m filePosition.
			delta _ 0.
			found _ false.
			[found] whileFalse:
				[[f position: oldPos + delta - 2. f peek = $!] whileFalse: [delta _ 
delta - 1].
				f position: oldPos + delta.
				tryStr _ f nextChunk.
				trySel _ parser parseSelector: tryStr.
				f position: oldPos + delta.
				trySel = s 
					ifTrue:
						[found _ true.
						delta = 0 ifFalse:
							[Transcript show: 'fix up ', c printString, '>>',
          s printString, ' by ', delta printString; cr.
							m setSourcePosition: oldPos+delta inFile: m fileIndex.
							totalFixes _ totalFixes + 1]]
					ifFalse: [delta _ delta - 1.
							Transcript show: 'didn''t match ', trySel printString,
          '; trying ', c printString, '>>', s printString,
          ' another time with ', delta printString; cr]]]]].
Transcript show: 'total fixes: ', totalFixes printString; cr.
---- cut here ----

With this, I get 

          total fixes: 9965

     -- tim





More information about the Squeak-dev mailing list