[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[LTP] crash tests

Hi there!

As proposed on lkml, here's my little contribution to the Linux Test Project.
That's for sure, code inspection by 20,000 eyes is better than having
the British museum lending us 10,000 monkeys. However, sometimes clever
programers leaves stupid bugs after late night hacking.
So here are some of my favorite's attached, to check stability:

* mem01
  Tries to malloc as much memory as possible, and make pages dirty
  to force RAM allocation. In other words, this is a memory stress test.
  Makes linux-2.4.2-ac20+am_console_patch+ng_lowlatency panic..

* proc01
  Reads all the readable files in /proc. Good to exercise read locks,
  and good kernel latency killer too. Let me know if it blocks on read
  (shouldn't). Also "cat /proc/sys/net/ipv4/route/flush" returns EINVAL
  on read, is it the expected behaviour?

* crash01
  This one comes from the world famous 'crashme-2.4', written 
  by George J Carrette. Actually, a lot of code has been rewritten,
  but credits are due.

* crash02
  As crash01 creates random instructions and executes them, crash02
  creates random syscalls and executes them. This may be dangerous since
  it can actually erase all your data. However, on non-production system,
  with fs mounted ro and run as nobody, this could be safe (NO WARRANTY).
  After some testing, I noticed that some random syscalls are killed
  by SIGSEGV. Aren't they supposed to return nicely with EFAULT instead?

I tried to use the ltp library, following the mmap001.c example. 
If you see something wrong in my code, please fix it, or tell me about it.
These programs are more like "please make me crash" tests, and I'm wondering
if different tests like "is the OS working the way we're expecting it"
would be interresting. Have you ever gave a try to the VSX-PCTS test suite
at http://www.opengroup.org/testing/testsuites/ ? I guess there will be
some licensing issues.

Anyway, keep on the good work, Linux needs ltp.

Have fun,

PS:  OS signaling: "Don't drive and crash"