From 3152304e53f502750aaefcfb5144ac80bb09c06c Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 25 Apr 2008 21:42:04 +0000 Subject: [PATCH] Moved creation of the kernel tracing entry for exec_team() to a later point where the argument vector has already been copied to the kernel. Before it was crashing when the syscall provided a bad address. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25167 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/team.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp index 6588bdd787..7b857b6465 100644 --- a/src/system/kernel/team.cpp +++ b/src/system/kernel/team.cpp @@ -1306,8 +1306,6 @@ exec_team(const char *path, int32 argCount, char * const *args, TRACE(("exec_team(path = \"%s\", argc = %ld, envCount = %ld): team %ld\n", args[0], argCount, envCount, team->id)); - T(ExecTeam(path, argCount, args, envCount, env)); - // switching the kernel at run time is probably not a good idea :) if (team == team_get_kernel_team()) return B_NOT_ALLOWED; @@ -1348,6 +1346,9 @@ exec_team(const char *path, int32 argCount, char * const *args, if (status != B_OK) return status; + T(ExecTeam(path, teamArgs->arg_count, teamArgs->args, envCount, env)); + // trace here, so we don't have to deal with the user addresses + // replace args[0] with the path argument, just to be on the safe side free(teamArgs->args[0]); teamArgs->args[0] = strdup(path);