Linux: trigger deadlock in rm_session_mmap.cc in core

Related to #579.
This commit is contained in:
Christian Helmuth
2012-12-19 09:05:50 +01:00
committed by Norman Feske
parent 522a86e54a
commit d50996863b
3 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,53 @@
/*
* \brief Linux: Test bug in rm_session_mmap.cc
* \author Christian Helmuth
* \date 2012-12-19
*/
/*
* Copyright (C) 2012 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#include <base/env.h>
#include <base/printf.h>
#include <ram_session/connection.h>
#include <timer_session/connection.h>
static void test_linux_rmmap_bug()
{
enum { QUOTA = 1*1024*1024, CHUNK = 0x1000, ROUNDS = 0x10 };
using namespace Genode;
PLOG("line: %d", __LINE__);
Ram_connection ram;
#if 1 /* transfer quota */
PLOG("line: %d", __LINE__);
ram.ref_account(env()->ram_session_cap());
env()->ram_session()->transfer_quota(ram.cap(), QUOTA);
#endif
PLOG("line: %d", __LINE__);
for (unsigned i = 0; i < ROUNDS; ++i) {
Ram_dataspace_capability ds(ram.alloc(CHUNK));
PLOG("%d of %d pages allocated", (i + 1), ROUNDS);
}
PLOG("Done.");
}
int main()
{
Genode::printf("--- test-rm_session_mmap started ---\n");
// Timer::Connection timer;
// timer.msleep(1000);
test_linux_rmmap_bug();
}

View File

@ -0,0 +1,3 @@
TARGET = test-rm_session_mmap
LIBS = cxx env
SRC_CC = main.cc