Closed seanlatias closed 4 years ago
Should solve #221 and #222.
In our case, it's slightly more complicated, but the root cause is the same.
class A {
A(const int& x) : x_(x) {}
const int& x_;
};
// before fix
A a(5);
// after fix
int x = 5;
A a(x);
Do we have a test case that can reproduce the segfault on our server? If so, please add it to the regression.
Unfortunately, no. It can only be observed on other platforms.
@seanlatias We can reproduce the error on our VM servers using docker. Please try this docker image: #227
Thanks. This PR is the same with my solution, and it fixes #222 .
I also suggest adding a -g
flag to the TVM Makefile in this PR, which would be helpful to locate the SegFault using gdb.
https://github.com/cornell-zhang/heterocl/blob/c67dfede32b84f6f0d7402a6a05d9320afd4bd0f/tvm/Makefile#L29
I also suggest adding a
-g
flag to the TVM Makefile in this PR, which would be helpful to locate the SegFault using gdb. https://github.com/cornell-zhang/heterocl/blob/c67dfede32b84f6f0d7402a6a05d9320afd4bd0f/tvm/Makefile#L29
Let me add this to the developer guide.
According to the C++ document, it is ill-formed to bind a temporary (an unnamed variable) to a reference member in a constructor initializer list. [link1] [link2]
Following is an example provided by the document.