-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix enforce test failed and demangle stack info #4107
Conversation
Note: If no symbol with a suitable value is found, both this field and dli_saddr shall be set to NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed enforce
@@ -61,8 +78,8 @@ struct EnforceNotMet : public std::exception { | |||
|
|||
Dl_info info; | |||
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
---|
Pass under internal test machine
|
我在Python单测里测了下: case 1 可以正常显示:
case 2 只报 Exception: SegFault :
|
@qingqing01 求问case 1是哪个,case 2是哪个?我碰到过很多次SegFault,大概情况是python没有设置正确的Output。 |
@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做的不好。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
但其实希望case2也能有错误栈信息~ |
case2很奇怪,就是C++端 |
@qingqing01 case1的错误,应该是python报的,因为单测里面会执行 |
Note: If no symbol with a suitable value is found, both this field and dli_saddr shall be set to NULL.
Fix: #4072