[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: very obscure problem, help needed
From: |
Ian Grant |
Subject: |
Re: very obscure problem, help needed |
Date: |
Mon, 09 Oct 2000 10:14:08 +0100 |
> ... are you by any chance doing anything with strings
> that you got back from Postgres? I found that it is dangerous to
> treat such strings as shareable. Specifically, I found that
>
> (use-modules (database postgres))
> (use-modules (ice-9 string-fun))
> ...
> (sans-surrounding-whitespace (pg-getvalue dataset row col))
>
> would cause mysterious errors later in the program.
This is the first time I've heard of such a problem.
> But if I use a private copy of sans-surrounding-whitespace, in which
> `make-shared-substring'
[now deprecated]
> is replaced by `substring', the program
> behaves correctly.
You should have reported this as a bug in guile or guile-pg.
I've checked the guile-pg code and I can't see a problem: the return value from
pg_getvalue is a guile string created by either a call to scm_makfromstr
(possibly via scm_makfrom0str). This copies the string pointed to by the
return value from the postgres client library into a freshly allocated (from
scm_makstr) guile string. Thereafter it should behave as any guile string does.
Does anybody know of any bugs with shared substrings in 1.4?
Ian
--
Ian Grant, Computer Lab., New Museums Site, Pembroke Street, Cambridge
Phone: +44 1223 334420 Personal e-mail: iang at pobox dot com