Summary
printing of circular objects does not terminate when shown by `describe'
Metadata
- Id: 0cf0b6602dd9b1cebb979c7f33ad7be36b2baf4b
- Trac id: 117
- Type: defect
- Reporter: felix
- Owner: ckeen
- Cc:
- Status: closed
- Component: core tools
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone:
- Version: 4.5.x
- Changetime: 2011-04-04 08:31:00 UTC
- Created: 2009-11-12 15:54:02 UTC
- Keywords: csi describe
Attachments
- 0cf0b6602dd9b1cebb979c7f33ad7be36b2baf4b/attachments/bug-117.diff
- 0cf0b6602dd9b1cebb979c7f33ad7be36b2baf4b/attachments/circular.patch
Description
In `csi`, describing an object containing circular data will result in non-termination.
Changes and comments
[2009-12-01 15:29:00 UTC] felix removed milestone 4.3.0
[2010-05-27 22:33:29 UTC] ckeen changed status from new to accepted
[2010-05-27 22:33:29 UTC] ckeen set owner to ckeen
[2010-05-27 22:33:29 UTC] ckeen wrote:
Ok, testcases:
(define p '( a . b)) (set! (cdr p) p) (define l (cons 'c p))
With the patch: #;1> ,d l circular list: c -> a -> a (circle) #;2> ,d p circular list: a -> a (circle)
I think, that this does ease the situation, although there might be cases where this does not do the right thing?
[2010-05-27 22:34:39 UTC] ckeen attached bug-117.diff (description=bugfix proposal)
[2010-05-27 22:37:39 UTC] ckeen changed status from accepted to assigned
[2010-05-27 22:37:39 UTC] ckeen changed owner from ckeen to felix
[2010-05-31 11:46:29 UTC] felix wrote:
Thanks! Added in e6eb2d2 (exp.).
Note thar this will still fail:
#;> (define x '(1)) #;> (set-car! x x)
[2010-05-31 11:46:47 UTC] felix set keywords to csi describe
[2010-05-31 11:46:47 UTC] felix changed version from 4.2.x to 4.5.x
[2010-05-31 11:46:47 UTC] felix set milestone to 4.6.0
[2010-05-31 12:35:03 UTC] ckeen changed owner from felix to ckeen
[2010-05-31 12:35:03 UTC] ckeen wrote:
I am not sure about the best way to fix this. There are at least two ways I see:
1. Extend circular-list? to detect circular cars 2. Add checks for the list? and pair? cases, which would mean to either
a) extend descseq and make the pair? case use that b) make a standalone check procedure and have that used also by descseq
so basically this would work the same as the code I have proposed for circular lists: Collect all car's and check that the car's are not eq?.
[2010-06-15 12:20:25 UTC] ckeen wrote:
The circular.patch (attached) works on lists that have its car pointing somwhere inside itself as well as its cdr (and both).
[2010-06-15 12:21:11 UTC] ckeen attached circular.patch (description=improved bugfix proposal)
[2010-06-15 14:51:31 UTC] felix changed status from assigned to closed
[2010-06-15 14:51:31 UTC] felix set resolution to fixed
[2010-06-15 14:51:31 UTC] felix wrote:
Excellent. Patch is applied in 82881d88cfbf6124b83952a2482efa46a7afd59d (exp.).
Thanks!
[2011-04-04 08:31:00 UTC] felix removed milestone 4.6.0
[2011-04-04 08:31:00 UTC] felix wrote:
Milestone 4.6.0 deleted