-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[R-package] Protection stack imbalance and unprotected objects #4390
Comments
Thanks very much for your investigation and write-up! Linking #4282 as there is some overlap between this issue and that one, but this issue adds a lot of good details not contained there. Could you describe how you ran Separate from #4391, I'd like to add a continuous integration job that runs |
Thanks a lot for your feedback.
I used docker and followed the steps described here. After creating the CRAN lightgbm_*.tar.gz file with your shell script, I ran the following docker command |
Excellent, thanks very much! For the sake of others looking to this issue interested in reproducing these problems, this set of commands worked for me. sh build-cran-package.sh
mkdir packages
cp lightgbm_3.2.1.99.tar.gz packages
docker run -v `pwd`/packages:/rchk/packages kalibera/rchk:latest /rchk/packages/lightgbm_3.2.1.99.tar.gz And that resulted in the following logs
I've also opened #4400 to track the work for possibly adding a CI job. |
…ixes #4390) (#4391) * [R-package] fix protection stack imbalance and unprotected objects issues * [R-package] fix minor linting issues * [ci][R-package] change timeout-minutes in valgrind test * [R-package] remove extra space Co-authored-by: James Lamb <jaylamb20@gmail.com> * [R-package] remove counter for number of protected objects * Update .github/workflows/r_valgrind.yml Co-authored-by: James Lamb <jaylamb20@gmail.com>
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
The R-package has two protection issues. First, there is a protection stack imbalance when functions are exited by returns from the catch statements in the
R_API_END
macro. This issue is found when running rchk; see the output below. Second, several objects (results ofRf_asChar(.)
, e.g. here) which should be protected are currently not protected.Disclaimer: the main credit for finding the causes of these issues goes to @kalibera.
I will make a pull request / proposal with a suggestion for a solution for this.
Below is output when running rchk on the LightGBM CRAN R-package after this commit
42ddff1. Note that the missing protections for
Rf_asChar(.)
are not found by rchk.The text was updated successfully, but these errors were encountered: