Mantis Bugtracker

ID Category Severity Reproducibility Date Submitted Last Update
0007456 [Squeak] Files major always 01-17-10 05:55 04-18-10 21:58
Reporter wiz View Status public  
Assigned To leves
Priority urgent Resolution fixed  
Status closed   Product Version trunk
Summary 0007456: In sq 8864 evaluating 'FileDirectory default = nil' causes an MNU #pathName

For this one evaluate
'FileDirectory default = nil'
in a workspace .

By comparison

'nil = FileDirectory default'
 evaluates to false

Additional Information This is the bug that prompted report 0007445.

The culprit is

'ar 10/4/2009 22:22 FileDirectory = {comparing}'

Which is assuming the argument is also a file directory.

= has a duty to take on all comers.

To make the problem clearer I have given it a separate report.

This bug is also telling us that there ought to be a test for #= that tries out all receivers.

Which is telling us that all classes need to respond safely to some message like
MyClass testInstance .

Vaguely, this could be done by a class returning a safe initialized instance of itself. Or if no such thing exists returning a initialized instance of a safe Mock subclass. I haven't worked out the details of this idea because it is a new one.

Attached Files  EquivBugTest-wiz.1.cs [^] (1,745 bytes) 02-12-10 04:04

- Relationships
has duplicate 0007445closed andreas In 8864 Saveing a project can still hang (4th bug and counting) 

- Notes
(0013485 - 60 - 60 - 60 - 60 - 60 - 60)
01-17-10 05:57

Reminder sent to: andreas

This is the problem you need to solve for 7445. Cheers --Jer
(0013494 - 244 - 268 - 268 - 268 - 268 - 268)
nicolas cellier
01-27-10 18:06

I agree we should protect =
However I never used x = nil. Is this code in image ?
Either I use (x isNil) or (x == nil) which is also used by (x ifNil: [])

That's why qualifying the bug as major or priority as urgent is a bit exagerated IMO
(0013495 - 1246 - 1402 - 1402 - 1402 - 1402 - 1402)
01-27-10 20:55
edited on: 01-27-10 20:56

Hi Nicolas,

The general problem is the form:

anObject = anObjectOfADifferentClass
sometimes raises an error.

In this case the offending receiver class is FileDirectory.

My choice of nil as the second object was to simplify the test that demonstrates the problem. The instance were I actually came across the report is in the other report.

The invariant should be that comparing two objects via #= should always work giving a Boolean. If it doesn't then the order of the arguments becomes critical.

Jocularly, if you can't compare something to the undefined object what can you compare it to?

In squeak #= is not automatically commutative. This requires awareness and care on the part of the coders.

Currently FileDirectory can only be compared to other FileDirectories. Or you have to insure that the file directory is the argument not the receiver. Otherwise it invokes the debugger. That is a solid enough bug in my book.

The importance and urgency to me is this. If we have one of these in the image and we don't know when it will crop up, we have a very brittle image subject to unexpected failures. Plus it will mask other bugs that need finding as well.

Yours in service and curiosity, --Jerome Peace

(0013508 - 753 - 867 - 867 - 867 - 867 - 867)
02-12-10 04:19

Uploaded a test designed to fail until the problem is fixed.

This is simply a unit test built from the example given above.

If this doesn't pass the problem isn't fixed. So it is a necessary test.

It is not a comprehensive test, just specific to FileDirectory.

The comprehensive test would take a test instance of each class then send #= and #~ to each.

I am proposing that a #testInstance selector be added to the language.

The idea is it would provide a testable default instance of each class. Untestable (dangerous classes) are required to return nil instead of a default instance. All other classes should return something like a initialized instance.

The backup in Object and ProtoObject would be to return nil.
(0013519 - 14 - 14 - 14 - 14 - 14 - 14)
02-28-10 21:30

Fixed in 9552.

- Issue History
Date Modified Username Field Change
01-17-10 05:55 wiz New Issue
01-17-10 05:56 wiz Relationship added has duplicate 0007445
01-17-10 05:57 wiz Issue Monitored: andreas
01-17-10 05:57 wiz Note Added: 0013485
01-27-10 18:06 nicolas cellier Note Added: 0013494
01-27-10 20:55 wiz Note Added: 0013495
01-27-10 20:56 wiz Note Edited: 0013495
02-12-10 04:04 wiz File Added: EquivBugTest-wiz.1.cs
02-12-10 04:19 wiz Note Added: 0013508
02-28-10 21:30 leves Status new => resolved
02-28-10 21:30 leves Fixed in Version  => trunk
02-28-10 21:30 leves Resolution open => fixed
02-28-10 21:30 leves Assigned To  => leves
02-28-10 21:30 leves Note Added: 0013519
04-18-10 21:58 andreas Status resolved => closed

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