FreeBSD Bugzilla – Attachment 216755 Details for
Bug 244785
sysutils/terraform: Crashes at runtime on 12-STABLE: netpoll: break fd ready for -2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch with fix
terraform.patch (text/plain), 3.05 KB, created by
Pavel Timofeev
on 2020-07-25 06:06:18 UTC
(
hide
)
Description:
patch with fix
Filename:
MIME Type:
Creator:
Pavel Timofeev
Created:
2020-07-25 06:06:18 UTC
Size:
3.05 KB
patch
obsolete
>diff -ruN /root/terraform.orig/Makefile terraform/Makefile >--- /root/terraform.orig/Makefile 2020-07-25 08:30:35.926728000 +0300 >+++ terraform/Makefile 2020-07-25 09:01:45.587822000 +0300 >@@ -2,6 +2,7 @@ > > PORTNAME= terraform > PORTVERSION= 0.12.18 >+PORTREVISION= 1 > DISTVERSIONPREFIX= v > CATEGORIES= sysutils > >diff -ruN /root/terraform.orig/files/patch-helper_wrappedstreams_streams.go terraform/files/patch-helper_wrappedstreams_streams.go >--- /root/terraform.orig/files/patch-helper_wrappedstreams_streams.go 1970-01-01 03:00:00.000000000 +0300 >+++ terraform/files/patch-helper_wrappedstreams_streams.go 2020-07-25 08:30:43.698733000 +0300 >@@ -0,0 +1,56 @@ >+--- helper/wrappedstreams/streams.go.orig 2020-07-25 03:39:12 UTC >++++ helper/wrappedstreams/streams.go >+@@ -10,32 +10,31 @@ import ( >+ >+ // Stdin returns the true stdin of the process. >+ func Stdin() *os.File { >+- stdin := os.Stdin >+- if panicwrap.Wrapped(nil) { >+- stdin = wrappedStdin >+- } >+- >++ stdin, _, _ := fds() >+ return stdin >+ } >+ >+ // Stdout returns the true stdout of the process. >+ func Stdout() *os.File { >+- stdout := os.Stdout >+- if panicwrap.Wrapped(nil) { >+- stdout = wrappedStdout >+- } >+- >++ _, stdout, _ := fds() >+ return stdout >+ } >+ >+ // Stderr returns the true stderr of the process. >+ func Stderr() *os.File { >+- stderr := os.Stderr >++ _, _, stderr := fds() >++ return stderr >++} >++ >++func fds() (stdin, stdout, stderr *os.File) { >++ stdin, stdout, stderr = os.Stdin, os.Stdout, os.Stderr >++ >+ if panicwrap.Wrapped(nil) { >+- stderr = wrappedStderr >++ initPlatform() >++ stdin, stdout, stderr = wrappedStdin, wrappedStdout, wrappedStderr >+ } >+ >+- return stderr >++ return >+ } >+ >+ // These are the wrapped standard streams. These are setup by the >+@@ -45,8 +44,3 @@ var ( >+ wrappedStdout *os.File >+ wrappedStderr *os.File >+ ) >+- >+-func init() { >+- // Initialize the platform-specific code >+- initPlatform() >+-} >diff -ruN /root/terraform.orig/files/patch-helper_wrappedstreams_streams__other.go terraform/files/patch-helper_wrappedstreams_streams__other.go >--- /root/terraform.orig/files/patch-helper_wrappedstreams_streams__other.go 1970-01-01 03:00:00.000000000 +0300 >+++ terraform/files/patch-helper_wrappedstreams_streams__other.go 2020-07-25 08:30:43.698600000 +0300 >@@ -0,0 +1,25 @@ >+--- helper/wrappedstreams/streams_other.go.orig 2020-07-25 04:03:45 UTC >++++ helper/wrappedstreams/streams_other.go >+@@ -4,11 +4,18 @@ package wrappedstreams >+ >+ import ( >+ "os" >++ "sync" >+ ) >+ >++var initOnce sync.Once >++ >+ func initPlatform() { >+- // The standard streams are passed in via extra file descriptors. >+- wrappedStdin = os.NewFile(uintptr(3), "stdin") >+- wrappedStdout = os.NewFile(uintptr(4), "stdout") >+- wrappedStderr = os.NewFile(uintptr(5), "stderr") >++ // These must be initialized lazily, once it's been determined that this is >++ // a wrapped process. >++ initOnce.Do(func() { >++ // The standard streams are passed in via extra file descriptors. >++ wrappedStdin = os.NewFile(uintptr(3), "stdin") >++ wrappedStdout = os.NewFile(uintptr(4), "stdout") >++ wrappedStderr = os.NewFile(uintptr(5), "stderr") >++ }) >+ }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244785
:
216755
|
218491