Infinit loop at compiling modules

18 views
Skip to first unread message

Johannes

unread,
Mar 16, 2021, 5:00:48 PM3/16/21
to CBFortran
Dear all,
I really enjoy using C::B Fortran. Unfortunately, I get in my current project situations, where C::B is captured in an infinite loop and has to be killed (memory is running up slowly). This is only happening for updating/building certain modules in my Fortran project and only if I just build this special module. If I recompile everything compiling just works fine. I checked for cyclic dependencies of the modules of each other, but found no issue there. It might happen after updating my system to a newer GFortran, which I use as the standard Fortran compiler.

My system:
Manjaro GNU/Linux 5.11.2-1-MANJARO x86_64, GCC 10.2.0

C::B Fortran version
SVN 12045, Build: Apr. 12.2020, 17:49_16 - wx3.1.4-gcc7.3.1 (Linux unicode) - 64bit
Name             : Code::Blocks
Version          : svn-r12045
SDK Version      : 2.2.0
Scintilla Version: 3.7.5
Author           : The Code::Blocks Team
E-mail           : in...@codeblocks.org
Website          : http://www.codeblocks.org
wxWidgets Library (wxGTK port)
Version 3.1.4 (Unicode: wchar_t, debug level: 1),
compiled at Apr 11 2020 08:45:24
Runtime version of toolkit used is 2.24.
Compile-time GTK+ version is 2.24.31.

(from here)

Any idea, what the reason can be? Has an API changed to Gfortran? Everything else than building just works like a charm.

BR,
Johannes

Darius Markauskas

unread,
Mar 17, 2021, 8:24:21 AM3/17/21
to cbfo...@googlegroups.com
For me it sounds like a bug in CBFortran. But where? I don't know. I don't think that it can be a problem with Gfortran. You should see what process consumes your CPU: C::B or Gfortran.

If your code is Open source (or something like), I could try to compile it myself. But else, I don't know how to help you.

""" This is only happening for updating/building certain modules in my Fortran project and only if I just build this special module."""
Does the problem happen when you compile your project? Perhaps, you can localize the statement which causes the problem (perhaps 'use ...') ?

""" If I recompile everything compiling just works fine."""
Strange. Perhaps some old files still were left. Try to remove all files created during the compilation (normally 'bin' and 'obj' directories).

Darius

--
You received this message because you are subscribed to the Google Groups "CBFortran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbfortran+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cbfortran/99c749d9-16c4-4b8b-b3db-2cae8281189bn%40googlegroups.com.

Johannes

unread,
Mar 17, 2021, 1:32:20 PM3/17/21
to CBFortran
Dear Darius,
thanks for your fast response. The project is intended to be made open but it is currently in a very early stage and more a playground for OO programming for me. I will try to boil it down to a reproducer.

It seems that C::B itself is hanging. GFortran has 0 CPU load, while C::B has 100% thread load. The issue occurs, if I compile a module (without OO things in there) , where the interface of a contained routine is changed or if I add an arbitrary new subroutine/function. After freeze/kill/restart I can compile even without compiling everything. C::B hangs with arbitrary last build message. Sometimes this, sometimes that module routine. I assume that this depends on the build order. I've to do some further checks with a blank, new project.

Are there some debug modes, which I can activate or does there exist log files for further investigation. I read in an older threads that there are 'weights', which define the build order. If these are logged, maybe this give me a hint?

As soon as I've a reproducer or find a solution on my own I will share it.

BR,
Johannes

Darius Markauskas

unread,
Mar 18, 2021, 3:37:30 AM3/18/21
to cbfo...@googlegroups.com
"""The issue occurs, if I compile a module (without OO things in there) , where the interface of a contained routine is changed or if I add an arbitrary new subroutine/function. After freeze/kill/restart I can compile even without compiling everything."""

It would be nice to know if that problem is with FortranProject plugin. Perhaps, the problem is in some other plugin. Perhaps you could try to disable some plugins in Manage plugins dialog (Plugins->Manage Plugins): CodeCompletion plugin (used for C++ code), MouseSap (may cause problems on some Linux). If it does not help, you can disable the FortranProject plugin too (used for Fortran).

"""Are there some debug modes, which I can activate or does there exist log files for further investigation."""

Some more info is available in "Code::Blocks debug" tab in Logs window if C::B started with "-debug" command line option (./codeblocks_run.sh -debug). But I don't think it can help you.

"""I read in an older threads that there are 'weights', which define the build order. If these are logged, maybe this give me a hint?"""

FortranProject plugin uses these 'weights' to define the build order. You can find them in the file properties dialog: right click on the file name in the project tree, and then 'Properties...', Build tab, Priority weight. If you find that some file has an unusually high weight value (100), it can indicate a problem in the FortranProject plugin.

Currently I am working on a new version of C::B. Perhaps, it makes sense for you to try this new version. If you like, I could send you a link to download this new version of C::B (Linux, 64bit).

Regards,
Darius

Johannes

unread,
Mar 27, 2021, 7:10:11 PM3/27/21
to CBFortran
Dear Darius,

I'm very sorry for the delayed reply to your advises.

I tried to set up a reproducer, but I failed. Everything simplified compiles fine and robust. The debug output gave also no hint where things hang. The weights are all below 10 (highest is 5).

I tried also to disable various plugins but with no success.

However, I've seen the C::B hangs totally unpredictable. Sometimes I can reproduce the error sometimes not - I've seen no clear pattern. After killing C::B and reopening and just update the build (no full rebuild) C::B does not hang. This smells like a pointer issue. But who knows most possibly I introduced a coding error somewhere, which is the root cause.

If you can provide a pre-release of C::B fortran 1.8 (Linux, 64bit) it would be wonderful. Otherwise I could send you a copy of my project.

Thanks,
Johannes

Darius Markauskas

unread,
Apr 2, 2021, 7:14:26 AM4/2/21
to cbfo...@googlegroups.com
I just write it for the case that somebody is experiencing similar problems with C::B and is looking for a possible solution.

In this case, it helped simply removing the old C::B config file. Perhaps, the easiest way is to start C::B as a portable app ('codeblocks_run_portable.sh') and to see if it helps.




Reply all
Reply to author
Forward
0 new messages