Segfault with fft on Linux

18 views
Skip to first unread message

Abe Solberg

unread,
Dec 1, 2025, 9:34:35 AM (2 days ago) Dec 1
to TMB Users
Hi all,

I am trying to write a version of Mizer size spectrum model (thanks to the authors of that package) in RTMB and am running into an issue on mac and linux machines.  

On my windows machine, the TMB object compiles without issue and mostly works (expect another post on that eventually), but on both linux and mac machines i get a segfault error when trying to do the fft transformation. 

Hopefully this is just me doing something incorrectly, but I've attached an example here where I've attempted to isolate the issue. 

Thanks in advance,
Abe
MRE.R

Kasper Kristensen

unread,
Dec 1, 2025, 10:18:07 AM (2 days ago) Dec 1
to TMB Users
You've found a bug in RTMB. For some reason, the multivariate RTMB::fft doesn't work in the special case when one of the dimensions is 1.
For now, just remove 'base::t' from this line:

RTMB::fft(base::t(prey[i, ])) / (length(w_full))

to avoid setting the redundant dimension attribute.

Abe Solberg

unread,
Dec 1, 2025, 11:12:38 AM (2 days ago) Dec 1
to Kasper Kristensen, TMB Users
Cheers. Thank you for the quick response. That fixed it.

Thanks again,
Abe

--
To post to this group, send email to us...@tmb-project.org. Before posting, please check the wiki and issuetracker at https://github.com/kaskr/adcomp/. Please try to create a simple repeatable example to go with your question (e.g issues 154, 134, 51). Use the issuetracker to report bugs.
---
You received this message because you are subscribed to a topic in the Google Groups "TMB Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tmb-users/KO_bpp1LFv8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tmb-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/tmb-users/84d833ff-2f0f-45a9-a14f-ad111a262fabn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages