How to crash my Node app on purpose?

后端 未结 4 584
无人及你
无人及你 2020-12-30 20:27

I\'ve been working on a deployment work flow with Dokku and Docker and now I want to take care of continuity of my app (along the lines of Forever). To test it, I need a way

4条回答
  •  礼貌的吻别
    2020-12-30 20:58

    To add to Golo answer:

    C module to crash by segmentation fault:

    int main ()
    {
        //Create a array of 1 char
        char a [1];
        //Create a index
        int i = 0;
        //Infinite loop to go around the compiler
        while(1)
        {
            //Write on case i of a, on the second iteration, it will write in unreserved memory => crash
            a[i] = 0;
            i = i + 1;
        }
        //Should not go there
        return -1;
    }
    

提交回复
热议问题