Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
bd01cd71
Commit
bd01cd71
authored
Jul 11, 2017
by
Péter Szilágyi
Committed by
Felix Lange
Jul 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vendor: update go-stack to fix a sigpanic panic (#14790)
parent
09587706
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
42 deletions
+23
-42
LICENSE.md
vendor/github.com/go-stack/stack/LICENSE.md
+18
-10
stack.go
vendor/github.com/go-stack/stack/stack.go
+2
-29
vendor.json
vendor/vendor.json
+3
-3
No files found.
vendor/github.com/go-stack/stack/LICENSE.md
View file @
bd01cd71
Copyright 2014 Chris Hines
The MIT License (MIT)
Licensed under the Apache License, Version 2.0 (the "License");
Copyright (c) 2014 Chris Hines
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Unless required by applicable law or agreed to in writing, software
The above copyright notice and this permission notice shall be included in all
distributed under the License is distributed on an "AS IS" BASIS,
copies or substantial portions of the Software.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
limitations under the License.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
vendor/github.com/go-stack/stack/stack.go
View file @
bd01cd71
...
@@ -39,7 +39,7 @@ func Caller(skip int) Call {
...
@@ -39,7 +39,7 @@ func Caller(skip int) Call {
}
}
c
.
pc
=
pcs
[
1
]
c
.
pc
=
pcs
[
1
]
if
runtime
.
FuncForPC
(
pcs
[
0
])
!=
sigpanic
{
if
runtime
.
FuncForPC
(
pcs
[
0
])
.
Name
()
!=
"runtime.sigpanic"
{
c
.
pc
--
c
.
pc
--
}
}
c
.
fn
=
runtime
.
FuncForPC
(
c
.
pc
)
c
.
fn
=
runtime
.
FuncForPC
(
c
.
pc
)
...
@@ -205,33 +205,6 @@ func (cs CallStack) Format(s fmt.State, verb rune) {
...
@@ -205,33 +205,6 @@ func (cs CallStack) Format(s fmt.State, verb rune) {
s
.
Write
(
closeBracketBytes
)
s
.
Write
(
closeBracketBytes
)
}
}
// findSigpanic intentionally executes faulting code to generate a stack trace
// containing an entry for runtime.sigpanic.
func
findSigpanic
()
*
runtime
.
Func
{
var
fn
*
runtime
.
Func
var
p
*
int
func
()
int
{
defer
func
()
{
if
p
:=
recover
();
p
!=
nil
{
var
pcs
[
512
]
uintptr
n
:=
runtime
.
Callers
(
2
,
pcs
[
:
])
for
_
,
pc
:=
range
pcs
[
:
n
]
{
f
:=
runtime
.
FuncForPC
(
pc
)
if
f
.
Name
()
==
"runtime.sigpanic"
{
fn
=
f
break
}
}
}
}()
// intentional nil pointer dereference to trigger sigpanic
return
*
p
}()
return
fn
}
var
sigpanic
=
findSigpanic
()
// Trace returns a CallStack for the current goroutine with element 0
// Trace returns a CallStack for the current goroutine with element 0
// identifying the calling function.
// identifying the calling function.
func
Trace
()
CallStack
{
func
Trace
()
CallStack
{
...
@@ -241,7 +214,7 @@ func Trace() CallStack {
...
@@ -241,7 +214,7 @@ func Trace() CallStack {
for
i
,
pc
:=
range
pcs
[
:
n
]
{
for
i
,
pc
:=
range
pcs
[
:
n
]
{
pcFix
:=
pc
pcFix
:=
pc
if
i
>
0
&&
cs
[
i
-
1
]
.
fn
!=
sigpanic
{
if
i
>
0
&&
cs
[
i
-
1
]
.
fn
.
Name
()
!=
"runtime.sigpanic"
{
pcFix
--
pcFix
--
}
}
cs
[
i
]
=
Call
{
cs
[
i
]
=
Call
{
...
...
vendor/vendor.json
View file @
bd01cd71
...
@@ -99,10 +99,10 @@
...
@@ -99,10 +99,10 @@
"revisionTime"
:
"2017-01-17T22:23:42Z"
"revisionTime"
:
"2017-01-17T22:23:42Z"
},
},
{
{
"checksumSHA1"
:
"
2sj/DbXoXdnPAfjAEyhS0Jj5QL0
="
,
"checksumSHA1"
:
"
KZ3QD2QgUS4RcoKiA3mn5pSlJxQ
="
,
"path"
:
"github.com/go-stack/stack"
,
"path"
:
"github.com/go-stack/stack"
,
"revision"
:
"
100eb0c0a9c5b306ca2fb4f165df21d80ada4b82
"
,
"revision"
:
"
54be5f394ed2c3e19dac9134a40a95ba5a017f7b
"
,
"revisionTime"
:
"201
6-05-14T03:44:11
Z"
"revisionTime"
:
"201
7-07-10T16:04:46
Z"
},
},
{
{
"checksumSHA1"
:
"p/8vSviYF91gFflhrt5vkyksroo="
,
"checksumSHA1"
:
"p/8vSviYF91gFflhrt5vkyksroo="
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment