fix compiler build issue

This commit is contained in:
criyle 2019-06-23 18:10:52 -07:00
parent 23c02267e6
commit edf753d07b
2 changed files with 11 additions and 9 deletions

View File

@ -69,7 +69,7 @@ func (s *FileSet) AddRange(names []string, workPath string) {
if filepath.IsAbs(n) {
s.Set[n] = true
} else {
s.Set[filepath.Join(workPath, n)] = true
s.Set[filepath.Join(workPath, n)+"/"] = true
}
}
}

View File

@ -102,17 +102,20 @@ func Trace(handler Handler, runner Runner, limits ResLimit) (result TraceResult,
case wstatus.Exited():
delete(traced, pid)
handler.Debug("process exited: ", pid, wstatus.ExitStatus())
if execved {
result.ExitCode = wstatus.ExitStatus()
return result, nil
if pid == pgid {
if execved {
result.ExitCode = wstatus.ExitStatus()
return result, nil
}
result.TraceStatus = TraceCodeFatal
return result, TraceCodeFatal
}
result.TraceStatus = TraceCodeFatal
return result, TraceCodeFatal
case wstatus.Signaled():
sig := wstatus.Signal()
handler.Debug("ptrace signaled: ", sig)
if pid == pgid {
delete(traced, pid)
switch sig {
case unix.SIGXCPU:
status = TraceCodeTLE
@ -126,7 +129,7 @@ func Trace(handler Handler, runner Runner, limits ResLimit) (result TraceResult,
result.TraceStatus = status
return result, status
}
delete(traced, pid)
unix.PtraceCont(pid, int(sig))
case wstatus.Stopped():
// Set option if the process is newly forked
@ -172,10 +175,9 @@ func Trace(handler Handler, runner Runner, limits ResLimit) (result TraceResult,
}
} else {
// Likely encountered SIGSEGV (segment violation)
// Or compiler child exited
if stopSig != unix.SIGSTOP {
handler.Debug("ptrace unexpected stop signal: ", stopSig)
result.TraceStatus = TraceCodeRE
return result, TraceCodeRE
}
handler.Debug("ptrace stopped")
}