Reliable way to crash session

Posted by Riverside Software on 02-Jul-2015 02:46

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

Thanks

All Replies

Posted by James Palmer on 02-Jul-2015 02:50

Crash the session but not the DB?

Posted by Riverside Software on 02-Jul-2015 03:00

Yes, only the client session

Posted by Richard.Kelters on 02-Jul-2015 03:16

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

Posted by James Palmer on 02-Jul-2015 03:24

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.

Posted by Riverside Software on 02-Jul-2015 03:26

I mean a process crash leaving a protrace file.

Posted by James Palmer on 02-Jul-2015 03:32

Would over-filling the -T directory do it?

Posted by Riverside Software on 02-Jul-2015 03:38

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).

Posted by James Palmer on 02-Jul-2015 03:39

USB Dongle?

Posted by Frank Meulblok on 02-Jul-2015 03:40

[quote user="Richard.Kelters"]

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

[/quote]

Yes it will.

Posted by James Palmer on 02-Jul-2015 03:43

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 ;)

Posted by Riverside Software on 02-Jul-2015 03:44

Will try those ideas !

Posted by Matt Gilarde on 02-Jul-2015 03:44

Here’s code to do it on Windows.
 
PROCEDURE RaiseException EXTERNAL "kernel32.dll" :
    DEFINE INPUT PARAMETER dwExceptionCode AS UNSIGNED-LONG.
    DEFINE INPUT PARAMETER dwExceptionFlags AS LONG.
    DEFINE INPUT PARAMETER nNumberOfArguments AS LONG.
    DEFINE INPUT PARAMETER lpArguments AS LONG.
END PROCEDURE.
 
RUN RaiseException(0xc0000005, 0, 0, 0).
 
I think you’d want to call kill() on Linux.

Posted by Riverside Software on 02-Jul-2015 03:48

RaiseException works fine, thanks !

Posted by cverbiest on 02-Jul-2015 04:13

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)).
quit.

Posted by cverbiest on 02-Jul-2015 04:24

Replcae -sigusr1 by -11 to get a real crash

Posted by George Potemkin on 02-Jul-2015 05:31

Just: INTEGER("a").

But session should be started with the modified promsgs file.

In hex editor find the text:

** Invalid character in numeric input %c.(76)

and replace "**" by "%G"

Posted by Peter Judge on 02-Jul-2015 07:59

Start with –T that points to a non-existing directory.
 
 
[collapse]
From: George Potemkin [mailto:bounce-GeorgeP12@community.progress.com]
Sent: Thursday, 02 July, 2015 06:32
To: TU.OE.General@community.progress.com
Subject: RE: [Technical Users - OE General] Reliable way to crash session
 
Reply by George Potemkin

Just: INTEGER("a").

But session should be started with the modified promsgs file.

In hex editor find the text:

** Invalid character in numeric input %c.(76)

and replace "**" by "%G"

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

This thread is closed