Anonymous | Login | 02-27-2021 22:24 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0006720 | [Squeak] Tools | major | always | 10-10-07 22:36 | 12-17-10 22:17 | ||||
Reporter | nicolas cellier | View Status | public | ||||||
Assigned To | |||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.10 | ||||||
Summary | 0006720: Using twice the same block argument names and auto accepting temps can put the Debugger in a mess | ||||||||
Description |
Debugger can get completely lost about temporary variable slots when we use several time the same names for block args AND when we auto accept to declare a temporary. HOW TO REPRODUCE? Open a browser, say on Object, and accept following method (see below). Declare warningMessage as a temporary when you are asked to do so. Then execute (nil testWeirdDebuggerCase), open a debugger when assertion fails and inspect the temps... OUCH If you doIt in a workspace, or accept with well declared temps, the bug does not show. What the tricky kind it must be! testWeirdDebuggerCase | compareSelectors theNaN anotherNaN comparand brokenMethods | compareSelectors := #(#< #<= #> #>= #=). theNaN := Float nan. anotherNaN := Float infinity - Float infinity. comparand := {1. 2.3. Float infinity. 2/3. 1.25s2. 2 raisedTo: 50}. comparand := comparand , (comparand collect: [:e | e negated]). comparand := comparand , {theNaN. anotherNaN}. "do a first pass to collect all broken methods" brokenMethods := Set new. comparand do: [:comp | compareSelectors do: [:op | (theNaN perform: op with: comp) ifTrue: [brokenMethods add: (theNaN class lookupSelector: op)]. (comp perform: op with: theNaN) ifTrue: [brokenMethods add: (comp class lookupSelector: op)]]. (theNaN ~= comp) ifFalse: [brokenMethods add: (theNaN class lookupSelector: #~=)]. (comp ~= theNaN) ifFalse: [brokenMethods add: (comp class lookupSelector: #~=)]]. "build a warning message to tell about all broken methods at once" warningMessage := String streamContents: [:s | s nextPutAll: 'According to IEEE 754 comparing with a NaN should always return false, except ~= that should return true.'; cr. s nextPutAll: 'All these methods failed to do so. They are either broken or call a broken one'. brokenMethods do: [:e | s cr; print: e methodClass; nextPutAll: '>>'; print: e selector]]. "Redo the tests so as to eventually open a debugger on one of the failures" brokenMethods := Set new. comparand do: [:comp | compareSelectors do: [:op | self assert: (theNaN perform: op with: comp) = false description: warningMessage. self assert: (comp perform: op with: theNaN) = false description: warningMessage]. self assert: (theNaN ~= comp) description: warningMessage. self assert: (comp ~= theNaN) description: warningMessage]. |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
45 total queries executed. 36 unique queries executed. |