Fix enforce test failed and demangle stack info#4107
Merged
Conversation
Note: If no symbol with a suitable value is found, both this field and dli_saddr shall be set to NULL.
gangliao
commented
Sep 14, 2017
| for (int i = 0; i < size; ++i) { | ||
| if (dladdr(call_stack[i], &info)) { | ||
| auto demangled = info.dli_sname; | ||
| if (dladdr(call_stack[i], &info) && info.dli_sname) { |
Contributor
Author
There was a problem hiding this comment.
bug is here:
| dli_sname | The name of the nearest runtime symbol with value less than or equal to addr. Where possible, the symbol name shall be returned as it would appear in C source code.If no symbol with a suitable value is found, both this field and dli_saddr shall be set to NULL. |
|---|
Contributor
Author
|
Pass under internal test machine |
Contributor
|
我在Python单测里测了下: case 1 可以正常显示: case 2 只报 Exception: SegFault : |
Contributor
|
@qingqing01 求问case 1是哪个,case 2是哪个?我碰到过很多次SegFault,大概情况是python没有设置正确的Output。 |
Contributor
|
@Xreki 用MulOp测的: case 1: shape改成不匹配:
class TestMulOp(OpTest):
def setUp(self):
self.op_type = "mul"
self.inputs = {
'X': np.random.random((32, 84)).astype("float32"),
'Y': np.random.random((80, 100)).astype("float32")
}
self.outputs = {'Out': np.dot(self.inputs['X'], self.inputs['Y'])}
def test_check_output(self):
self.check_output()case 2: 改错名字Y->Y0 class TestMulOp(OpTest):
def setUp(self):
self.op_type = "mul"
self.inputs = {
'X': np.random.random((32, 84)).astype("float32"),
'Y0': np.random.random((84, 100)).astype("float32")
}
self.outputs = {'Out': np.dot(self.inputs['X'], self.inputs['Y0'])}
def test_check_output(self):
self.check_output()case2有可能是C++代码内部check做的不好。 |
Contributor
|
但其实希望case2也能有错误栈信息~ |
Contributor
|
case2很奇怪,就是C++端 |
Contributor
|
@qingqing01 case1的错误,应该是python报的,因为单测里面会执行 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: If no symbol with a suitable value is found, both this field and dli_saddr shall be set to NULL.
Fix: #4072