I inadvertantly created a class method #icon that returned nothing.
When I execute this method it crashes Dolphin both in 3.0 and 4.0. If you try it, do not save your image. Just end task Dolphin. This crashes Dolphin (or anything that returns self I assume): icon Icon fileName: 'c:\some.ico' This works ok: icon ^Icon fileName: 'c:\some.ico' I actually ended up restoring a backup image (since I had saved it before testing). Costas [hidden email] |
Costas,
> I inadvertantly created a class method #icon that returned nothing. > When I execute this method it crashes Dolphin both in 3.0 and 4.0. > > If you try it, do not save your image. Just end task Dolphin. > > This crashes Dolphin (or anything that returns self I assume): This is *not* a bug, serious or otherwise? You are just overriding an existing class side method incorrectly. The system uses the #icon method to determine which icon to display for a particular class in the browsers etc. In Smalltalk there are lots of things that you can do to an image to destroy it. This is because the power of Smalltalk comes from letting you modify anything, including the development environment, for better or for worse. As an example, here's something else you can crash your image with. Try: Processor := nil. Best regards, Andy Bower Dolphin Support http://www.object-arts.com --- Visit the Dolphin Smalltalk Wiki Web http://www.object-arts.com/wiki/html/Dolphin/FrontPage.htm --- |
>
>This is *not* a bug, serious or otherwise? You are just overriding an >existing class side method incorrectly. The system uses the #icon method to >determine which icon to display for a particular class in the browsers etc. > >In Smalltalk there are lots of things that you can do to an image to destroy >it. This is because the power of Smalltalk comes from letting you modify >anything, including the development environment, for better or for worse. As >an example, here's something else you can crash your image with. Try: > >Processor := nil. I will beg to differ and say in this case it is a serious bug and it is due to lack of proper validation. The Processor:=nil is too obvious and anyone who does that is playing games. But I didn't expect an empty method created in my own class to crash Dolphin. I think a user mistake like that should be trapped gracefully where possible. Who knows, I could make methods as placeholders in my classes. Are there other known methods that behave this way? What is the rule of thumb? Costas |
Costas,
> I will beg to differ and say in this case it is a serious bug and it > is due to lack of proper validation. > > The Processor:=nil is too obvious and anyone who does that is playing > games. But I didn't expect an empty method created in my own class to > crash Dolphin. > > I think a user mistake like that should be trapped gracefully where > possible. Who knows, I could make methods as placeholders in my > classes. I respectfully disagree. One cannot protect against every modification that a programmer might make. Tests that might protect in this case will affect the performance of all development tools, and probably deployed apps as well. Even with that overhead imposed, there would still leave many more would-be traps. Backups are the best insurance against lost work. Have a good one, Bill -- Wilhelm K. Schwab, Ph.D. [hidden email] |
Hi Bill,
> >I respectfully disagree. One cannot protect against every modification that >a programmer might make. Tests that might protect in this case will affect >the performance of all development tools, and probably deployed apps as >well. Even with that overhead imposed, there would still leave many more >would-be traps. Backups are the best insurance against lost work. > Believe me, I've been making backups religiously. I am probably going to write a program that automates it from inside Dolphin. Thanks for your advice. Costas |
Free forum by Nabble | Edit this page |