1
0
mirror of https://github.com/golang/go synced 2024-10-02 14:28:38 -06:00
Commit Graph

10 Commits

Author SHA1 Message Date
Russ Cox
1a4599b41a runtime: clear locked bit when goroutine exits
Otherwise the next goroutine run on the m
can get inadvertently locked if it executes a cgo call
that turns on the internal lock.

While we're here, fix the cgo panic unwind to
decrement m->ncgo like the non-panic unwind does.

Fixes #4971.

R=golang-dev, iant, dvyukov
CC=golang-dev
https://golang.org/cl/7627043
2013-03-08 11:26:00 -05:00
Alex Brainman
2f23f90dab runtime,misc/cgo/test: disable broken tests so we can test the rest
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7486048
2013-03-06 15:19:01 -05:00
Alexey Borzenkov
a108369c83 syscall: return EINVAL when string arguments have NUL characters
Since NUL usually terminates strings in underlying syscalls, allowing
it when converting string arguments is a security risk, especially
when dealing with filenames. For example, a program might reason that
filename like "/root/..\x00/" is a subdirectory or "/root/" and allow
access to it, while underlying syscall will treat "\x00" as an end of
that string and the actual filename will be "/root/..", which might
be unexpected. Returning EINVAL when string arguments have NUL in
them makes sure this attack vector is unusable.

R=golang-dev, r, bradfitz, fullung, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6458050
2012-08-05 17:24:32 -04:00
Alex Brainman
946647fb45 runtime: fix syscall test to satisfy new error
R=rsc
CC=golang-dev
https://golang.org/cl/5369103
2011-11-14 20:54:47 +11:00
Alex Brainman
b776b9e724 runtime: add windows callback tests
Just a copy of cgo callback tests from misc/cgo/test.

R=rsc
CC=golang-dev, hectorchu
https://golang.org/cl/5331062
2011-11-08 16:53:31 +11:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Alex Brainman
78479163cb syscall: dll function load and calling changes
New DLL and Proc types to manage and call dll functions. These were
used to simplify syscall tests in runtime package. They were also
used to implement LazyDLL and LazyProc.

LazyProc, like Proc, now have Call function, that just a wrapper for
SyscallN. It is not as efficient as Syscall, but easier to use.

NewLazyDLL now supports non-ascii filenames.

LazyDLL and LazyProc now have Load and Find methods. These can be used
during runtime to discover if some dll functions are not present.

All dll functions now return errors that fit os.Error interface. They
also contain Windows error number.

Some of these changes are suggested by jp.

R=golang-dev, jp, rsc
CC=golang-dev
https://golang.org/cl/5272042
2011-10-15 17:29:25 +11:00
Alex Brainman
7406379fff runtime: syscall to return both AX and DX for windows/386
Fixes #2181.

R=golang-dev, jp
CC=golang-dev
https://golang.org/cl/5000042
2011-09-14 16:19:45 +10:00
Jaroslavas Počepko
c586b5b96b runtime: windows/amd64 callbacks fixed and syscall fixed to allow using it in callbacks
Fixes #2178.
Patch2: Fixed allocating shadow space for stdcall (must be at least 32 bytes in any case)
Patch3: Made allocated chunk smaller.
Patch4: Typo
Patch5: suppress linktime warning "runtime.callbackasm: nosplit stack overflow"
Patch6: added testcase src/pkg/syscall/callback_windows_test.go
Patch7: weakly related files moved to https://golang.org/cl/4965050 https://golang.org/cl/4974041 https://golang.org/cl/4965051
Patch8: reflect changes https://golang.org/cl/4926042/
Patch9: reflect comments

R=golang-dev, alex.brainman, vcc.163
CC=golang-dev, hectorchu
https://golang.org/cl/4958042
2011-08-30 22:02:02 +10:00
Jaroslavas Počepko
ae891b5528 windows/386: clean stack after syscall (it is necessary after call cdecl functions and does not have an effect after stdcall)
Result of discussion here: http://groups.google.com/group/golang-nuts/browse_thread/thread/357c806cbb57ca62

R=golang-dev, bradfitz, alex.brainman, hectorchu, rsc
CC=golang-dev
https://golang.org/cl/4961045
2011-08-30 14:43:54 +10:00