I checked with Valgrind and you were right about lapack and It's related to my openblas (built which 64 bit interface)
I have something like this when check for restriction on lfp (lfp=0) in my example
==26438== Process terminating with default action of signal 11 (SIGSEGV)
==26438== Bad permissions for mapped region at address 0x9EBD000
==26438== at 0x55E1CC4: idamax_k (in /usr/lib/
libopenblas_sandybridgep-r0.2.6.so)
==26438== by 0x5B275A6: dgetf2_ (in /usr/lib/liblapack.so)
==26438== by 0x5B27D00: dgetrf_ (in /usr/lib/liblapack.so)
==26438== by 0x4F24468: gretl_invert_general_matrix (gretl_matrix.c:7111)
==26438== by 0x4F442ED: check_R_matrix (gretl_restrict.c:100)
==26438== by 0x4F4645B: test_restriction_set (gretl_restrict.c:2285)
==26438== by 0x4F47FBA: gretl_restriction_finalize_full (gretl_restrict.c:2469)
==26438== by 0x4F5BA68: gretl_cmd_exec (interact.c:4847)
==26438== by 0x40442C: exec_line (gretlcli.c:1113)
==26438== by 0x403295: main (gretlcli.c:611)
When I do the same example as above is just complained that the matrix is singular.