bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-10-08 Thread Ludovic Courtès
Daniel Hartwig skribis: > On 8 October 2012 21:44, Ludovic Courtès wrote: >>> On 8 October 2012 04:38, Ludovic Courtès wrote: >>> Right. But then the pointer is being collected even though it remains >>> inside the guardian, in the example it is never extracted from there. >> >> Well, when the

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-10-08 Thread Daniel Hartwig
On 8 October 2012 21:44, Ludovic Courtès wrote: >> On 8 October 2012 04:38, Ludovic Courtès wrote: >> Right. But then the pointer is being collected even though it remains >> inside the guardian, in the example it is never extracted from there. > > Well, when the object reaches the guardian’s zo

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-10-08 Thread Ludovic Courtès
Hi, Daniel Hartwig skribis: > On 8 October 2012 04:38, Ludovic Courtès wrote: This is expected to fail: ‘bytevector->pointer’ creates a weak reference from the returned pointer object to the given bytevector. So when the pointer object is reclaimed, the bytevector can be reclaim

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-10-07 Thread Daniel Hartwig
On 8 October 2012 04:38, Ludovic Courtès wrote: >>> This is expected to fail: ‘bytevector->pointer’ creates a weak reference >>> from the returned pointer object to the given bytevector. So when the >>> pointer object is reclaimed, the bytevector can be reclaimed too, hence >>> the problem you’re

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-10-07 Thread Ludovic Courtès
Hi, Daniel Hartwig skribis: > On 7 October 2012 05:41, Ludovic Courtès wrote: >> Hi, >> >> Daniel Hartwig skribis: >> >>> (define x (bytevector->pointer (make-bytevector len 1))) >>> (define a (pointer-address x)) >>> (display x)(newline) >>> (my-guardian x) >>> ;(my-guardian (pointer->bytevec

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-10-06 Thread Daniel Hartwig
On 7 October 2012 05:41, Ludovic Courtès wrote: > Hi, > > Daniel Hartwig skribis: > >> (define x (bytevector->pointer (make-bytevector len 1))) >> (define a (pointer-address x)) >> (display x)(newline) >> (my-guardian x) >> ;(my-guardian (pointer->bytevector x len)) >> (set! x #f) >> >> (define (

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-10-06 Thread Ludovic Courtès
Hi, Daniel Hartwig skribis: > (define x (bytevector->pointer (make-bytevector len 1))) > (define a (pointer-address x)) > (display x)(newline) > (my-guardian x) > ;(my-guardian (pointer->bytevector x len)) > (set! x #f) > > (define (dump-struct) > (write (pointer->bytevector (make-pointer a) l

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-08-06 Thread Daniel Hartwig
On 7 August 2012 00:37, Ian Price wrote: > Patrick Bernaud writes: > >> With auto compilation turned on, it looks like the problem can not be >> reproduced. That is to say, when using --fresh-auto-compile. > > I cannot reproduce this on 32 bit fedora 16 with guile (GNU Guile) > 2.0.6-dirty (com

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-08-06 Thread Ian Price
Patrick Bernaud writes: > With auto compilation turned on, it looks like the problem can not be > reproduced. I cannot reproduce this on 32 bit fedora 16 with guile (GNU Guile) 2.0.6-dirty (commit 1321a36ed61deb9431b41768dc92cb7230c9afa1). However, there was one caveat, as I didn't have html pra

bug#12095: Protecting pointer on bytevector with guardian does not protect memory

2012-07-30 Thread Patrick Bernaud
The memory from a bytevector of which a pointer is taken (with 'bytevector->pointer') can be overwritten even if that pointer has been put inside a guardian. 'make-c-struct' from (system foreign) is using 'bytevector->pointer'. With the test script attached: $ guile -v | head -1 guile (GNU Guile