#36 Segmentation fault

Ron Lovis

The following script creates a segmentation fault under KildClient v1179


  • Ron Lovis

    Ron Lovis - 2011-07-13
  • Eduardo M Kalinowski

    Yeah, it does crash. I'm not sure the rest of the plugin is necessary, only running
    $::world->hook("OnSentCommand", "hello3", { name => 'test3' });
    is enought to cause a crash. I wouldn't say it's unexpected... after all, you define a hook that whenever a command is sent, sends a command, which causes the hook to be executed, which sends another command, which triggers the hook, thus creating an infinite loop. Indeed, before the crash hundreds of "hello3" lines are sent to the server. Even if it did not crash, the program would hang. But probably because of the repeated function calls the stack space is all used up and a segfault happens.

    Why do you think this is a bug?

  • Ron Lovis

    Ron Lovis - 2011-07-14
    • status: open --> closed
  • Ron Lovis

    Ron Lovis - 2011-07-14

    Well, you've got a point there. Still, KC might detect this kind of problem whenever $::world->hook is called, to prevent stupid coders (like me) from getting themselves into trouble.


Log in to post a comment.