I am working in a write of fixest
that uses vendoring (i.e., to use it in a server where a lot of people change things constantly)
So far, some of my functions work, but this creates a segfault
devtools::load_all()
gravity_pois = fepois(Euros ~ log(dist_km) | Origin + Destination + Product + Year, trade)
fixedEffects = fixef(gravity_pois)
To be able to replicate this error you can clone my project with
git clone --depth 1 --branch cpp11_wip https://github.com/pachadotdev/fixest2.git
Then open the project in RStudio and run the 1st chunk.
The function of the problem is https://github.com/pachadotdev/fixest2/blob/cpp11_wip/src/05_01_misc_helpers.cpp#LL540C26-L540C41.
I tried adding cout << "LINE XXX"
to see where it stop printing the line number, and up to https://github.com/pachadotdev/fixest2/blob/cpp11_wip/src/05_01_misc_helpers.cpp#L607 it seems to be fine.
How can I debug this in a more efficient way? I tried R -d lldb-11
and all I get is
Thread 1 "R" received signal SIGSEGV, Segmentation fault.
0x00007ffff7cec0d5 in Rf_allocVector3 () from /usr/lib/R/lib/libR.so
I got sure that the values that I have to pass as integers are integers, etc. I did that verification here https://github.com/pachadotdev/fixest2/blob/cpp11_wip/R/Methods.R#L1087-L1098.