Skip to content

Commit 909c33a

Browse files
jgarzikclaude
andcommitted
Update bugs.md with fixes #23-#27 and known issues
Documented: range repr, recursive repr, except-tuple, list overflow, list kwargs. Added known issues: GMP crash, __iter__ dunder-to-slot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a330d39 commit 909c33a

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

bugs.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,42 @@
111111
**Root cause**: list_contains only tried element's __eq__, not value's reflected __eq__
112112
**Fix**: Added `.try_reflected` path in list_contains
113113

114+
### 23. range repr/str not implemented (iter.asm)
115+
**Symptom**: `str(range(1000))` returns SmallInt 0, crashing BINARY_SLICE
116+
**Root cause**: range_obj_type had `tp_repr = 0` and `tp_str = 0`
117+
**Fix**: Implement range_obj_repr producing "range(start, stop[, step])" format
118+
119+
### 24. Recursive list repr crashes (repr.asm)
120+
**Symptom**: `a=[]; a.append(a); repr(a)` → infinite recursion → crash
121+
**Root cause**: No recursion detection in list_repr
122+
**Fix**: Add global repr_stack, check/push/pop around repr, return "[...]" on cycle
123+
124+
### 25. except tuple matching broken (exception.asm)
125+
**Symptom**: `except (MemoryError, OverflowError)` never matches
126+
**Root cause**: exc_isinstance only handled single type arg, not tuples
127+
**Fix**: Check if type arg is tuple, iterate elements recursively
128+
129+
### 26. list * maxsize OOM crash (list.asm)
130+
**Symptom**: `[0] * sys.maxsize` → fatal OOM instead of OverflowError
131+
**Root cause**: No overflow check before huge allocation in list_repeat
132+
**Fix**: Add `jo` (signed overflow) check + 256M item limit, raise OverflowError
133+
134+
### 27. list() accepts keyword args (list.asm)
135+
**Symptom**: `list(sequence=[])` returns `[]` instead of TypeError
136+
**Root cause**: list_type_call didn't check kw_names_pending
137+
**Fix**: Check kw_names_pending, raise TypeError if set
138+
114139
### Known Bugs Not Yet Fixed
140+
- GMP crash during test_constructors in full test suite (memory corruption in int_mul)
115141
- `dict.update(x=1, y=2)` with kwargs segfaults (methods.asm)
116142
- `repr(d.keys())` returns wrong value (dict view repr not implemented)
117143
- `(1,1) in d.items()` fails (dict_items __contains__ not implemented)
118144
- `tuple(t) is t` identity optimization not implemented
119-
- `list.append()` no-args segfaults (method arg count validation missing)
120-
- `assertRaises(fn)` double-free crash (exception handling memory issue)
121145
- `issubclass(C, (C,))` always returns False (tuple arg not supported)
122146
- `isinstance(1, 1)` doesn't raise TypeError (input validation missing)
123147
- `issubclass(1, int)` segfaults (input validation missing)
124148
- `func.__name__ = "x"` silently ignored (attribute set on functions not supported)
149+
- User-defined `__iter__` dunder not connected to tp_iter slot on heaptypes
125150

126151
## New Infrastructure Added
127152
- `list_copy()` - standalone shallow copy function

0 commit comments

Comments
 (0)