Reliable way to crash session - Forum - OpenEdge General - Progress Community

Reliable way to crash session


Reliable way to crash session

  • Hi,

    For test/demo purpose, I'd like to know if there's a reliable way to crash an OpenEdge session from ABL code. I just would like to keep it easy to reproduce (no external library for example, apart from OS libraries). Fun and creative solution would be even better :-)

    11.5 - Windows / Linux


  • Crash the session but not the DB?

  • Yes, only the client session

  • Would the "Attempt to define too many indexes" error crash a session (don't remember) ....

  • Do you mean a crash with an error, or do you mean that the session just dies leaving a procore/protrace file?

    If it's ok to have an error then a recursive function call with no stop condition would crash it pretty quickly.

  • I mean a process crash leaving a protrace file.

  • Would over-filling the -T directory do it?

  • Tried to find the CRASH statement in documentation, but didn't find it :-)

    I guess filling the -T will probably do it, but it may be difficult to reproduce, as this is for a test/demo purpose and I only have a single disk (so that will lead to all sort of problems for the other processes).

  • USB Dongle?

  • Richard.Kelters

    Would the "Attempt to define too many indexes" error crash a session (don't remember) ....

    Yes it will.

  • Actually you could probably have all sorts of fun with a USB stick. Set the -T to point there and pull it out mid operation ;)

  • Will try those ideas !

  • Here’s code to do it on Windows.
    PROCEDURE RaiseException EXTERNAL "kernel32.dll" :
        DEFINE INPUT PARAMETER dwExceptionFlags AS LONG.
        DEFINE INPUT PARAMETER nNumberOfArguments AS LONG.
    RUN RaiseException(0xc0000005, 0, 0, 0).
    I think you’d want to call kill() on Linux.
  • RaiseException works fine, thanks !

  • I see that you already have a windows solution.
    The code below fakes a crash on linux, it doesn't really crash but it creates a protrace file.

    def var pid as char.
    input through echo $PPID.
    import unformatted pid.
    input close.
    os-command value(subst("kill -sigusr1 &1", pid)).