1 /* stack_overflow -- simple program generating a stack overflow */
3 /* Copyright (c) 2014. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "simgrid/platf.h"
10 #include "simgrid/simix.h"
13 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "my log messages");
15 static unsigned collatz(unsigned c0, unsigned n)
21 x = collatz(c0, n - 1);
30 static int master(int argc, char *argv[])
32 XBT_INFO("Launching our nice bugged recursive function...");
36 unsigned res = collatz(i, i);
37 XBT_VERB("collatz(%u, %u) returned %u", i, i, res);
38 } while (i <= 0x80000000u);
42 int main(int argc, char *argv[])
44 SIMIX_global_init(&argc, argv);
47 printf("Usage: %s platform.xml deployment.xml\n", argv[0]);
51 SIMIX_function_register("master", master);
52 SIMIX_create_environment(argv[1]);
53 SIMIX_launch_application(argv[2]);