Hi Roland, hi everybody,

I have finished teaching my spring term so I am back working on utrace.

I am porting my stuff about virtualquare kmview on the new version of
kernels.
I ran into something that seems to be a bug on PTRACE_SINGLEBLOCK.

The source code here enclosed says "OKAY" on a standard 2.6.25.4,
while it generates a kernel panic on a 2.6.25.4 +
http://people.redhat.com/roland/utrace/2.6-current/linux-2.6-utrace.patch.

Is this a bug? (I think so, no combination of syscall parms should
ever generate kernel panics ;)
Is this a known bug? (e.g. because PTRACE_SINGLEBLOCK is already a WIP
with utrace and you are already working on it...)

ciao
        renzo

---
#include <stdio.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/ptrace.h>
#include <errno.h>

static int child(void *arg)
{
  if(ptrace(PTRACE_TRACEME, 0, 0, 0) < 0){
    perror("ptrace traceme");
  }
  kill(getpid(), SIGSTOP);
  return 0;
}

int main()
{
  int pid, status, rv;
  static char stack[1024];

  if((pid = clone(child, &stack[1020], SIGCHLD, NULL)) < 0){
    perror("clone");
    return 0;
  }
  if((pid = waitpid(pid, &status, WUNTRACED)) < 0){
    perror("Waiting for stop");
    return 0;
  }
  ptrace(33, pid, 0, 0); /* PTRACE_SINGLEBLOCK */
  printf("OKAY\n");
  return 0;
}

Reply via email to