1 /* stack_overflow -- simple program generating a stack overflow */
3 /* Copyright (c) 2014-2022. The SimGrid Team. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "simgrid/s4u/Actor.hpp"
9 #include "simgrid/s4u/Engine.hpp"
10 #include "xbt/asserts.h"
15 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "my log messages");
17 static unsigned collatz(unsigned c0, unsigned n)
23 x = collatz(c0, n - 1);
34 XBT_INFO("Launching our nice bugged recursive function...");
36 while (i <= 0x80000000U) {
38 unsigned res = collatz(i, i);
39 XBT_VERB("collatz(%u, %u) returned %u", i, i, res);
43 int main(int argc, char* argv[])
45 simgrid::s4u::Engine e(&argc, argv);
47 xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
49 e.load_platform(argv[1]);
50 simgrid::s4u::Actor::create("master", e.host_by_name("Tremblay"), master);