[Gretl-users] Segmentation fault when a loop is nested in another loop in progressive mode: a bug?

Allin Cottrell cottrell at wfu.edu
Sun Jan 16 22:40:12 EST 2011


On Sun, 16 Jan 2011, Giuseppe Vittucci wrote:

> I replicated the problem simply adding a (now useless) loop in
> the new code:
>
> loop 5000 --progressive
> 	dataset resample n
>
> 	#logit regression
> 	logit A const bid X --quiet
>
> 	#mean and median Willingness-To-Pay
> 	matrix x = {X}
> 	scalar mean_wtp = - ($coeff(const)+(meanc(x)*$coeff[3:
> $ncoeff]))/$coeff(bid)
> 	scalar median_wtp = - ($coeff(const)+(quantile(x,0.5)*$coeff[3:
> $ncoeff]))/$coeff(bid)
>
> 	#USELESS NESTED LOOP....
> 	o = rows(x)
> 	loop for i = 1...o --quiet
> 		series s = 0
> 	endloop
>
> 	#printing stats on these
> 	print mean_wtp median_wtp
> 	#save the coefficients to file
> 	store wtp.gdt mean_wtp median_wtp
> 	smpl full
> endloop

Thanks. I can confirm the segfault, and now that I have an example
of the problem this should be fixed fairly quickly.

Allin Cottrell


More information about the Gretl-users mailing list