[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] Uninitialized bytes in RNG state.

From: M Joonas Pihlaja
Subject: Re: [Bug-gsl] Uninitialized bytes in RNG state.
Date: Tue, 10 Feb 2009 11:58:10 +0200 (EET)

On Tue, 10 Feb 2009, Brian Gough wrote:

At Tue, 10 Feb 2009 01:42:56 +0200 (EET),

Thanks, I understand now.

Normally it isn't necessary to access the state directly, what do you
want to do with it?  Maybe there is some way to achieve the same
result that avoids Valgrind errors.

I'm treating them as byte strings and storing those in hash tables. The hash function touches the uninitialised memory. The context is that I'm exposing the rng state array to Lua in a mini-GSL<->Lua binding I'm writing, where byte strings are conventionally exposed as language level strings.

I'm wary of clearing every struct by default as initialising every bit of memory could hide other errors in the future.

I can certainly appreciate that. I think this particular case differs from the general case in that you've exposed API to access the state as a blob so people are going to treat it as such. We're going to do all the wild and crazy things that we're used to be able to do with blobs. :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]