Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINSIGSTKSZ error happens in Ubuntu 22.04 #2

Open
LimHyungTae opened this issue Dec 20, 2024 · 0 comments
Open

MINSIGSTKSZ error happens in Ubuntu 22.04 #2

LimHyungTae opened this issue Dec 20, 2024 · 0 comments

Comments

@LimHyungTae
Copy link
Member

Error

Once I build ROBIN on Ubuntu 22.04, the below error occurs:

In file included from /usr/include/signal.h:328,
                 from /home/ROBIN/tests/catch.hpp:8042,
                 from /home/ROBIN/tests/main.cc:9:
/home/ROBIN/tests/catch.hpp:10830:58: error: call to non-'constexpr' function 'long int sysconf(int)'
10830 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /home/ROBIN/tests/catch.hpp:8042,
                 from /home/ROBIN/tests/main.cc:9:
/usr/include/unistd.h:640:17: note: 'long int sysconf(int)' declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /home/ROBIN/tests/main.cc:9:
/home/ROBIN/tests/catch.hpp:10889:45: error: size of array 'altStackMem' is not an integral constant-expression
10889 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
In file included from /home/ROBIN/tests/test_utils.hpp:15,
                 from /home/ROBIN/tests/core_test.cpp:8:
/home/ROBIN/include/robin/core.hpp: In member function 'robin::IGraph* robin::CompGraphConstructor<Measurements, CompCheckFunc, 2>::BuildCompGraph(robin::GraphsStorageType) [with Measurements = ____C_A_T_C_H____T_E_S_T____9()::H; CompCheckFunc = ____C_A_T_C_H____T_E_S_T____9()::Vec2dComp]':
/home/ROBIN/include/robin/core.hpp:504:3: warning: control reaches end of non-void function [-Wreturn-type]
  504 |   }

like this:

image

How to resolve

According to this solution, when I add the following two lines:

#undef MINSIGSTKSZ
#define MINSIGSTKSZ 16384

like this:

// at line 10821 of `tests/catch.hpp`
#undef MINSIGSTKSZ
#define MINSIGSTKSZ 16384
namespace Catch {

    struct SignalDefs {
        int id;
        const char* name;
    };

    // 32kb for the alternate stack seems to be sufficient. However, this value
    // is experimentally determined, so that's not guaranteed.
    static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;

it can be resolved.

Point to discuss

I heard that the value might differ depending on the OS. What would be the best way to handle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant