Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Compilation failed: buffer overflow detected using KPP

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member
Dear Sir or Madam,

When I built WRF-Chem v4.2.1, the following error occurred:

model cri_mosaic_4bin_aq
/root/WRF-4.2/chem/KPP/kpp/kpp-2.1/bin/kpp cri_mosaic_4bin_aq.kpp
*** buffer overflow detected ***: terminated
make: *** [Makefile:3: cri_mosaic_4bin_aq_Integrator.f90] Aborted (core dumped)

I used gcc and gfortran in version 9.3.0. But in lower versions, it can work well.

So how to get the correct installation.

Thank you for reading.

This seems to be a memory issue. Are you compiling on the command line? Can you provide the compile with additional memory?

Thanks for your reply.

I have been observing the memory usage, even at the most it is still only 50% usage. I don't know how to add extra memory. I have 16G of physical memory, I added 4G of virtual memory, and used `ulimit -s unlimited` when compiling.

I only saw this issue on ubuntu 20.04 LTS, when I switched to CentOS, it worked well. So, I think it’s about the compiler. But I don't how to solve it.

If I don’t use KPP to build, it succeeds.
Hi, interesting that it fails with KPP. I assume you have both the yacc and FLEX programs and have this set in your environment before compiling?

setenv YACC ‘/usr/bin/yacc –d’
setenv FLEX_LIB_DIR /usr/local/lib

Optionally, if it's failing on building the crimech mechansim (and you aren''t using it), you can delete the directory chem/KPP/mechanisms/cri_mosaic_4bin_aq (probably also chem/KPP/mechanisms/cri_mosaic_8bin_aq) and other mechanisms you aren't using.