Am 18.12.18 um 21:37 schrieb Allin Cottrell:
On Tue, 18 Dec 2018, Artur T. wrote:
> Hi all,
>
> the following leads t a crash using current git on ubuntu linux (both
> on 18.10 and 14.04) with the message
>
> <malloc(): memory corruption>
>
> <hansl>
> nulldata 14000
> series foo = 1
> strings S = array($nobs)
> loop i=1..$nobs -q
> S[i] = "Entry_$i"
> endloop
> stringify(foo,S)
> </hansl>
Thanks, Artur. That's now fixed in git.
Great, thank you for the quick fix, Allin.
Just one question for clarification. Running the following yields an --
at least for me -- unexpected behaviour where series foo results in a
constant ("Entry_c") even though S[i] is different for each i.
<hansl>
nulldata 14000
series foo = 1 # SET to 1
strings S = array($nobs)
loop i=1..$nobs -q
S[$i] = sprintf("Entry_%d", $i)
endloop
stringify(foo,S)
print S # results in "Entry_1" for all obs
series foo = 2 # SET to 2
strings S = array($nobs)
loop i=1..$nobs -q
S[$i] = sprintf("Entry_%d", $i)
endloop
print S # results in "Entry_2" for all obs
</hansl>
Best,
Artur