Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007709 [Squeak] System minor always 12-21-12 14:15 01-25-13 23:04
Reporter Lars View Status public  
Assigned To FrankShearar
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0007709: Image Segments can't be written to file anymore
Description ImageSegment new
    copyFromRoots: (Array with: TestCase) sizeHint: 100;
    extract;
    writeToFile: 'TestCase';
    yourself
raises an error in writeToFile: aName because the standard nextPutAll: tactic has changed. The assumption is, that any file will be written with either aByteArray or some UTF8-String.

The forward solution of appending MultiByteFileStream>>nextPutAll: is attached.
Additional Information
Attached Files  MultiByteFileStream-nextPutAll.st [^] (472 bytes) 12-21-12 14:16

- Relationships

- Notes
(0014272 - 55 - 55 - 55 - 55 - 55 - 55)
FrankShearar
01-01-13 22:04

In the Inbox as Multilingual-fbs.157 and Tests-fbs.177.
 
(0014297 - 51 - 51 - 51 - 51 - 51 - 51)
FrankShearar
01-25-13 15:45

In Trunk as Tests-fbs.186 and Multilingual-fbs.157.
 
(0014298 - 376 - 388 - 388 - 388 - 388 - 388)
Lars
01-25-13 16:11

Thanks for accepting the fix.
I'm not sure whether the testcase is ok. When stepping through the test case, it took a different path (maybe also different to the one it would take if not stepped through), and thus ended up never calling nextPutAll. I'd suggest creating a segment of another class, e.g. ScriptLoader, any class that is not referenced on the stack.
Best, Lars
 
(0014299 - 147 - 159 - 159 - 159 - 159 - 159)
FrankShearar
01-25-13 16:14

Hm, OK. I saw the test fail before applying the fix and pass afterwards.

Would you mind giving me a test that you think would be representative?
 
(0014300 - 300 - 428 - 428 - 428 - 428 - 428)
Lars
01-25-13 16:18

Just switch the exportet TestCase for ScriptLoader:

ImageSegment new
    copyFromRoots: (Array with: ScriptLoader) sizeHint: 100;
    extract;
    writeToFile: 'ScriptLoader';
    yourself

Oh, and while you're at it, you may want to delete the created file (ScriptLoader.seg) after success.
 
(0014301 - 38 - 38 - 38 - 38 - 38 - 38)
Lars
01-25-13 16:19

but only after access ScriptLoader ...
 
(0014302 - 294 - 325 - 325 - 325 - 325 - 325)
FrankShearar
01-25-13 17:41

I must be missing something. Both seem to trigger the bug in the same way, in that some bit somewhere doesn't understand #asUnicode. I can see in both cases that MultiByteFileStream >> #nextPutAll: on the call stack.

"but only after access ScriptLoader ..." <-- I also don't understand this.
 
(0014303 - 630 - 666 - 666 - 666 - 666 - 666)
Lars
01-25-13 22:13

Sorry for answering so late, but I got interrupted and had work ...

When I stepped through the test case, while exporting TestCase, the instance variable status was set to #inactive. Because of that, exporting always aborted early. I assumed, the status #inactive as opposed to the expected #active was due to my stepping through a subclass of TestCase.

If you saw it call nextPutAll, everything is fine. My bad, sorry.

The last comment, was because ImageSegments is meant to export classes into files, removing them from the Image. If you delete the file before reloading the class, the image might break, shouldn't it?
 
(0014304 - 198 - 210 - 210 - 210 - 210 - 210)
FrankShearar
01-25-13 23:04

Certainly if you delete them injudiciously you can get into a very nasty state, as I discovered!

OK, so I think we just leave the issue as is, unless you can think of anything else we might need?
 

- Issue History
Date Modified Username Field Change
12-21-12 14:15 Lars New Issue
12-21-12 14:16 Lars File Added: MultiByteFileStream-nextPutAll.st
01-01-13 22:03 FrankShearar Status new => assigned
01-01-13 22:03 FrankShearar Assigned To  => FrankShearar
01-01-13 22:04 FrankShearar Note Added: 0014272
01-01-13 22:04 FrankShearar Status assigned => testing
01-25-13 15:45 FrankShearar Status testing => resolved
01-25-13 15:45 FrankShearar Fixed in Version  => trunk
01-25-13 15:45 FrankShearar Resolution open => fixed
01-25-13 15:45 FrankShearar Note Added: 0014297
01-25-13 16:11 Lars Note Added: 0014298
01-25-13 16:14 FrankShearar Note Added: 0014299
01-25-13 16:18 Lars Note Added: 0014300
01-25-13 16:19 Lars Note Added: 0014301
01-25-13 17:41 FrankShearar Note Added: 0014302
01-25-13 22:13 Lars Note Added: 0014303
01-25-13 23:04 FrankShearar Note Added: 0014304


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
72 total queries executed.
47 unique queries executed.
Powered by Mantis Bugtracker