From a4353075432921dcad6a20c179ac0547acd55a64 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 2 Nov 2015 23:18:30 +0100 Subject: [PATCH] Test case for issue #237 (OS X crash when creating 2048:th Uc object) --- tests/regress/osx_qemu_thread_create_crash.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 tests/regress/osx_qemu_thread_create_crash.py diff --git a/tests/regress/osx_qemu_thread_create_crash.py b/tests/regress/osx_qemu_thread_create_crash.py new file mode 100755 index 00000000..b34b319b --- /dev/null +++ b/tests/regress/osx_qemu_thread_create_crash.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import platform +import resource + +from unicorn import * + +import regress + +# OS X: OK with 2047 iterations. +# OS X: Crashes at 2048:th iteration ("qemu: qemu_thread_create: Resource temporarily unavailable"). +# Linux: No crashes observed. +class ThreadCreateCrash(regress.RegressTest): + def test(self): + for i in xrange(2048): + Uc(UC_ARCH_X86, UC_MODE_64) + self.assertTrue(True, "If not reached, then we have a crashing bug.") + +if __name__ == '__main__': + regress.main()