Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63ed4e7af0 | |||
| d7cf39883f | |||
| 40f8091fab | |||
| a20e1acf01 | |||
| b3d7bbda56 | |||
| 9a60997ea0 | |||
| 4b66373813 | |||
| b44b11ace7 | |||
| ebc91cea0e | |||
| 58106d791a |
@ -10,7 +10,7 @@ project(mckernel C ASM)
|
||||
set(MCKERNEL_VERSION "1.7.0")
|
||||
|
||||
# See "Fedora Packaging Guidlines -- Versioning"
|
||||
set(MCKERNEL_RELEASE "0.6")
|
||||
set(MCKERNEL_RELEASE "0.7")
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
# for rpmbuild
|
||||
|
||||
@ -85,7 +85,11 @@ enum __rlimit_resource
|
||||
__RLIMIT_RTPRIO = 14,
|
||||
#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
|
||||
|
||||
__RLIMIT_NLIMITS = 15,
|
||||
/* timeout for RT tasks in us */
|
||||
__RLIMIT_RTTIME = 15,
|
||||
#define RLIMIT_RTTIME __RLIMIT_RTTIME
|
||||
|
||||
__RLIMIT_NLIMITS = 16,
|
||||
__RLIM_NLIMITS = __RLIMIT_NLIMITS
|
||||
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
|
||||
#define RLIM_NLIMITS __RLIM_NLIMITS
|
||||
|
||||
@ -118,6 +118,7 @@ SYSCALL_HANDLED(241, perf_event_open)
|
||||
SYSCALL_DELEGATED(241, perf_event_open)
|
||||
#endif // PERF_ENABLE
|
||||
SYSCALL_HANDLED(260, wait4)
|
||||
SYSCALL_HANDLED(261, prlimit64)
|
||||
SYSCALL_HANDLED(270, process_vm_readv)
|
||||
SYSCALL_HANDLED(271, process_vm_writev)
|
||||
SYSCALL_HANDLED(281, execveat)
|
||||
|
||||
@ -84,7 +84,11 @@ enum __rlimit_resource
|
||||
__RLIMIT_RTPRIO = 14,
|
||||
#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
|
||||
|
||||
__RLIMIT_NLIMITS = 15,
|
||||
/* timeout for RT tasks in us */
|
||||
__RLIMIT_RTTIME = 15,
|
||||
#define RLIMIT_RTTIME __RLIMIT_RTTIME
|
||||
|
||||
__RLIMIT_NLIMITS = 16,
|
||||
__RLIM_NLIMITS = __RLIMIT_NLIMITS
|
||||
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
|
||||
#define RLIM_NLIMITS __RLIM_NLIMITS
|
||||
|
||||
@ -158,6 +158,7 @@ SYSCALL_HANDLED(289, signalfd4)
|
||||
#ifdef ENABLE_PERF
|
||||
SYSCALL_HANDLED(298, perf_event_open)
|
||||
#endif
|
||||
SYSCALL_HANDLED(302, prlimit64)
|
||||
#ifdef DCFA_KMOD
|
||||
SYSCALL_HANDLED(303, mod_call)
|
||||
#endif
|
||||
|
||||
@ -539,7 +539,11 @@ retry_alloc:
|
||||
#define USE_VM_INSERT_PFN 1
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
#if defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 2)
|
||||
static vm_fault_t rus_vm_fault(struct vm_fault *vmf)
|
||||
#else
|
||||
static int rus_vm_fault(struct vm_fault *vmf)
|
||||
#endif
|
||||
{
|
||||
struct vm_area_struct *vma = vmf->vma;
|
||||
#else
|
||||
|
||||
@ -1322,7 +1322,8 @@ void init_sigaction(void)
|
||||
|
||||
master_tid = gettid();
|
||||
for (i = 1; i <= 64; i++) {
|
||||
if (i != SIGKILL && i != SIGSTOP && i != SIGCHLD) {
|
||||
if (i != SIGKILL && i != SIGSTOP && i != SIGCHLD &&
|
||||
i != SIGTSTP && i != SIGTTIN && i != SIGTTOU) {
|
||||
struct sigaction act;
|
||||
|
||||
sigaction(i, NULL, &act);
|
||||
|
||||
2
ihk
2
ihk
Submodule ihk updated: 7c4b8d6b40...df12c9102c
@ -139,7 +139,6 @@ static void hugefileobj_free(struct memobj *memobj)
|
||||
struct memobj_ops hugefileobj_ops = {
|
||||
.free = hugefileobj_free,
|
||||
.get_page = hugefileobj_get_page,
|
||||
|
||||
};
|
||||
|
||||
void hugefileobj_cleanup(void)
|
||||
|
||||
@ -505,10 +505,12 @@ struct process {
|
||||
// PS_STOPPED -----+
|
||||
// (PS_TRACED)
|
||||
|
||||
/* Store exit_status for a group of threads when stopped by SIGSTOP.
|
||||
exit_status can't be used because values of exit_status of threads
|
||||
might divert while the threads are exiting by group_exit(). */
|
||||
int group_exit_status;
|
||||
/* Store exit_status for a group of threads when stopped by SIGSTOP. */
|
||||
/* exit_status can't be used because values of exit_status of threads */
|
||||
/* might divert while the threads are exiting by group_exit(). */
|
||||
/* The upper 4 bytes of group_exit_status is the confirmation flag of */
|
||||
/* exit status. The lower 4 bytes is the exit status. */
|
||||
unsigned long group_exit_status;
|
||||
|
||||
/* Manage ptraced processes in the separate list to make it easy to
|
||||
restore the orginal parent child relationship when
|
||||
|
||||
@ -2176,13 +2176,62 @@ static int do_page_fault_process_vm(struct process_vm *vm, void *fault_addr0, ui
|
||||
{
|
||||
int error;
|
||||
const uintptr_t fault_addr = (uintptr_t)fault_addr0;
|
||||
struct vm_range *range;
|
||||
struct vm_range *range = NULL;
|
||||
struct thread *thread = cpu_local_var(current);
|
||||
int locked = 0;
|
||||
|
||||
dkprintf("[%d]do_page_fault_process_vm(%p,%lx,%lx)\n",
|
||||
ihk_mc_get_processor_id(), vm, fault_addr0, reason);
|
||||
|
||||
/* grow stack */
|
||||
if (fault_addr >= thread->vm->region.stack_start &&
|
||||
fault_addr < thread->vm->region.stack_end) {
|
||||
range = lookup_process_memory_range(vm,
|
||||
thread->vm->region.stack_end - 1,
|
||||
thread->vm->region.stack_end);
|
||||
if (range == NULL) {
|
||||
error = -EFAULT;
|
||||
ekprintf("%s: vm: %p, addr: %p, reason: %lx):"
|
||||
"stack not found: %d\n",
|
||||
__func__, vm, fault_addr0, reason, error);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* don't grow if replaced with hugetlbfs */
|
||||
if (range->memobj) {
|
||||
goto skip;
|
||||
}
|
||||
|
||||
if (fault_addr >= range->start) {
|
||||
goto skip;
|
||||
}
|
||||
|
||||
if (thread->vm->is_memory_range_lock_taken == -1 ||
|
||||
thread->vm->is_memory_range_lock_taken !=
|
||||
ihk_mc_get_processor_id()) {
|
||||
ihk_rwspinlock_write_lock_noirq(&vm->memory_range_lock);
|
||||
locked = 1;
|
||||
}
|
||||
|
||||
if (range->pgshift) {
|
||||
range->start = fault_addr &
|
||||
~((1UL << range->pgshift) - 1);
|
||||
} else {
|
||||
range->start = fault_addr & PAGE_MASK;
|
||||
}
|
||||
|
||||
if (locked) {
|
||||
ihk_rwspinlock_write_unlock_noirq(&vm->memory_range_lock);
|
||||
locked = 0;
|
||||
}
|
||||
|
||||
dkprintf("%s: addr: %lx, reason: %lx, range: %lx-%lx:"
|
||||
"stack found\n",
|
||||
__func__, (unsigned long)fault_addr, reason,
|
||||
range->start, range->end);
|
||||
}
|
||||
skip:
|
||||
|
||||
if (thread->vm->is_memory_range_lock_taken == -1 ||
|
||||
thread->vm->is_memory_range_lock_taken != ihk_mc_get_processor_id()) {
|
||||
ihk_rwspinlock_read_lock_noirq(&vm->memory_range_lock);
|
||||
@ -2197,13 +2246,16 @@ static int do_page_fault_process_vm(struct process_vm *vm, void *fault_addr0, ui
|
||||
goto out;
|
||||
}
|
||||
|
||||
range = lookup_process_memory_range(vm, fault_addr, fault_addr+1);
|
||||
if (range == NULL) {
|
||||
error = -EFAULT;
|
||||
dkprintf("do_page_fault_process_vm(): vm: %p, addr: %p, reason: %lx):"
|
||||
"out of range: %d\n",
|
||||
vm, fault_addr0, reason, error);
|
||||
goto out;
|
||||
if (!range) {
|
||||
range = lookup_process_memory_range(vm, fault_addr,
|
||||
fault_addr+1);
|
||||
if (range == NULL) {
|
||||
error = -EFAULT;
|
||||
dkprintf("%s: vm: %p, addr: %p, reason: %lx):"
|
||||
"out of range: %d\n",
|
||||
__func__, vm, fault_addr0, reason, error);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (((range->flag & VR_PROT_MASK) == VR_PROT_NONE)
|
||||
@ -2367,16 +2419,15 @@ int init_process_stack(struct thread *thread, struct program_load_desc *pn,
|
||||
size = minsz;
|
||||
}
|
||||
size = (size + USER_STACK_PREPAGE_SIZE - 1) & USER_STACK_PAGE_MASK;
|
||||
dkprintf("%s: stack_premap: %lu, rlim_cur: %lu, minsz: %lu, size: %lu\n",
|
||||
__FUNCTION__,
|
||||
pn->stack_premap,
|
||||
proc->rlimit[MCK_RLIMIT_STACK].rlim_cur,
|
||||
minsz, size);
|
||||
start = (end - size) & USER_STACK_PAGE_MASK;
|
||||
dkprintf("%s: stack_premap: %lu, rlim_cur: %lu, minsz: %lu, size: %lu, maxsz: %lx\n",
|
||||
__func__, pn->stack_premap,
|
||||
proc->rlimit[MCK_RLIMIT_STACK].rlim_cur,
|
||||
minsz, size, maxsz);
|
||||
start = (end - minsz) & USER_STACK_PAGE_MASK;
|
||||
|
||||
/* Apply user allocation policy to stacks */
|
||||
/* TODO: make threshold kernel or mcexec argument */
|
||||
ap_flag = (size >= proc->mpol_threshold &&
|
||||
ap_flag = (minsz >= proc->mpol_threshold &&
|
||||
!(proc->mpol_flags & MPOL_NO_STACK)) ? IHK_MC_AP_USER : 0;
|
||||
dkprintf("%s: max size: %lu, mapped size: %lu %s\n",
|
||||
__FUNCTION__, size, minsz,
|
||||
@ -2508,7 +2559,7 @@ int init_process_stack(struct thread *thread, struct program_load_desc *pn,
|
||||
ihk_mc_modify_user_context(thread->uctx, IHK_UCR_STACK_POINTER,
|
||||
end + sizeof(unsigned long) * s_ind);
|
||||
thread->vm->region.stack_end = end;
|
||||
thread->vm->region.stack_start = start;
|
||||
thread->vm->region.stack_start = (end - size) & USER_STACK_PAGE_MASK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
268
kernel/syscall.c
268
kernel/syscall.c
@ -448,34 +448,59 @@ static int wait_stopped(struct thread *thread, struct process *child, struct thr
|
||||
thread->proc->pid, child->pid, options);
|
||||
int ret;
|
||||
|
||||
/* Copy exit_status created in do_signal */
|
||||
int *exit_status;
|
||||
|
||||
if (c_thread) {
|
||||
exit_status = &c_thread->exit_status;
|
||||
/* Skip this process because exit_status has been reaped. */
|
||||
if (!c_thread->exit_status) {
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* TODO: define 0x7f in kernel/include/process.h */
|
||||
if (status) {
|
||||
*status = (c_thread->exit_status << 8) | 0x7f;
|
||||
}
|
||||
|
||||
/* Reap exit_status. signal_flags is reaped on receiving */
|
||||
/* signal in do_kill(). */
|
||||
if (!(options & WNOWAIT)) {
|
||||
c_thread->exit_status = 0;
|
||||
}
|
||||
}
|
||||
else if (child->status & (PS_STOPPED | PS_DELAY_STOPPED)) {
|
||||
exit_status = &child->group_exit_status;
|
||||
/* Skip this process because exit_status has been reaped. */
|
||||
if (!child->group_exit_status) {
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* TODO: define 0x7f in kernel/include/process.h */
|
||||
if (status) {
|
||||
*status = (child->group_exit_status << 8) | 0x7f;
|
||||
}
|
||||
|
||||
/* Reap exit_status. signal_flags is reaped on receiving */
|
||||
/* signal in do_kill(). */
|
||||
if (!(options & WNOWAIT)) {
|
||||
child->group_exit_status = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
exit_status = &child->main_thread->exit_status;
|
||||
}
|
||||
/* Skip this process because exit_status has been reaped. */
|
||||
if (!child->main_thread->exit_status) {
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Skip this process because exit_status has been reaped. */
|
||||
if (!*exit_status) {
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
/* TODO: define 0x7f in kernel/include/process.h */
|
||||
if (status) {
|
||||
*status = (child->main_thread->exit_status << 8) | 0x7f;
|
||||
}
|
||||
|
||||
/* TODO: define 0x7f in kernel/include/process.h */
|
||||
if (status) {
|
||||
*status = (*exit_status << 8) | 0x7f;
|
||||
}
|
||||
|
||||
/* Reap exit_status. signal_flags is reaped on receiving signal
|
||||
in do_kill(). */
|
||||
if(!(options & WNOWAIT)) {
|
||||
*exit_status = 0;
|
||||
/* Reap exit_status. signal_flags is reaped on receiving */
|
||||
/* signal in do_kill(). */
|
||||
if (!(options & WNOWAIT)) {
|
||||
child->main_thread->exit_status = 0;
|
||||
}
|
||||
}
|
||||
|
||||
dkprintf("wait_stopped,child->pid=%d,status=%08x\n",
|
||||
@ -3215,7 +3240,6 @@ SYSCALL_DECLARE(kill)
|
||||
return error;
|
||||
}
|
||||
|
||||
// see linux-2.6.34.13/kernel/signal.c
|
||||
SYSCALL_DECLARE(tgkill)
|
||||
{
|
||||
int tgid = ihk_mc_syscall_arg0(ctx);
|
||||
@ -3224,16 +3248,15 @@ SYSCALL_DECLARE(tgkill)
|
||||
struct thread *thread = cpu_local_var(current);
|
||||
struct siginfo info;
|
||||
|
||||
if (tgid <= 0 || tid <= 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(&info, '\0', sizeof info);
|
||||
info.si_signo = sig;
|
||||
info.si_code = SI_TKILL;
|
||||
info._sifields._kill.si_pid = thread->proc->pid;
|
||||
|
||||
if(tid <= 0)
|
||||
return -EINVAL;
|
||||
if(tgid <= 0 && tgid != -1)
|
||||
return -EINVAL;
|
||||
|
||||
return do_kill(thread, tgid, tid, sig, &info, 0);
|
||||
}
|
||||
|
||||
@ -3508,9 +3531,15 @@ SYSCALL_DECLARE(setpgid)
|
||||
|
||||
/* Ignore the registration by start_thread() (in pthread_create.c)
|
||||
because McKernel doesn't unlock mutex-es held by the thread which has been killed. */
|
||||
#define ROBUST_LIST_HEAD_SIZE 24
|
||||
SYSCALL_DECLARE(set_robust_list)
|
||||
{
|
||||
// Palliative fix. wait for impl.
|
||||
size_t len = (size_t)ihk_mc_syscall_arg1(ctx);
|
||||
|
||||
if (len != ROBUST_LIST_HEAD_SIZE) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -6566,71 +6595,162 @@ static int rlimits[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
SYSCALL_DECLARE(setrlimit)
|
||||
static int do_prlimit64(int pid, int resource, struct rlimit *_new_limit,
|
||||
struct rlimit *old_limit)
|
||||
{
|
||||
int rc;
|
||||
int resource = ihk_mc_syscall_arg0(ctx);
|
||||
struct rlimit *rlm = (struct rlimit *)ihk_mc_syscall_arg1(ctx);
|
||||
struct thread *thread = cpu_local_var(current);
|
||||
int i;
|
||||
struct rlimit new_rlim;
|
||||
int mcresource;
|
||||
struct rlimit new_limit;
|
||||
int resource_found;
|
||||
int i;
|
||||
int mcresource;
|
||||
struct process *proc;
|
||||
struct resource_set *rset = cpu_local_var(resource_set);
|
||||
int hash;
|
||||
struct process_hash *phash = rset->process_hash;
|
||||
struct mcs_rwlock_node exist_lock;
|
||||
struct mcs_rwlock_node update_lock;
|
||||
unsigned long irqstate;
|
||||
int found;
|
||||
int ret;
|
||||
ihk_mc_user_context_t ctx;
|
||||
|
||||
if (copy_from_user(&new_rlim, rlm, sizeof(*rlm))) {
|
||||
return -EFAULT;
|
||||
}
|
||||
if (new_rlim.rlim_cur > new_rlim.rlim_max) {
|
||||
if (resource < 0 || resource >= RLIMIT_NLIMITS) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch(resource){
|
||||
case RLIMIT_FSIZE:
|
||||
case RLIMIT_NOFILE:
|
||||
case RLIMIT_LOCKS:
|
||||
case RLIMIT_MSGQUEUE:
|
||||
rc = syscall_generic_forwarding(__NR_setrlimit, ctx);
|
||||
if(rc < 0)
|
||||
return rc;
|
||||
break;
|
||||
}
|
||||
if (_new_limit) {
|
||||
if (copy_from_user(&new_limit, _new_limit,
|
||||
sizeof(struct rlimit))) {
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
for(i = 0; i < sizeof(rlimits) / sizeof(int); i += 2)
|
||||
if(rlimits[i] == resource){
|
||||
mcresource = rlimits[i + 1];
|
||||
if (new_limit.rlim_cur > new_limit.rlim_max) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* update Linux side value as well */
|
||||
switch (resource) {
|
||||
case RLIMIT_FSIZE:
|
||||
case RLIMIT_NOFILE:
|
||||
case RLIMIT_LOCKS:
|
||||
case RLIMIT_MSGQUEUE:
|
||||
ihk_mc_syscall_arg0(&ctx) = pid;
|
||||
ihk_mc_syscall_arg1(&ctx) = resource;
|
||||
ihk_mc_syscall_arg2(&ctx) =
|
||||
(unsigned long)_new_limit;
|
||||
ihk_mc_syscall_arg3(&ctx) =
|
||||
(unsigned long)old_limit;
|
||||
ret = syscall_generic_forwarding(__NR_prlimit64, &ctx);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
break;
|
||||
}
|
||||
if(i >= sizeof(rlimits) / sizeof(int)){
|
||||
return syscall_generic_forwarding(__NR_setrlimit, ctx);
|
||||
}
|
||||
|
||||
memcpy(thread->proc->rlimit + mcresource, &new_rlim,
|
||||
sizeof(new_rlim));
|
||||
/* translate resource */
|
||||
resource_found = 0;
|
||||
for (i = 0; i < sizeof(rlimits) / sizeof(int); i += 2) {
|
||||
if (rlimits[i] == resource) {
|
||||
mcresource = rlimits[i + 1];
|
||||
resource_found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (!resource_found) {
|
||||
ihk_mc_syscall_arg0(&ctx) = pid;
|
||||
ihk_mc_syscall_arg1(&ctx) = resource;
|
||||
ihk_mc_syscall_arg2(&ctx) =
|
||||
(unsigned long)_new_limit;
|
||||
ihk_mc_syscall_arg3(&ctx) =
|
||||
(unsigned long)old_limit;
|
||||
return syscall_generic_forwarding(__NR_prlimit64, &ctx);
|
||||
}
|
||||
|
||||
/* find process */
|
||||
found = 0;
|
||||
|
||||
if (pid == 0) {
|
||||
struct thread *thread = cpu_local_var(current);
|
||||
|
||||
pid = thread->proc->pid;
|
||||
}
|
||||
|
||||
irqstate = cpu_disable_interrupt_save();
|
||||
hash = process_hash(pid);
|
||||
mcs_rwlock_reader_lock_noirq(&phash->lock[hash], &exist_lock);
|
||||
|
||||
list_for_each_entry(proc, &phash->list[hash], hash_list) {
|
||||
if (proc->pid == pid) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
mcs_rwlock_reader_unlock_noirq(&phash->lock[hash], &exist_lock);
|
||||
cpu_restore_interrupt(irqstate);
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (_new_limit) {
|
||||
mcs_rwlock_writer_lock_noirq(&proc->update_lock, &update_lock);
|
||||
} else {
|
||||
mcs_rwlock_reader_lock_noirq(&proc->update_lock, &update_lock);
|
||||
}
|
||||
|
||||
if (old_limit) {
|
||||
if (copy_to_user(old_limit, proc->rlimit + mcresource,
|
||||
sizeof(struct rlimit))) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (_new_limit) {
|
||||
memcpy(proc->rlimit + mcresource, &new_limit,
|
||||
sizeof(struct rlimit));
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
out:
|
||||
if (_new_limit) {
|
||||
mcs_rwlock_writer_unlock_noirq(&proc->update_lock,
|
||||
&update_lock);
|
||||
} else {
|
||||
mcs_rwlock_reader_unlock_noirq(&proc->update_lock,
|
||||
&update_lock);
|
||||
}
|
||||
|
||||
mcs_rwlock_reader_unlock_noirq(&phash->lock[hash], &exist_lock);
|
||||
cpu_restore_interrupt(irqstate);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SYSCALL_DECLARE(setrlimit)
|
||||
{
|
||||
int resource = ihk_mc_syscall_arg0(ctx);
|
||||
struct rlimit *new_limit = (struct rlimit *)ihk_mc_syscall_arg1(ctx);
|
||||
|
||||
return do_prlimit64(0, resource, new_limit, NULL);
|
||||
}
|
||||
|
||||
SYSCALL_DECLARE(getrlimit)
|
||||
{
|
||||
int resource = ihk_mc_syscall_arg0(ctx);
|
||||
struct rlimit *rlm = (struct rlimit *)ihk_mc_syscall_arg1(ctx);
|
||||
struct thread *thread = cpu_local_var(current);
|
||||
int i;
|
||||
int mcresource;
|
||||
struct rlimit *old_limit = (struct rlimit *)ihk_mc_syscall_arg1(ctx);
|
||||
|
||||
for(i = 0; i < sizeof(rlimits) / sizeof(int); i += 2)
|
||||
if(rlimits[i] == resource){
|
||||
mcresource = rlimits[i + 1];
|
||||
break;
|
||||
}
|
||||
if(i >= sizeof(rlimits) / sizeof(int)){
|
||||
return syscall_generic_forwarding(__NR_getrlimit, ctx);
|
||||
}
|
||||
return do_prlimit64(0, resource, NULL, old_limit);
|
||||
}
|
||||
|
||||
// TODO: check limit
|
||||
if(copy_to_user(rlm, thread->proc->rlimit + mcresource, sizeof(struct rlimit)))
|
||||
return -EFAULT;
|
||||
SYSCALL_DECLARE(prlimit64)
|
||||
{
|
||||
int pid = ihk_mc_syscall_arg0(ctx);
|
||||
int resource = ihk_mc_syscall_arg1(ctx);
|
||||
struct rlimit *new_limit = (struct rlimit *)ihk_mc_syscall_arg2(ctx);
|
||||
struct rlimit *old_limit = (struct rlimit *)ihk_mc_syscall_arg3(ctx);
|
||||
|
||||
return 0;
|
||||
return do_prlimit64(pid, resource, new_limit, old_limit);
|
||||
}
|
||||
|
||||
SYSCALL_DECLARE(getrusage)
|
||||
|
||||
56
test/issues/1377/C1377.sh
Normal file
56
test/issues/1377/C1377.sh
Normal file
@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
USELTP=1
|
||||
USEOSTEST=0
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
################################################################################
|
||||
if [ ! -f "$LTPBIN/dirtyc0w" ]; then
|
||||
echo BAD environment: LTP is too old >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "*** C1377T01 start"
|
||||
ng=0
|
||||
ok=0
|
||||
tp=dirtyc0w
|
||||
for ((i=0; i<20; i++)); do
|
||||
for ((j=0; j<50; j++)); do
|
||||
sudo PATH=$PATH:$LTPBIN $MCEXEC $LTPBIN/$tp > $tp.txt 2>&1
|
||||
wok=`grep PASS $tp.txt | wc -l`
|
||||
wng=`grep FAIL $tp.txt | wc -l`
|
||||
if [ $wng != 0 ]; then
|
||||
echo -n '*'
|
||||
ng=`expr $ng + 1`
|
||||
elif [ $wok == 0 ]; then
|
||||
echo -n '?'
|
||||
else
|
||||
echo -n '.'
|
||||
ok=`expr $ok + 1`
|
||||
fi
|
||||
done
|
||||
echo
|
||||
done
|
||||
|
||||
if [ $ng != 0 ]; then
|
||||
echo "*** C1377T01 FAILED ok: $ok, ng: $ng"
|
||||
else
|
||||
echo "*** C1377T01 PASS ok: $ok"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
for i in wait02:02 wait401:03 waitpid01:04 waitpid02:05 waitpid04:06 \
|
||||
waitpid05:07 waitpid06:08 waitpid07:09 waitpid08:10 waitpid09:11 \
|
||||
waitpid10:12 waitpid11:13 waitpid12:14 waitpid13:15; do
|
||||
tp=`echo $i|sed 's/:.*//'`
|
||||
id=`echo $i|sed 's/.*://'`
|
||||
sudo PATH=$PATH:$LTPBIN $MCEXEC $LTPBIN/$tp 2>&1 | tee $tp.txt
|
||||
ok=`grep PASS $tp.txt | wc -l`
|
||||
ng=`grep FAIL $tp.txt | wc -l`
|
||||
if [ $ng = 0 ]; then
|
||||
echo "*** C1377T$id: $tp PASS ($ok)"
|
||||
else
|
||||
echo "*** C1377T$id: $tp FAIL (ok=$ok ng=$ng)"
|
||||
fi
|
||||
done
|
||||
179
test/issues/1377/C1377_arm64.txt
Normal file
179
test/issues/1377/C1377_arm64.txt
Normal file
@ -0,0 +1,179 @@
|
||||
Script started on Tue 16 Jun 2020 02:42:48 PM JST
|
||||
[shirasawa@apollo04 1377]$ make test
|
||||
sh ./C1377.sh
|
||||
mcstop+release.sh ... done
|
||||
mcreboot.sh -c 2-31 -m 2G@0,2G@1 -O ... done
|
||||
*** C1377T01 start
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
*** C1377T01 PASS ok: 1000
|
||||
wait02 1 TPASS : wait(&status) returned 78343
|
||||
*** C1377T02: wait02 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
wait401.c:55: PASS: waitpid() returned correct pid 78457
|
||||
wait401.c:64: PASS: WIFEXITED() is set in status
|
||||
wait401.c:69: PASS: WEXITSTATUS() == 0
|
||||
|
||||
Summary:
|
||||
passed 3
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T03: wait401 PASS (3)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid01.c:51: PASS: waitpid() returned correct pid 78571
|
||||
waitpid01.c:60: PASS: WIFSIGNALED() set in status
|
||||
waitpid01.c:68: PASS: WTERMSIG() == SIGALRM
|
||||
|
||||
Summary:
|
||||
passed 3
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T04: waitpid01 PASS (3)
|
||||
waitpid02 1 TPASS : received expected pid
|
||||
waitpid02 2 TPASS : received expected signal
|
||||
waitpid02 3 TPASS : received expected exit value
|
||||
*** C1377T05: waitpid02 PASS (3)
|
||||
waitpid04 1 TPASS : condition 1 test passed
|
||||
waitpid04 2 TPASS : condition 2 test passed
|
||||
waitpid04 3 TPASS : condition 3 test passed
|
||||
*** C1377T06: waitpid04 PASS (3)
|
||||
waitpid05 1 TPASS : received expected pid.
|
||||
waitpid05 2 TPASS : received expected exit number.
|
||||
waitpid05 3 TPASS : received expected pid.
|
||||
waitpid05 4 TPASS : received expected exit number.
|
||||
waitpid05 5 TPASS : received expected pid.
|
||||
waitpid05 6 TPASS : received expected exit number.
|
||||
waitpid05 7 TPASS : received expected pid.
|
||||
waitpid05 8 TPASS : received expected exit number.
|
||||
waitpid05 9 TPASS : received expected pid.
|
||||
waitpid05 10 TPASS : received expected exit number.
|
||||
waitpid05 11 TPASS : received expected pid.
|
||||
waitpid05 12 TPASS : received expected exit number.
|
||||
waitpid05 13 TPASS : received expected pid.
|
||||
waitpid05 14 TPASS : received expected exit number.
|
||||
waitpid05 15 TPASS : received expected pid.
|
||||
waitpid05 16 TPASS : received expected exit number.
|
||||
waitpid05 17 TPASS : received expected pid.
|
||||
waitpid05 18 TPASS : received expected exit number.
|
||||
waitpid05 19 TPASS : received expected pid.
|
||||
waitpid05 20 TPASS : received expected exit number.
|
||||
waitpid05 21 TPASS : received expected pid.
|
||||
waitpid05 22 TPASS : received expected exit number.
|
||||
waitpid05 23 TPASS : received expected pid.
|
||||
waitpid05 24 TPASS : received expected exit number.
|
||||
*** C1377T07: waitpid05 PASS (24)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid06.c:54: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T08: waitpid06 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid07.c:59: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T09: waitpid07 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80073
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80105
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80137
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80169
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80201
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80233
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80266
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 80298
|
||||
waitpid08.c:62: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T10: waitpid08 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid09.c:83: PASS: waitpid(pid, WNOHANG) = 0 for a running child
|
||||
waitpid09.c:123: PASS: waitpid(pid, WNOHANG) = pid for an exited child
|
||||
waitpid09.c:143: PASS: waitpid(-1, 0) = -1 with ECHILD if no children
|
||||
waitpid09.c:162: PASS: waitpid(-1, WNOHANG) = -1 with ECHILD if no children
|
||||
|
||||
Summary:
|
||||
passed 4
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T11: waitpid09 PASS (4)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid10.c:62: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T12: waitpid10 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid11.c:60: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T13: waitpid11 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid12.c:70: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T14: waitpid12 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 85038
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 85070
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 85102
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 85134
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 84910
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 84942
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 84974
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 85006
|
||||
waitpid13.c:70: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T15: waitpid13 PASS (1)
|
||||
[shirasawa@apollo04 1377]$ exit
|
||||
exit
|
||||
|
||||
Script done on Tue 16 Jun 2020 03:02:48 PM JST
|
||||
179
test/issues/1377/C1377_x86_64.txt
Normal file
179
test/issues/1377/C1377_x86_64.txt
Normal file
@ -0,0 +1,179 @@
|
||||
Script started on Tue Jun 16 15:36:06 2020
|
||||
bash-4.2$ make test
|
||||
sh ./C1377.sh
|
||||
mcstop+release.sh ... done
|
||||
mcreboot.sh -c 1-7,9-15,17-23,25-31 -m 10G@0,10G@1 -r 1-7:0+9-15:8+17-23:16+25-31:24 ... done
|
||||
*** C1377T01 start
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
..................................................
|
||||
*** C1377T01 PASS ok: 1000
|
||||
wait02 1 TPASS : wait(&status) returned 32240
|
||||
*** C1377T02: wait02 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
wait401.c:55: PASS: waitpid() returned correct pid 32347
|
||||
wait401.c:64: PASS: WIFEXITED() is set in status
|
||||
wait401.c:69: PASS: WEXITSTATUS() == 0
|
||||
|
||||
Summary:
|
||||
passed 3
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T03: wait401 PASS (3)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid01.c:51: PASS: waitpid() returned correct pid 32454
|
||||
waitpid01.c:60: PASS: WIFSIGNALED() set in status
|
||||
waitpid01.c:68: PASS: WTERMSIG() == SIGALRM
|
||||
|
||||
Summary:
|
||||
passed 3
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T04: waitpid01 PASS (3)
|
||||
waitpid02 1 TPASS : received expected pid
|
||||
waitpid02 2 TPASS : received expected signal
|
||||
waitpid02 3 TPASS : received expected exit value
|
||||
*** C1377T05: waitpid02 PASS (3)
|
||||
waitpid04 1 TPASS : condition 1 test passed
|
||||
waitpid04 2 TPASS : condition 2 test passed
|
||||
waitpid04 3 TPASS : condition 3 test passed
|
||||
*** C1377T06: waitpid04 PASS (3)
|
||||
waitpid05 1 TPASS : received expected pid.
|
||||
waitpid05 2 TPASS : received expected exit number.
|
||||
waitpid05 3 TPASS : received expected pid.
|
||||
waitpid05 4 TPASS : received expected exit number.
|
||||
waitpid05 5 TPASS : received expected pid.
|
||||
waitpid05 6 TPASS : received expected exit number.
|
||||
waitpid05 7 TPASS : received expected pid.
|
||||
waitpid05 8 TPASS : received expected exit number.
|
||||
waitpid05 9 TPASS : received expected pid.
|
||||
waitpid05 10 TPASS : received expected exit number.
|
||||
waitpid05 11 TPASS : received expected pid.
|
||||
waitpid05 12 TPASS : received expected exit number.
|
||||
waitpid05 13 TPASS : received expected pid.
|
||||
waitpid05 14 TPASS : received expected exit number.
|
||||
waitpid05 15 TPASS : received expected pid.
|
||||
waitpid05 16 TPASS : received expected exit number.
|
||||
waitpid05 17 TPASS : received expected pid.
|
||||
waitpid05 18 TPASS : received expected exit number.
|
||||
waitpid05 19 TPASS : received expected pid.
|
||||
waitpid05 20 TPASS : received expected exit number.
|
||||
waitpid05 21 TPASS : received expected pid.
|
||||
waitpid05 22 TPASS : received expected exit number.
|
||||
waitpid05 23 TPASS : received expected pid.
|
||||
waitpid05 24 TPASS : received expected exit number.
|
||||
*** C1377T07: waitpid05 PASS (24)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid06.c:54: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T08: waitpid06 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid07.c:59: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T09: waitpid07 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1524
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1554
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1584
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1614
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1644
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1674
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1704
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 1734
|
||||
waitpid08.c:62: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T10: waitpid08 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid09.c:83: PASS: waitpid(pid, WNOHANG) = 0 for a running child
|
||||
waitpid09.c:123: PASS: waitpid(pid, WNOHANG) = pid for an exited child
|
||||
waitpid09.c:143: PASS: waitpid(-1, 0) = -1 with ECHILD if no children
|
||||
waitpid09.c:162: PASS: waitpid(-1, WNOHANG) = -1 with ECHILD if no children
|
||||
|
||||
Summary:
|
||||
passed 4
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T11: waitpid09 PASS (4)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid10.c:62: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T12: waitpid10 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid11.c:60: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T13: waitpid11 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid12.c:70: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T14: waitpid12 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6219
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6249
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6279
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6309
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6099
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6129
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6159
|
||||
waitpid_common.h:142: INFO: Sending SIGCONT to 6189
|
||||
waitpid13.c:70: PASS: Test PASSED
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1377T15: waitpid13 PASS (1)
|
||||
bash-4.2$ exit
|
||||
exit
|
||||
|
||||
Script done on Tue Jun 16 15:55:52 2020
|
||||
9
test/issues/1377/Makefile
Normal file
9
test/issues/1377/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
CC = gcc
|
||||
|
||||
all::
|
||||
|
||||
test:: all
|
||||
sh ./C1377.sh
|
||||
|
||||
clean::
|
||||
rm -f $(TARGET) *.o
|
||||
38
test/issues/1377/README
Normal file
38
test/issues/1377/README
Normal file
@ -0,0 +1,38 @@
|
||||
【Issue#1377 動作確認】
|
||||
□ テスト内容
|
||||
1. Issue 指摘事項の再現確認
|
||||
現象はタイミングに依存し、ARM64環境でdirtyc0wを繰り返し実行した際に、
|
||||
数回〜数十回に1回程度発生する。
|
||||
問題の発生はタイミングに依存するため、dirtyc0wを十分な回数繰り返し
|
||||
実行し、問題が再発しないことを確認する。
|
||||
|
||||
C1377T01 dirtyc0wを1000回連続実行し、全てPASSすることを確認
|
||||
|
||||
2. LTP を用いて既存処理に影響しないことを確認
|
||||
プロセスの終了ステータスを変更したため、修正が既存処理に影響しないことを
|
||||
wait系システムコールのLTPを用いて確認する。
|
||||
C1377T02 wait02: waitの基本機能の確認
|
||||
C1377T03 wait401: wait4の基本機能の確認
|
||||
C1377T04 waitpid01: waitpidの基本機能の確認
|
||||
C1377T05 waitpid02: waitpidの基本機能の確認
|
||||
C1377T06 waitpid04: waitpidの基本機能の確認
|
||||
C1377T07 waitpid05: waitpidの基本機能の確認
|
||||
C1377T08 waitpid06: waitpidの基本機能の確認
|
||||
C1377T09 waitpid07: waitpidの基本機能の確認
|
||||
C1377T10 waitpid08: waitpidの基本機能の確認
|
||||
C1377T11 waitpid09: waitpidの基本機能の確認
|
||||
C1377T12 waitpid10: waitpidの基本機能の確認
|
||||
C1377T13 waitpid11: waitpidの基本機能の確認
|
||||
C1377T14 waitpid12: waitpidの基本機能の確認
|
||||
C1377T15 waitpid13: waitpidの基本機能の確認
|
||||
|
||||
□ 実行手順
|
||||
$ make test
|
||||
|
||||
McKernelのインストール先や LTP の配置場所は、$HOME/.mck_test_config を
|
||||
参照する。.mck_test_config は、McKernel をビルドした際に生成される
|
||||
mck_test_config.sample ファイルを $HOME にコピーし、適宜編集すること。
|
||||
|
||||
□ 実行結果
|
||||
C1377_x86_64.txt(x86_64実行結果)、C1377_arm64.txt(arm64実行結果)参照。
|
||||
全ての項目が PASS していることを確認。
|
||||
26
test/issues/1380/C1380.sh
Executable file
26
test/issues/1380/C1380.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#/bin/sh
|
||||
|
||||
USELTP=1
|
||||
USEOSTEST=0
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
issue="1380"
|
||||
tid=01
|
||||
|
||||
for tp in tgkill03 tgkill01 tkill01 tkill02
|
||||
do
|
||||
tname=`printf "C${issue}T%02d" ${tid}`
|
||||
echo "*** ${tname} start *******************************"
|
||||
sudo $MCEXEC $LTPBIN/$tp 2>&1 | tee $tp.txt
|
||||
ok=`grep PASS $tp.txt | wc -l`
|
||||
ng=`grep FAIL $tp.txt | wc -l`
|
||||
if [ $ng = 0 ]; then
|
||||
echo "*** ${tname} PASSED ($ok)"
|
||||
else
|
||||
echo "*** ${tname} FAILED (ok=$ok ng=$ng)"
|
||||
fi
|
||||
let tid++
|
||||
echo ""
|
||||
done
|
||||
|
||||
11
test/issues/1380/Makefile
Normal file
11
test/issues/1380/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
CFLAGS=-g
|
||||
LDFLAGS=
|
||||
|
||||
TARGET=
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
test: all
|
||||
./C1380.sh
|
||||
clean:
|
||||
rm -f $(TARGET) *.o *.txt
|
||||
21
test/issues/1380/README
Normal file
21
test/issues/1380/README
Normal file
@ -0,0 +1,21 @@
|
||||
【Issue#1324 動作確認】
|
||||
□ テスト内容
|
||||
1. 以下のLTPを用いてIssueで報告された症状が発生しないことを確認
|
||||
- tgkill03
|
||||
|
||||
3. 以下のLTPを用いて既存機能に影響が無いことを確認
|
||||
- tgkill01
|
||||
- tkill01
|
||||
- tkill02
|
||||
|
||||
□ 実行手順
|
||||
$ make test
|
||||
|
||||
McKernelのインストール先や、OSTEST, LTPの配置場所は、
|
||||
$HOME/.mck_test_config を参照している
|
||||
.mck_test_config は、McKernelをビルドした際に生成されるmck_test_config.sample ファイルを
|
||||
$HOMEにコピーし、適宜編集する
|
||||
|
||||
□ 実行結果
|
||||
x86_64_result.log aarch64_result.log 参照。
|
||||
すべての項目をPASSしていることを確認。
|
||||
37
test/issues/1380/aarch64_result.log
Normal file
37
test/issues/1380/aarch64_result.log
Normal file
@ -0,0 +1,37 @@
|
||||
*** C1380T01 start *******************************
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
tgkill03.c:92: PASS: Invalid tgid failed as expected: EINVAL
|
||||
tgkill03.c:92: PASS: Invalid tid failed as expected: EINVAL
|
||||
tgkill03.c:92: PASS: Invalid signal failed as expected: EINVAL
|
||||
tgkill03.c:92: PASS: Defunct tid failed as expected: ESRCH
|
||||
tgkill03.c:92: PASS: Defunct tgid failed as expected: ESRCH
|
||||
tgkill03.c:99: PASS: Valid tgkill call succeeded
|
||||
|
||||
Summary:
|
||||
passed 6
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1380T01 PASSED (6)
|
||||
|
||||
*** C1380T02 start *******************************
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
tgkill01.c:99: PASS: SIGUSR1 delivered to correct threads
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1380T02 PASSED (1)
|
||||
|
||||
*** C1380T03 start *******************************
|
||||
tkill01 1 TPASS : tkill call succeeded
|
||||
tkill01 2 TPASS : tkill call succeeded
|
||||
*** C1380T03 PASSED (2)
|
||||
|
||||
*** C1380T04 start *******************************
|
||||
tkill02 1 TPASS : tkill(-1, SIGUSR1) failed as expected: TEST_ERRNO=EINVAL(22): Invalid argument
|
||||
tkill02 2 TPASS : tkill(29822, SIGUSR1) failed as expected: TEST_ERRNO=ESRCH(3): No such process
|
||||
*** C1380T04 PASSED (2)
|
||||
|
||||
37
test/issues/1380/x86_64_result.log
Normal file
37
test/issues/1380/x86_64_result.log
Normal file
@ -0,0 +1,37 @@
|
||||
*** C1380T01 start *******************************
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
tgkill03.c:92: PASS: Invalid tgid failed as expected: EINVAL
|
||||
tgkill03.c:92: PASS: Invalid tid failed as expected: EINVAL
|
||||
tgkill03.c:92: PASS: Invalid signal failed as expected: EINVAL
|
||||
tgkill03.c:92: PASS: Defunct tid failed as expected: ESRCH
|
||||
tgkill03.c:92: PASS: Defunct tgid failed as expected: ESRCH
|
||||
tgkill03.c:99: PASS: Valid tgkill call succeeded
|
||||
|
||||
Summary:
|
||||
passed 6
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1380T01 PASSED (6)
|
||||
|
||||
*** C1380T02 start *******************************
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
tgkill01.c:99: PASS: SIGUSR1 delivered to correct threads
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C1380T02 PASSED (1)
|
||||
|
||||
*** C1380T03 start *******************************
|
||||
tkill01 1 TPASS : tkill call succeeded
|
||||
tkill01 2 TPASS : tkill call succeeded
|
||||
*** C1380T03 PASSED (2)
|
||||
|
||||
*** C1380T04 start *******************************
|
||||
tkill02 1 TPASS : tkill(-1, SIGUSR1) failed as expected: TEST_ERRNO=EINVAL(22): Invalid argument
|
||||
tkill02 2 TPASS : tkill(32768, SIGUSR1) failed as expected: TEST_ERRNO=ESRCH(3): No such process
|
||||
*** C1380T04 PASSED (2)
|
||||
|
||||
41
test/issues/1399/C1399.sh
Executable file
41
test/issues/1399/C1399.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#/bin/sh
|
||||
|
||||
USELTP=1
|
||||
USEOSTEST=0
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
issue="1399"
|
||||
tid=01
|
||||
|
||||
for tno in 01
|
||||
do
|
||||
tname=`printf "C${issue}T%02d" ${tid}`
|
||||
echo "*** ${tname} start *******************************"
|
||||
sudo ${MCEXEC} ./C1399T${tno}
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "*** ${tname} PASSED ******************************"
|
||||
else
|
||||
echo "*** ${tname} FAILED ******************************"
|
||||
fi
|
||||
let tid++
|
||||
echo ""
|
||||
done
|
||||
|
||||
for tp in set_robust_list01 get_robust_list01
|
||||
do
|
||||
tname=`printf "C${issue}T%02d" ${tid}`
|
||||
echo "*** ${tname} start *******************************"
|
||||
sudo $MCEXEC $LTPBIN/$tp 2>&1 | tee $tp.txt
|
||||
ok=`grep PASS $tp.txt | wc -l`
|
||||
ng=`grep FAIL $tp.txt | wc -l`
|
||||
if [ $ng = 0 ]; then
|
||||
echo "*** ${tname} PASSED ($ok)"
|
||||
else
|
||||
echo "*** ${tname} FAILED (ok=$ok ng=$ng)"
|
||||
fi
|
||||
let tid++
|
||||
echo ""
|
||||
done
|
||||
|
||||
36
test/issues/1399/C1399T01.c
Normal file
36
test/issues/1399/C1399T01.c
Normal file
@ -0,0 +1,36 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/futex.h>
|
||||
#include <syscall.h>
|
||||
#include <errno.h>
|
||||
|
||||
int main(int argc, void *argv[])
|
||||
{
|
||||
struct robust_list_head rlh;
|
||||
size_t len = sizeof(struct robust_list_head);
|
||||
int rc = 0, ret = 0;
|
||||
|
||||
errno = 0;
|
||||
rc = syscall(__NR_set_robust_list, &rlh, len + 1);
|
||||
if (rc == -1 && errno == EINVAL) {
|
||||
printf("[OK] invalid len (1 greater than correct): EINVAL\n");
|
||||
} else {
|
||||
printf("[NG] invalid len (1 greater than correct): Succeed\n");
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
rc = syscall(__NR_set_robust_list, &rlh, len - 1);
|
||||
if (rc == -1 && errno == EINVAL) {
|
||||
printf("[OK] invalid len (1 less than correct): EINVAL\n");
|
||||
} else {
|
||||
printf("[NG] invalid len (1 less than correct): Succeed\n");
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
11
test/issues/1399/Makefile
Normal file
11
test/issues/1399/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
CFLAGS=-g
|
||||
LDFLAGS=
|
||||
|
||||
TARGET=C1399T01
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
test: all
|
||||
./C1399.sh
|
||||
clean:
|
||||
rm -f $(TARGET) *.o *.txt
|
||||
24
test/issues/1399/README
Normal file
24
test/issues/1399/README
Normal file
@ -0,0 +1,24 @@
|
||||
【Issue#1399 動作確認】
|
||||
□ テスト内容
|
||||
1. 下記のテストプログラムを実行し、症状が発生しないことを確認する
|
||||
C1399T01:
|
||||
1. struct robust_list_head のサイズよりも1大きい値をサイズとして指定して
|
||||
set_robsut_list を呼び出し、EINVALで失敗することを確認
|
||||
2. struct robust_list_head のサイズよりも1小さい値をサイズとして指定して
|
||||
set_robsut_list を呼び出し、EINVALで失敗することを確認
|
||||
|
||||
2. 以下のLTPを用いて既存のrobust_list機能に影響が無いことを確認
|
||||
- set_robst_list01
|
||||
- get_robst_list01
|
||||
|
||||
□ 実行手順
|
||||
$ make test
|
||||
|
||||
McKernelのインストール先や、OSTEST, LTPの配置場所は、
|
||||
$HOME/.mck_test_config を参照している
|
||||
.mck_test_config は、McKernelをビルドした際に生成されるmck_test_config.sample ファイルを
|
||||
$HOMEにコピーし、適宜編集する
|
||||
|
||||
□ 実行結果
|
||||
x86_64_result.log aarch64_result.log 参照。
|
||||
すべての項目をPASSしていることを確認。
|
||||
18
test/issues/1399/aarch64_result.log
Normal file
18
test/issues/1399/aarch64_result.log
Normal file
@ -0,0 +1,18 @@
|
||||
*** C1399T01 start *******************************
|
||||
[OK] invalid len (1 greater than correct): EINVAL
|
||||
[OK] invalid len (1 less than correct): EINVAL
|
||||
*** C1399T01 PASSED ******************************
|
||||
|
||||
*** C1399T02 start *******************************
|
||||
set_robust_list01 1 TPASS : set_robust_list: retval = -1 (expected -1), errno = 22 (expected 22)
|
||||
set_robust_list01 2 TPASS : set_robust_list: retval = 0 (expected 0), errno = 0 (expected 0)
|
||||
*** C1399T02 PASSED (2)
|
||||
|
||||
*** C1399T03 start *******************************
|
||||
get_robust_list01 1 TPASS : get_robust_list failed as expected with EFAULT
|
||||
get_robust_list01 2 TPASS : get_robust_list failed as expected with EFAULT
|
||||
get_robust_list01 3 TPASS : get_robust_list failed as expected with ESRCH
|
||||
get_robust_list01 4 TPASS : get_robust_list succeeded
|
||||
get_robust_list01 5 TPASS : get_robust_list failed as expected with EPERM
|
||||
*** C1399T03 PASSED (5)
|
||||
|
||||
18
test/issues/1399/x86_64_result.log
Normal file
18
test/issues/1399/x86_64_result.log
Normal file
@ -0,0 +1,18 @@
|
||||
*** C1399T01 start *******************************
|
||||
[OK] invalid len (1 greater than correct): EINVAL
|
||||
[OK] invalid len (1 less than correct): EINVAL
|
||||
*** C1399T01 PASSED ******************************
|
||||
|
||||
*** C1399T02 start *******************************
|
||||
set_robust_list01 1 TPASS : set_robust_list: retval = -1 (expected -1), errno = 22 (expected 22)
|
||||
set_robust_list01 2 TPASS : set_robust_list: retval = 0 (expected 0), errno = 0 (expected 0)
|
||||
*** C1399T02 PASSED (2)
|
||||
|
||||
*** C1399T03 start *******************************
|
||||
get_robust_list01 1 TPASS : get_robust_list failed as expected with EFAULT
|
||||
get_robust_list01 2 TPASS : get_robust_list failed as expected with EFAULT
|
||||
get_robust_list01 3 TPASS : get_robust_list failed as expected with ESRCH
|
||||
get_robust_list01 4 TPASS : get_robust_list succeeded
|
||||
get_robust_list01 5 TPASS : get_robust_list failed as expected with EPERM
|
||||
*** C1399T03 PASSED (5)
|
||||
|
||||
43
test/issues/1425/C1425.sh
Executable file
43
test/issues/1425/C1425.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#/bin/sh
|
||||
|
||||
USELTP=1
|
||||
USEOSTEST=0
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
issue="1425"
|
||||
tid=01
|
||||
|
||||
STOPSIG_LIST="TSTP TTIN TTOU"
|
||||
|
||||
for signame in ${STOPSIG_LIST}
|
||||
do
|
||||
tname=`printf "C${issue}T%02d" ${tid}`
|
||||
echo "*** ${tname} start *******************************"
|
||||
sh ./check_stopsig.sh ${MCEXEC} ${signame}
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "*** ${tname} PASSED ******************************"
|
||||
else
|
||||
echo "*** ${tname} FAILED ******************************"
|
||||
fi
|
||||
let tid++
|
||||
echo ""
|
||||
done
|
||||
|
||||
for tp in kill01 kill02 kill06 kill07 kill08 kill09 signal01 signal03 signal04 signal05
|
||||
do
|
||||
tname=`printf "C${issue}T%02d" ${tid}`
|
||||
echo "*** ${tname} start *******************************"
|
||||
sudo $MCEXEC $LTPBIN/$tp 2>&1 | tee $tp.txt
|
||||
ok=`grep PASS $tp.txt | wc -l`
|
||||
ng=`grep FAIL $tp.txt | wc -l`
|
||||
if [ $ng = 0 ]; then
|
||||
echo "*** ${tname} PASSED ($ok)"
|
||||
else
|
||||
echo "*** ${tname} FAILED (ok=$ok ng=$ng)"
|
||||
fi
|
||||
let tid++
|
||||
echo ""
|
||||
done
|
||||
|
||||
11
test/issues/1425/Makefile
Normal file
11
test/issues/1425/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
CFLAGS=-g
|
||||
LDFLAGS=
|
||||
|
||||
TARGET=
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
test: all
|
||||
sh ./C1425.sh
|
||||
clean:
|
||||
rm -f $(TARGET) *.o *.txt
|
||||
37
test/issues/1425/README
Normal file
37
test/issues/1425/README
Normal file
@ -0,0 +1,37 @@
|
||||
【Issue#1425 動作確認】
|
||||
□ テスト内容
|
||||
1. 本修正ではmcexecにてSIGTSTP, SIGTTIN, SIGTTOU を補足しないようにする
|
||||
修正を実施した。
|
||||
上記のシグナルのデフォルト動作はプロセスの停止である。
|
||||
それぞれのシグナルについて、以下を確認する。
|
||||
- 実行中のMcKernelプロセスに通知した際、通知先のプロセスが停止する
|
||||
- 停止されたプロセスに対してSIGCONTを通知することで、プロセスが再開できる
|
||||
|
||||
C1425T01: SIGTSTP の動作を確認
|
||||
C1425T02: SIGTTIN の動作を確認
|
||||
C1425T03: SIGTTOU の動作を確認
|
||||
|
||||
2. 以下のLTPを用いて既存のsignal機能に影響が無いことを確認
|
||||
- kill01
|
||||
- kill02
|
||||
- kill06
|
||||
- kill07
|
||||
- kill08
|
||||
- kill09
|
||||
- signal01
|
||||
- signal03
|
||||
- signal04
|
||||
- signal05
|
||||
|
||||
□ 実行手順
|
||||
・下記の手順でテストを実行する
|
||||
$ make test
|
||||
|
||||
McKernelのインストール先や、OSTEST, LTPの配置場所は、
|
||||
$HOME/.mck_test_config を参照している
|
||||
.mck_test_config は、McKernelをビルドした際に生成されるmck_test_config.sample ファイルを
|
||||
$HOMEにコピーし、適宜編集する
|
||||
|
||||
□ 実行結果
|
||||
x86_64_result.log, aarch64_result.log 参照。
|
||||
すべての項目をPASSしていることを確認。
|
||||
176
test/issues/1425/aarch64_result.log
Normal file
176
test/issues/1425/aarch64_result.log
Normal file
@ -0,0 +1,176 @@
|
||||
*** C1425T01 start *******************************
|
||||
** Exec sleep 3
|
||||
** TargetPID: 52277
|
||||
[OK] 52277 is running : S+
|
||||
** SEND SIGTSTP to 52277
|
||||
[OK] 52277 is stopped : T+
|
||||
** Sleep 3 sec
|
||||
[OK] 52277 is still stopped : T+
|
||||
** SEND SIGCONT to 52277
|
||||
** Wait pid: 52277
|
||||
[OK] pid: 52277 is Done.
|
||||
*** C1425T01 PASSED ******************************
|
||||
|
||||
*** C1425T02 start *******************************
|
||||
** Exec sleep 3
|
||||
** TargetPID: 52330
|
||||
[OK] 52330 is running : SLl+
|
||||
** SEND SIGTTIN to 52330
|
||||
[OK] 52330 is stopped : TLl+
|
||||
** Sleep 3 sec
|
||||
[OK] 52330 is still stopped : TLl+
|
||||
** SEND SIGCONT to 52330
|
||||
** Wait pid: 52330
|
||||
[OK] pid: 52330 is Done.
|
||||
*** C1425T02 PASSED ******************************
|
||||
|
||||
*** C1425T03 start *******************************
|
||||
** Exec sleep 3
|
||||
** TargetPID: 52378
|
||||
[OK] 52378 is running : SLl+
|
||||
** SEND SIGTTOU to 52378
|
||||
[OK] 52378 is stopped : TLl+
|
||||
** Sleep 3 sec
|
||||
[OK] 52378 is still stopped : TLl+
|
||||
** SEND SIGCONT to 52378
|
||||
** Wait pid: 52378
|
||||
[OK] pid: 52378 is Done.
|
||||
*** C1425T03 PASSED ******************************
|
||||
|
||||
*** C1425T04 start *******************************
|
||||
kill01 1 TPASS : received expected signal 9
|
||||
*** C1425T04 PASSED (1)
|
||||
|
||||
*** C1425T05 start *******************************
|
||||
kill02 1 TPASS : The signal was sent to all processes in the process group.
|
||||
kill02 2 TPASS : The signal was not sent to selective processes that were not in the process group.
|
||||
*** C1425T05 PASSED (2)
|
||||
|
||||
*** C1425T06 start *******************************
|
||||
kill06 1 TPASS : received expected signal 9
|
||||
*** C1425T06 PASSED (1)
|
||||
|
||||
*** C1425T07 start *******************************
|
||||
kill07 0 TINFO : received expected signal 9
|
||||
kill07 1 TPASS : Did not catch signal as expected
|
||||
*** C1425T07 PASSED (1)
|
||||
|
||||
*** C1425T08 start *******************************
|
||||
kill08 1 TPASS : received expected signal 9
|
||||
*** C1425T08 PASSED (1)
|
||||
|
||||
*** C1425T09 start *******************************
|
||||
kill09 1 TPASS : kill(52839, SIGKILL) returned 0
|
||||
*** C1425T09 PASSED (1)
|
||||
|
||||
*** C1425T10 start *******************************
|
||||
signal01 1 TPASS : signal(SIGKILL, 0x1(SIG_IGN)) failed with EINVAL
|
||||
signal01 0 TINFO : Child process returned TPASS
|
||||
signal01 1 TPASS : signal(SIGKILL, (nil)(SIG_DFL)) failed with EINVAL
|
||||
signal01 0 TINFO : Child process returned TPASS
|
||||
signal01 1 TPASS : signal(SIGKILL, 0x403b20(catchsig())) failed with EINVAL
|
||||
signal01 0 TINFO : Child process returned TPASS
|
||||
signal01 1 TPASS : Child killed with SIGKILL
|
||||
signal01 2 TPASS : Child killed with SIGKILL
|
||||
signal01 3 TPASS : Child killed with SIGKILL
|
||||
*** C1425T10 PASSED (9)
|
||||
|
||||
*** C1425T11 start *******************************
|
||||
signal03 1 TPASS : signal03 call succeeded
|
||||
signal03 2 TPASS : signal03 call succeeded
|
||||
signal03 3 TPASS : signal03 call succeeded
|
||||
signal03 4 TPASS : signal03 call succeeded
|
||||
signal03 5 TPASS : signal03 call succeeded
|
||||
signal03 6 TPASS : signal03 call succeeded
|
||||
signal03 7 TPASS : signal03 call succeeded
|
||||
signal03 8 TPASS : signal03 call succeeded
|
||||
signal03 9 TPASS : signal03 call succeeded
|
||||
signal03 10 TPASS : signal03 call succeeded
|
||||
signal03 11 TPASS : signal03 call succeeded
|
||||
signal03 12 TPASS : signal03 call succeeded
|
||||
signal03 13 TPASS : signal03 call succeeded
|
||||
signal03 14 TPASS : signal03 call succeeded
|
||||
signal03 15 TPASS : signal03 call succeeded
|
||||
signal03 16 TPASS : signal03 call succeeded
|
||||
signal03 17 TPASS : signal03 call succeeded
|
||||
signal03 18 TPASS : signal03 call succeeded
|
||||
signal03 19 TPASS : signal03 call succeeded
|
||||
signal03 20 TPASS : signal03 call succeeded
|
||||
signal03 21 TPASS : signal03 call succeeded
|
||||
signal03 22 TPASS : signal03 call succeeded
|
||||
signal03 23 TPASS : signal03 call succeeded
|
||||
signal03 24 TPASS : signal03 call succeeded
|
||||
signal03 25 TPASS : signal03 call succeeded
|
||||
signal03 26 TPASS : signal03 call succeeded
|
||||
signal03 27 TPASS : signal03 call succeeded
|
||||
signal03 28 TPASS : signal03 call succeeded
|
||||
signal03 29 TPASS : signal03 call succeeded
|
||||
signal03 30 TPASS : signal03 call succeeded
|
||||
signal03 31 TPASS : signal03 call succeeded
|
||||
*** C1425T11 PASSED (31)
|
||||
|
||||
*** C1425T12 start *******************************
|
||||
signal04 1 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 2 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 3 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 4 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 5 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 6 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 7 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 8 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 9 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 10 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 11 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 12 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 13 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 14 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 15 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 16 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 17 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 18 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 19 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 20 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 21 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 22 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 23 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 24 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 25 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 26 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 27 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 28 TPASS : signal04 call succeeded received (nil).
|
||||
*** C1425T12 PASSED (28)
|
||||
|
||||
*** C1425T13 start *******************************
|
||||
signal05 1 TPASS : signal05 call succeeded
|
||||
signal05 2 TPASS : signal05 call succeeded
|
||||
signal05 3 TPASS : signal05 call succeeded
|
||||
signal05 4 TPASS : signal05 call succeeded
|
||||
signal05 5 TPASS : signal05 call succeeded
|
||||
signal05 6 TPASS : signal05 call succeeded
|
||||
signal05 7 TPASS : signal05 call succeeded
|
||||
signal05 8 TPASS : signal05 call succeeded
|
||||
signal05 9 TPASS : signal05 call succeeded
|
||||
signal05 10 TPASS : signal05 call succeeded
|
||||
signal05 11 TPASS : signal05 call succeeded
|
||||
signal05 12 TPASS : signal05 call succeeded
|
||||
signal05 13 TPASS : signal05 call succeeded
|
||||
signal05 14 TPASS : signal05 call succeeded
|
||||
signal05 15 TPASS : signal05 call succeeded
|
||||
signal05 16 TPASS : signal05 call succeeded
|
||||
signal05 17 TPASS : signal05 call succeeded
|
||||
signal05 18 TPASS : signal05 call succeeded
|
||||
signal05 19 TPASS : signal05 call succeeded
|
||||
signal05 20 TPASS : signal05 call succeeded
|
||||
signal05 21 TPASS : signal05 call succeeded
|
||||
signal05 22 TPASS : signal05 call succeeded
|
||||
signal05 23 TPASS : signal05 call succeeded
|
||||
signal05 24 TPASS : signal05 call succeeded
|
||||
signal05 25 TPASS : signal05 call succeeded
|
||||
signal05 26 TPASS : signal05 call succeeded
|
||||
signal05 27 TPASS : signal05 call succeeded
|
||||
signal05 28 TPASS : signal05 call succeeded
|
||||
signal05 29 TPASS : signal05 call succeeded
|
||||
signal05 30 TPASS : signal05 call succeeded
|
||||
signal05 31 TPASS : signal05 call succeeded
|
||||
*** C1425T13 PASSED (31)
|
||||
|
||||
55
test/issues/1425/check_stopsig.sh
Executable file
55
test/issues/1425/check_stopsig.sh
Executable file
@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
rc=0
|
||||
slptime=3
|
||||
|
||||
mcexec=$1
|
||||
signame=$2
|
||||
|
||||
echo "** Exec sleep ${slptime}"
|
||||
mcexec sleep ${slptime} &
|
||||
tgtpid=$!
|
||||
|
||||
echo "** TargetPID: ${tgtpid}"
|
||||
stat_1=`ps -o stat,pid -p ${tgtpid} | grep ${tgtpid} | cut -f1 -d ' '`
|
||||
|
||||
if [ `echo ${stat_1} | grep -e "^S" | wc -l` -eq 1 ]; then
|
||||
echo "[OK] ${tgtpid} is running : ${stat_1}"
|
||||
else
|
||||
echo "[NG] ${tgtpid} is NOT running : ${stat_1}"
|
||||
rc=1
|
||||
fi
|
||||
|
||||
echo "** SEND SIG${signame} to ${tgtpid}"
|
||||
kill -${signame} ${tgtpid}
|
||||
sleep 1
|
||||
|
||||
stat_2=`ps -o stat,pid -p ${tgtpid} | grep ${tgtpid} | cut -f1 -d ' '`
|
||||
|
||||
if [ `echo ${stat_2} | grep -e "^T" | wc -l` -eq 1 ]; then
|
||||
echo "[OK] ${tgtpid} is stopped : ${stat_2}"
|
||||
else
|
||||
echo "[NG] ${tgtpid} is NOT stopped : ${stat_2}"
|
||||
rc=1
|
||||
fi
|
||||
|
||||
echo "** Sleep ${slptime} sec"
|
||||
sleep ${slptime}
|
||||
|
||||
stat_3=`ps -o stat,pid -p ${tgtpid} | grep ${tgtpid} | cut -f1 -d ' '`
|
||||
|
||||
if [ `echo ${stat_2} | grep -e "^T" | wc -l` -eq 1 ]; then
|
||||
echo "[OK] ${tgtpid} is still stopped : ${stat_3}"
|
||||
else
|
||||
echo "[NG] ${tgtpid} is NOT stopped : ${stat_3}"
|
||||
rc=1
|
||||
fi
|
||||
|
||||
echo "** SEND SIGCONT to ${tgtpid}"
|
||||
kill -CONT ${tgtpid}
|
||||
|
||||
echo "** Wait pid: ${tgtpid}"
|
||||
wait ${tgtpid}
|
||||
|
||||
echo "[OK] pid: ${tgtpid} is Done."
|
||||
exit ${rc}
|
||||
176
test/issues/1425/x86_64_result.log
Normal file
176
test/issues/1425/x86_64_result.log
Normal file
@ -0,0 +1,176 @@
|
||||
*** C1425T01 start *******************************
|
||||
** Exec sleep 3
|
||||
** TargetPID: 5737
|
||||
[OK] 5737 is running : S+
|
||||
** SEND SIGTSTP to 5737
|
||||
[OK] 5737 is stopped : TL+
|
||||
** Sleep 3 sec
|
||||
[OK] 5737 is still stopped : TL+
|
||||
** SEND SIGCONT to 5737
|
||||
** Wait pid: 5737
|
||||
[OK] pid: 5737 is Done.
|
||||
*** C1425T01 PASSED ******************************
|
||||
|
||||
*** C1425T02 start *******************************
|
||||
** Exec sleep 3
|
||||
** TargetPID: 5798
|
||||
[OK] 5798 is running : SLl+
|
||||
** SEND SIGTTIN to 5798
|
||||
[OK] 5798 is stopped : TLl+
|
||||
** Sleep 3 sec
|
||||
[OK] 5798 is still stopped : TLl+
|
||||
** SEND SIGCONT to 5798
|
||||
** Wait pid: 5798
|
||||
[OK] pid: 5798 is Done.
|
||||
*** C1425T02 PASSED ******************************
|
||||
|
||||
*** C1425T03 start *******************************
|
||||
** Exec sleep 3
|
||||
** TargetPID: 5859
|
||||
[OK] 5859 is running : SLl+
|
||||
** SEND SIGTTOU to 5859
|
||||
[OK] 5859 is stopped : TLl+
|
||||
** Sleep 3 sec
|
||||
[OK] 5859 is still stopped : TLl+
|
||||
** SEND SIGCONT to 5859
|
||||
** Wait pid: 5859
|
||||
[OK] pid: 5859 is Done.
|
||||
*** C1425T03 PASSED ******************************
|
||||
|
||||
*** C1425T04 start *******************************
|
||||
kill01 1 TPASS : received expected signal 9
|
||||
*** C1425T04 PASSED (1)
|
||||
|
||||
*** C1425T05 start *******************************
|
||||
kill02 1 TPASS : The signal was sent to all processes in the process group.
|
||||
kill02 2 TPASS : The signal was not sent to selective processes that were not in the process group.
|
||||
*** C1425T05 PASSED (2)
|
||||
|
||||
*** C1425T06 start *******************************
|
||||
kill06 1 TPASS : received expected signal 9
|
||||
*** C1425T06 PASSED (1)
|
||||
|
||||
*** C1425T07 start *******************************
|
||||
kill07 0 TINFO : received expected signal 9
|
||||
kill07 1 TPASS : Did not catch signal as expected
|
||||
*** C1425T07 PASSED (1)
|
||||
|
||||
*** C1425T08 start *******************************
|
||||
kill08 1 TPASS : received expected signal 9
|
||||
*** C1425T08 PASSED (1)
|
||||
|
||||
*** C1425T09 start *******************************
|
||||
kill09 1 TPASS : kill(6713, SIGKILL) returned 0
|
||||
*** C1425T09 PASSED (1)
|
||||
|
||||
*** C1425T10 start *******************************
|
||||
signal01 1 TPASS : signal(SIGKILL, 0x1(SIG_IGN)) failed with EINVAL
|
||||
signal01 0 TINFO : Child process returned TPASS
|
||||
signal01 1 TPASS : signal(SIGKILL, (nil)(SIG_DFL)) failed with EINVAL
|
||||
signal01 0 TINFO : Child process returned TPASS
|
||||
signal01 1 TPASS : signal(SIGKILL, 0x403620(catchsig())) failed with EINVAL
|
||||
signal01 0 TINFO : Child process returned TPASS
|
||||
signal01 1 TPASS : Child killed with SIGKILL
|
||||
signal01 2 TPASS : Child killed with SIGKILL
|
||||
signal01 3 TPASS : Child killed with SIGKILL
|
||||
*** C1425T10 PASSED (9)
|
||||
|
||||
*** C1425T11 start *******************************
|
||||
signal03 1 TPASS : signal03 call succeeded
|
||||
signal03 2 TPASS : signal03 call succeeded
|
||||
signal03 3 TPASS : signal03 call succeeded
|
||||
signal03 4 TPASS : signal03 call succeeded
|
||||
signal03 5 TPASS : signal03 call succeeded
|
||||
signal03 6 TPASS : signal03 call succeeded
|
||||
signal03 7 TPASS : signal03 call succeeded
|
||||
signal03 8 TPASS : signal03 call succeeded
|
||||
signal03 9 TPASS : signal03 call succeeded
|
||||
signal03 10 TPASS : signal03 call succeeded
|
||||
signal03 11 TPASS : signal03 call succeeded
|
||||
signal03 12 TPASS : signal03 call succeeded
|
||||
signal03 13 TPASS : signal03 call succeeded
|
||||
signal03 14 TPASS : signal03 call succeeded
|
||||
signal03 15 TPASS : signal03 call succeeded
|
||||
signal03 16 TPASS : signal03 call succeeded
|
||||
signal03 17 TPASS : signal03 call succeeded
|
||||
signal03 18 TPASS : signal03 call succeeded
|
||||
signal03 19 TPASS : signal03 call succeeded
|
||||
signal03 20 TPASS : signal03 call succeeded
|
||||
signal03 21 TPASS : signal03 call succeeded
|
||||
signal03 22 TPASS : signal03 call succeeded
|
||||
signal03 23 TPASS : signal03 call succeeded
|
||||
signal03 24 TPASS : signal03 call succeeded
|
||||
signal03 25 TPASS : signal03 call succeeded
|
||||
signal03 26 TPASS : signal03 call succeeded
|
||||
signal03 27 TPASS : signal03 call succeeded
|
||||
signal03 28 TPASS : signal03 call succeeded
|
||||
signal03 29 TPASS : signal03 call succeeded
|
||||
signal03 30 TPASS : signal03 call succeeded
|
||||
signal03 31 TPASS : signal03 call succeeded
|
||||
*** C1425T11 PASSED (31)
|
||||
|
||||
*** C1425T12 start *******************************
|
||||
signal04 1 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 2 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 3 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 4 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 5 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 6 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 7 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 8 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 9 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 10 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 11 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 12 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 13 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 14 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 15 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 16 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 17 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 18 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 19 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 20 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 21 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 22 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 23 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 24 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 25 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 26 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 27 TPASS : signal04 call succeeded received (nil).
|
||||
signal04 28 TPASS : signal04 call succeeded received (nil).
|
||||
*** C1425T12 PASSED (28)
|
||||
|
||||
*** C1425T13 start *******************************
|
||||
signal05 1 TPASS : signal05 call succeeded
|
||||
signal05 2 TPASS : signal05 call succeeded
|
||||
signal05 3 TPASS : signal05 call succeeded
|
||||
signal05 4 TPASS : signal05 call succeeded
|
||||
signal05 5 TPASS : signal05 call succeeded
|
||||
signal05 6 TPASS : signal05 call succeeded
|
||||
signal05 7 TPASS : signal05 call succeeded
|
||||
signal05 8 TPASS : signal05 call succeeded
|
||||
signal05 9 TPASS : signal05 call succeeded
|
||||
signal05 10 TPASS : signal05 call succeeded
|
||||
signal05 11 TPASS : signal05 call succeeded
|
||||
signal05 12 TPASS : signal05 call succeeded
|
||||
signal05 13 TPASS : signal05 call succeeded
|
||||
signal05 14 TPASS : signal05 call succeeded
|
||||
signal05 15 TPASS : signal05 call succeeded
|
||||
signal05 16 TPASS : signal05 call succeeded
|
||||
signal05 17 TPASS : signal05 call succeeded
|
||||
signal05 18 TPASS : signal05 call succeeded
|
||||
signal05 19 TPASS : signal05 call succeeded
|
||||
signal05 20 TPASS : signal05 call succeeded
|
||||
signal05 21 TPASS : signal05 call succeeded
|
||||
signal05 22 TPASS : signal05 call succeeded
|
||||
signal05 23 TPASS : signal05 call succeeded
|
||||
signal05 24 TPASS : signal05 call succeeded
|
||||
signal05 25 TPASS : signal05 call succeeded
|
||||
signal05 26 TPASS : signal05 call succeeded
|
||||
signal05 27 TPASS : signal05 call succeeded
|
||||
signal05 28 TPASS : signal05 call succeeded
|
||||
signal05 29 TPASS : signal05 call succeeded
|
||||
signal05 30 TPASS : signal05 call succeeded
|
||||
signal05 31 TPASS : signal05 call succeeded
|
||||
*** C1425T13 PASSED (31)
|
||||
|
||||
Reference in New Issue
Block a user