http://codereview.appspot.com/1381041/diff/2001/3001 File src/pkg/runtime/windows/386/sys.s (right): http://codereview.appspot.com/1381041/diff/2001/3001#newcode16 src/pkg/runtime/windows/386/sys.s:16: // ADDED(brainman): It should be ok now as all ...
15 years, 10 months ago
(2010-06-03 01:00:42 UTC)
#2
> Can we just fix the calls in thread.c and mem.c too? > Would love ...
15 years, 10 months ago
(2010-06-04 03:08:21 UTC)
#3
> Can we just fix the calls in thread.c and mem.c too?
>
Would love to. In fact we have to now that I see my program crashing with
corrupted memory again. I have disabled write() function in thread.c and
everything is good again. So, I channeled all stcall in write() via test_stdcall
instead, like so:
#pragma textflag 7
void *
test_stdcall(void *fn, ...)
{
uintptr *arg;
stdcall_params p;
arg = (uintptr*)(((uintptr*)&fn)+1);
p.f = fn;
p.args[0] = arg[0];
p.args[1] = arg[1];
p.args[2] = arg[2];
p.args[3] = arg[3];
p.args[4] = arg[4];
onosstack(call_stdcall, &p);
return (void*)(p.r);
}
but it doesn't help - it prints for a while, and then crashes like before.
I know, I'll work it out myself in 500 years, but I'm lazy. When in go, runtime
makes sure we have enough stack to run, but what happens once you're inside
runtime C code. How does runtime make sure there is enough stack to run runtime
C code, all function calls and stack variables and stuff?
Alex
http://codereview.appspot.com/1381041/diff/14001/15003 File src/pkg/runtime/windows/os.h (right): http://codereview.appspot.com/1381041/diff/14001/15003#newcode25 src/pkg/runtime/windows/os.h:25: // and swtich to os stack during the call. ...
15 years, 10 months ago
(2010-06-08 01:19:23 UTC)
#8
looks good http://codereview.appspot.com/1381041/diff/25001/26004 File src/pkg/runtime/windows/syscall.goc (right): http://codereview.appspot.com/1381041/diff/25001/26004#newcode11 src/pkg/runtime/windows/syscall.goc:11: ·entersyscall(); Just to keep them visible, please ...
15 years, 10 months ago
(2010-06-10 06:05:17 UTC)
#10
*** Submitted as http://code.google.com/p/go/source/detail?r=821ca9bf0ec5 *** runtime: switch to OS stack during Windows syscall R=rsc CC=golang-dev ...
15 years, 9 months ago
(2010-06-11 08:38:22 UTC)
#14
Issue 1381041: code review 1381041: switch to os stack during windows Syscall()
(Closed)
Created 15 years, 10 months ago by brainman
Modified 15 years, 9 months ago
Reviewers:
Base URL:
Comments: 11