[plt-scheme] segfaults in 352

From: Corey Sweeney (corey.sweeney at gmail.com)
Date: Tue Aug 8 13:57:32 EDT 2006

I upgraded a machine to version "352", and I get segfaults when I do:

(define (substitute-thing regex-string string-to-sub text)
  ;(map display (list "regex-string::" regex-string " string-to-sub::"
string-to-sub " text" text)) ;;;debugging
  (let ((answer (regexp-replace (bytify regex-string);
                                 (bytify text)
                                 (bytify string-to-sub))))
;  (let ((answer (regexp-replace (stringify regex-string)
;                                (stringify text)
;                                (stringify string-to-sub))))
    (if (equal? answer text)
        text
        (substitute-thing regex-string string-to-sub answer))))


But not when i do:

(define (substitute-thing regex-string string-to-sub text)
  ;(map display (list "regex-string::" regex-string " string-to-sub::"
string-to-sub " text" text)) ;;;debugging
;  (let ((answer (regexp-replace (bytify regex-string);
;                                 (bytify text)
;                                 (bytify string-to-sub))))
  (let ((answer (regexp-replace (stringify regex-string)
                                (stringify text)
                                (stringify string-to-sub))))
    (if (equal? answer text)
        (stringify text)
        (substitute-thing regex-string string-to-sub answer))))


Where bytify and stringify are:

(define (bytify x)
  (if (string? x) (string->bytes/utf-8 x) x))

(define (stringify x)
  (if (bytes? x) (bytes->string/utf-8 x) x))


I've worked around it for now with bytify but wanted to report it.  If it
helps, I think my string is long.  I'd guess something like 4K.

Corey

-- 
((lambda (y) (y y)) (lambda (y) (y y)))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20060808/1038d2dc/attachment.html>

Posted on the users mailing list.