Skip to content
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] enable saving Booster with saveRDS() and loading it with readRDS() (fixes #4296) #4685

Merged
merged 42 commits into from
Dec 4, 2021

Conversation

david-cortes
Copy link
Contributor

@david-cortes david-cortes commented Oct 14, 2021

Fixes #4296

This PR adds changes as necessary for model objects to be serializable through functions such as saveRDS and qsave by keeping raw bytes in the model object, from which a C++ object can be reconstructed when such object is de-serialized and the pointer reset to null.

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for working on this! This is super useful feature, and I'm really excited to add it to the R package 🚀 🚀 🚀

I left a few comments below. Will provide a more thorough review some time in the next few days. I have some travel planned soon, so I apologize if responses are a bit slow over the next week.

For now, I can say for sure that you'll need to regenerate the NAMESPACE file (since you're proposing removing two exported functions).

You can do that by running the following:

sh build-cran-package.sh
R CMD INSTALL --with-keep.source lightgbm_*.tar.gz

# (optional, only necessary if you don't have {roxygen2} installed)
Rscript -e "install.packages('roxygen2', repos = 'https://cran.r-project.org')"

# regenerate docs
cd R-package
Rscript -e "roxygen2::roxygenize(load = 'installed')"

I'm mentioning #4296 in this review and adding (fixes #4296) to the description, as it looks like this PR is directly intended to add that feature.

In this project, try to make an effort to reference relevant issues, pull requests, or other links whenever they're directly related to a conversation in this project, so it's easier for reviewers (and people getting here from search engines) to understand why the changes are being made. If there are other relevant links that you think someone reading this PR should see, please add them to the description.

R-package/R/lgb.Booster.R Outdated Show resolved Hide resolved
R-package/R/lgb.cv.R Outdated Show resolved Hide resolved
R-package/tests/testthat/test_lgb.Booster.R Outdated Show resolved Hide resolved
@david-cortes
Copy link
Contributor Author

@jameslamb The linter is complaining about the python code, which has not been touched in this PR.

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took another look at this tonight, please see my newest round of comments.

Thanks very much for working on us! This PR touches a lot of code, so I think it will take a few rounds of review.

R-package/R/readRDS.lgb.Booster.R Show resolved Hide resolved
@@ -784,6 +829,7 @@ predict.lgb.Booster <- function(object,
if (!lgb.is.Booster(x = object)) {
stop("predict.lgb.Booster: object should be an ", sQuote("lgb.Booster"))
}
object$restore_handle()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be moved inside Booster$predict()?

That way, it'll be guaranteed to run regardless of whether someone uses predict(bst, data) or bst$predict().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's placed earlier it can throw an error before doing any other long operations with the data. I also assume that since the R6 methods are not documented, they are meant for internal usage, and a user trying to call them directly would likely need to examine the code in any case.

Copy link
Collaborator

@jameslamb jameslamb Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's placed earlier it can throw an error before doing any other long operations with the data.

The only code between this call and Booster$predict() is conversion of ... to a list and possibly raising a deprecation warning.

I'd prefer to concentrate these $restore_handle() calls in the Booster object as much as possible, to minimize how many places in the package's code need to know about managing the raw model object.

I also assume that since the R6 methods are not documented, they are meant for internal usage

The fact that those methods are not documented is a gap that should be filled (not in this PR, please).

However, all of the Booster's public methods except initialize() are treated as part of the public API of the R package. We treat them that way because other exported functions can return Booster instance. For example, lgb.train() returns a Booster instance, and then user code can call any public methods on that instance without needing to use ::: or reach into $.__enclos_env__$private.

R-package/R/lgb.train.R Outdated Show resolved Hide resolved
R-package/R/lgb.train.R Show resolved Hide resolved
R-package/R/lgb.importance.R Outdated Show resolved Hide resolved
R-package/R/lgb.drop_serialized.R Outdated Show resolved Hide resolved
R-package/R/lgb.make_serializable.R Outdated Show resolved Hide resolved
R-package/R/lgb.restore_handle.R Outdated Show resolved Hide resolved
R-package/R/lgb.restore_handle.R Outdated Show resolved Hide resolved
@jameslamb
Copy link
Collaborator

The linter is complaining about the python code, which has not been touched in this PR.

In the most recent run of the lint task in CI (https://github.com/microsoft/LightGBM/pull/4685/checks?check_run_id=3902219749), I only see one issue and it seems directly related to this PR's changes.

Linting C++ code
R-package/src/lightgbm_R.cpp:846: Add #include for copy [build/include_what_you_use] [4]

That is why the build failed.

If you are talking about errors in those logs like python-package/setup.py:43: error: "Path" not callable, you can safely ignore those.

david-cortes and others added 9 commits October 15, 2021 18:41
Co-authored-by: James Lamb <jaylamb20@gmail.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
@david-cortes
Copy link
Contributor Author

@jameslamb Some R checks say that it failed, but there's no error message.

@jameslamb
Copy link
Collaborator

Some R checks say that it failed, but there's no error message.

In the future, it would be very helpful if you could include links in messages like this, so reviewers can go directly to what you're looking at.

I see job https://github.com/microsoft/LightGBM/pull/4685/checks?check_run_id=3908084481, for example, that has the following at the end of its logs.

NOTEs, WARNINGs, or ERRORs have been found by R CMD check
Error: Process completed with exit code 255.

Scrolling up in the log, I see

  • checking for non-standard things in the check directory ... NOTE
    Found the following files/directories:
    ‘lightgbm.model’

My best guess is that that's coming from the new examples you've added in this PR which call lightgbm(). That function saves the model to a file lightgbm.model by default.

Please try adding a rule to https://github.com/microsoft/LightGBM/blob/master/R-package/.Rbuildignore to ignore .model files, hopefully that will resolve this.

@david-cortes
Copy link
Contributor Author

Some R checks say that it failed, but there's no error message.

In the future, it would be very helpful if you could include links in messages like this, so reviewers can go directly to what you're looking at.

I see job https://github.com/microsoft/LightGBM/pull/4685/checks?check_run_id=3908084481, for example, that has the following at the end of its logs.

NOTEs, WARNINGs, or ERRORs have been found by R CMD check
Error: Process completed with exit code 255.

Scrolling up in the log, I see

  • checking for non-standard things in the check directory ... NOTE
    Found the following files/directories:
    ‘lightgbm.model’

My best guess is that that's coming from the new examples you've added in this PR which call lightgbm(). That function saves the model to a file lightgbm.model by default.

Please try adding a rule to https://github.com/microsoft/LightGBM/blob/master/R-package/.Rbuildignore to ignore .model files, hopefully that will resolve this.

But that's not an error, that's a NOTE.

@jameslamb
Copy link
Collaborator

This error is not related to the PR: https://github.com/microsoft/LightGBM/runs/4253993286?check_suite_focus=true

Adding here so that this is findable from search in the future, the specific error is:

Submodule path 'external_libs/compute': checked out '36c89134d4013b2e5e45bc55656a18bd6141995a'
Error: error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
Error: error: 1317 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
Error: fatal: early EOF
Error: fatal: fetch-pack: invalid index-pack output
Error: fatal: Fetched in submodule path 'external_libs/eigen', but it did not contain 8ba1b0f41a7950dc3e1d4ed75859e36c73311235. Direct fetching of that commit failed.
Error: The process '/usr/bin/git' failed with exit code 1

Yeah, unfortunately I've found that cloning Eigen from GitLab fails much more often than cloning other submodules hosted on GitHub. Like maybe as often as once a month in this project's CI. I'll re-run these jobs.

@jameslamb
Copy link
Collaborator

jameslamb commented Nov 18, 2021

/gha run r-valgrind

Workflow R valgrind tests has been triggered! 🚀
https://github.com/microsoft/LightGBM/actions/runs/1477530046

Status: failure ❌.

@jameslamb
Copy link
Collaborator

jameslamb commented Nov 18, 2021

/gha run r-solaris

Workflow Solaris CRAN check has been triggered! 🚀
https://github.com/microsoft/LightGBM/actions/runs/1477530273

solaris-x86-patched: https://builder.r-hub.io/status/lightgbm_3.3.1.99.tar.gz-5138007eafa6423f8a2ab136fc2447c1
solaris-x86-patched-ods: https://builder.r-hub.io/status/lightgbm_3.3.1.99.tar.gz-c9476c409c784b518a1522ffe62f6cdc
Reports also have been sent to LightGBM public e-mail: https://yopmail.com?lightgbm_rhub_checks
Status: success ✔️.

@jameslamb
Copy link
Collaborator

jameslamb commented Nov 28, 2021

/gha run r-valgrind

Workflow R valgrind tests has been triggered! 🚀
https://github.com/microsoft/LightGBM/actions/runs/1513367042

Status: failure ❌.

@david-cortes
Copy link
Contributor Author

@jameslamb : that valgrind issue is most definitely not caused by the changes in this PR - probably the issue had not arised before because the code path was not executed in the tests. I'll probably take a look at it during next weekend.

@jameslamb
Copy link
Collaborator

that valgrind issue is most definitely not caused by the changes in this PR

To make it clear for other reviewers, this test is failing (click here for build logs) because of the following error from valgrind.

valgrind found invalid reads: 7

Just looking through recent commits since the v3.3.1 release on October 27, I see the following pull requests that touched C/C++ code in this project:

For what it's worth, #4782 did pass the valgrind tests shortly before being merged (#4782 (comment)).

I'll try on a separate PR and see if I can reproduce those errors, just to confirm that the issue is not related to this PR.

@jameslamb
Copy link
Collaborator

Looks like thevalgrind job is passing on master, which suggests that the failing job here is related to this PR's changes.

#4835 (comment)

@david-cortes
Copy link
Contributor Author

@jameslamb : are you able to identify from the logs which is the specific R test that is triggering the valgrind errors?

@jameslamb
Copy link
Collaborator

are you able to identify from the logs which is the specific R test that is triggering the valgrind errors

I think so! I searched through the logs for the phrase "invalid read", and found the following.

valgrind logs (click me)
2021-11-28T21:20:17.8381134Z ..==4279== Conditional jump or move depends on uninitialised value(s)
2021-11-28T21:20:17.8382293Z ==4279==    at 0x483EF58: strlen (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8383206Z ==4279==    by 0x151E41A1: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:725)
2021-11-28T21:20:17.8384325Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8385416Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8386205Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8386771Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8387297Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8387770Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8388245Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8388736Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8389216Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8389688Z ==4279==    by 0x4991A9B: do_if (eval.c:2265)
2021-11-28T21:20:17.8390285Z ==4279==  Uninitialised value was created by a client request
2021-11-28T21:20:17.8390941Z ==4279==    at 0x49F72B3: Rf_allocVector3 (memory.c:2926)
2021-11-28T21:20:17.8391596Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8392206Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8392705Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8393200Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8393718Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8394300Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8394842Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8395317Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8395840Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8396420Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8396943Z ==4279==    by 0x498E286: Rf_eval (eval.c:871)
2021-11-28T21:20:17.8397338Z ==4279== 
2021-11-28T21:20:17.8397725Z .W..==4279== Invalid read of size 1
2021-11-28T21:20:17.8398742Z ==4279==    at 0x483EF54: strlen (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8399787Z ==4279==    by 0x151E41A1: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:725)
2021-11-28T21:20:17.8400753Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8401736Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8402613Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8403272Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8403716Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8404134Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8404560Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8404977Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8405406Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8405811Z ==4279==    by 0x4991A9B: do_if (eval.c:2265)
2021-11-28T21:20:17.8406493Z ==4279==  Address 0x1fa72718 is 0 bytes after a block of size 1,407,160 alloc'd
2021-11-28T21:20:17.8407466Z ==4279==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8408419Z ==4279==    by 0x49F6851: Rf_allocVector3 (memory.c:2834)
2021-11-28T21:20:17.8409072Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8409684Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8410184Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8410867Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8411440Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8412052Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8412631Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8413153Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8413714Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8414335Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8414820Z ==4279== 
2021-11-28T21:20:17.8415573Z ==4279== Conditional jump or move depends on uninitialised value(s)
2021-11-28T21:20:17.8416423Z ==4279==    at 0x14EBDAFB: LightGBM::Common::GetLine(char const*) (common.h:861)
2021-11-28T21:20:17.8417447Z ==4279==    by 0x14EC2E34: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:605)
2021-11-28T21:20:17.8418555Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8419599Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8420668Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8422150Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8423044Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8423617Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8424133Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8424659Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8425176Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8425703Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8426358Z ==4279==  Uninitialised value was created by a client request
2021-11-28T21:20:17.8427074Z ==4279==    at 0x49F72B3: Rf_allocVector3 (memory.c:2926)
2021-11-28T21:20:17.8427781Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8428436Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8428974Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8429501Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8430074Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8430691Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8431269Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8431797Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8432357Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8432980Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8433543Z ==4279==    by 0x498E286: Rf_eval (eval.c:871)
2021-11-28T21:20:17.8434135Z ==4279== 
2021-11-28T21:20:17.8434811Z ==4279== Conditional jump or move depends on uninitialised value(s)
2021-11-28T21:20:17.8435761Z ==4279==    at 0x14EBDB06: LightGBM::Common::GetLine(char const*) (common.h:861)
2021-11-28T21:20:17.8437032Z ==4279==    by 0x14EC2E34: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:605)
2021-11-28T21:20:17.8438149Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8439174Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8440244Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8441094Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8441685Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8442244Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8442793Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8443304Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8443827Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8444352Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8444996Z ==4279==  Uninitialised value was created by a client request
2021-11-28T21:20:17.8445716Z ==4279==    at 0x49F72B3: Rf_allocVector3 (memory.c:2926)
2021-11-28T21:20:17.8446418Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8447062Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8447611Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8448138Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8448888Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8449480Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8450006Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8450492Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8451227Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8451835Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8452411Z ==4279==    by 0x498E286: Rf_eval (eval.c:871)
2021-11-28T21:20:17.8452832Z ==4279== 
2021-11-28T21:20:17.8453414Z ==4279== Conditional jump or move depends on uninitialised value(s)
2021-11-28T21:20:17.8454246Z ==4279==    at 0x14EBDB11: LightGBM::Common::GetLine(char const*) (common.h:861)
2021-11-28T21:20:17.8455261Z ==4279==    by 0x14EC2E34: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:605)
2021-11-28T21:20:17.8456366Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8457398Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8458464Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8459299Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8459901Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8460454Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8460949Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8461458Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8462120Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8462631Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8463366Z ==4279==  Uninitialised value was created by a client request
2021-11-28T21:20:17.8464080Z ==4279==    at 0x49F72B3: Rf_allocVector3 (memory.c:2926)
2021-11-28T21:20:17.8464856Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8465467Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8465967Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8466451Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8467082Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8467655Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8468192Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8468677Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8469204Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8469784Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8470311Z ==4279==    by 0x498E286: Rf_eval (eval.c:871)
2021-11-28T21:20:17.8470694Z ==4279== 
2021-11-28T21:20:17.8471074Z ==4279== Invalid read of size 1
2021-11-28T21:20:17.8471681Z ==4279==    at 0x14EBDAF6: LightGBM::Common::GetLine(char const*) (common.h:861)
2021-11-28T21:20:17.8472626Z ==4279==    by 0x14EC2E34: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:605)
2021-11-28T21:20:17.8473653Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8474615Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8475593Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8476379Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8476923Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8477433Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8478087Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8478593Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8479115Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8479715Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8480701Z ==4279==  Address 0x1fa72718 is 0 bytes after a block of size 1,407,160 alloc'd
2021-11-28T21:20:17.8481907Z ==4279==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8482830Z ==4279==    by 0x49F6851: Rf_allocVector3 (memory.c:2834)
2021-11-28T21:20:17.8483521Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8484180Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8484732Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8485240Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8485808Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8486438Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8487007Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8487531Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8488099Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8488715Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8489200Z ==4279== 
2021-11-28T21:20:17.8489595Z ==4279== Invalid read of size 1
2021-11-28T21:20:17.8490265Z ==4279==    at 0x14EBDB01: LightGBM::Common::GetLine(char const*) (common.h:861)
2021-11-28T21:20:17.8491282Z ==4279==    by 0x14EC2E34: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:605)
2021-11-28T21:20:17.8492384Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8493416Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8494491Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8495322Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8496029Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8496549Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8497273Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8497750Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8498325Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8498807Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8499611Z ==4279==  Address 0x1fa72718 is 0 bytes after a block of size 1,407,160 alloc'd
2021-11-28T21:20:17.8500714Z ==4279==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8501675Z ==4279==    by 0x49F6851: Rf_allocVector3 (memory.c:2834)
2021-11-28T21:20:17.8502333Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8502948Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8503446Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8503938Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8504471Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8505043Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8505581Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8506236Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8506811Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8507435Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8507909Z ==4279== 
2021-11-28T21:20:17.8508319Z ==4279== Invalid read of size 1
2021-11-28T21:20:17.8508982Z ==4279==    at 0x14EBDB0C: LightGBM::Common::GetLine(char const*) (common.h:861)
2021-11-28T21:20:17.8509983Z ==4279==    by 0x14EC2E34: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:605)
2021-11-28T21:20:17.8511091Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8512220Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8513291Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8514138Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8514746Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8515295Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8515804Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8516320Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8516837Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8517364Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8518242Z ==4279==  Address 0x1fa72718 is 0 bytes after a block of size 1,407,160 alloc'd
2021-11-28T21:20:17.8519422Z ==4279==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8520334Z ==4279==    by 0x49F6851: Rf_allocVector3 (memory.c:2834)
2021-11-28T21:20:17.8521037Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8521683Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8522233Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8522749Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8523321Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8524563Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8525161Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8525682Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8526254Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8526864Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8527354Z ==4279== 
2021-11-28T21:20:17.8527763Z ==4279== Invalid read of size 2
2021-11-28T21:20:17.8528910Z ==4279==    at 0x4842B30: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8531025Z ==4279==    by 0x737CD55: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
2021-11-28T21:20:17.8532689Z ==4279==    by 0x14EC2E7C: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:607)
2021-11-28T21:20:17.8533815Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8534848Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8536001Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8536790Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8537342Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8537960Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8538371Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8538794Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8539226Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8539957Z ==4279==  Address 0x1fa72718 is 0 bytes after a block of size 1,407,160 alloc'd
2021-11-28T21:20:17.8541145Z ==4279==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8542121Z ==4279==    by 0x49F6851: Rf_allocVector3 (memory.c:2834)
2021-11-28T21:20:17.8542955Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8543616Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8544168Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8544683Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8545252Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8545986Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8546567Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8547091Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8547657Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8548276Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8548763Z ==4279== 
2021-11-28T21:20:17.8549159Z ==4279== Invalid read of size 2
2021-11-28T21:20:17.8550264Z ==4279==    at 0x4842B3F: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8552289Z ==4279==    by 0x737CD55: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
2021-11-28T21:20:17.8553779Z ==4279==    by 0x14EC2E7C: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:607)
2021-11-28T21:20:17.8554992Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8556190Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8557185Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8557963Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8558523Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8559041Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8559507Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8559984Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8560478Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8561258Z ==4279==  Address 0x1fa7271a is 2 bytes after a block of size 1,407,160 alloc'd
2021-11-28T21:20:17.8562600Z ==4279==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-11-28T21:20:17.8563525Z ==4279==    by 0x49F6851: Rf_allocVector3 (memory.c:2834)
2021-11-28T21:20:17.8564218Z ==4279==    by 0x49D83CB: Rf_allocVector (Rinlinedfuns.h:595)
2021-11-28T21:20:17.8564876Z ==4279==    by 0x4A42DA4: do_charToRaw (raw.c:41)
2021-11-28T21:20:17.8565530Z ==4279==    by 0x49A2413: bcEval (eval.c:7139)
2021-11-28T21:20:17.8566042Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8566615Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8567242Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8567807Z ==4279==    by 0x49A2047: bcEval (eval.c:7107)
2021-11-28T21:20:17.8568330Z ==4279==    by 0x498DA8B: Rf_eval (eval.c:748)
2021-11-28T21:20:17.8568887Z ==4279==    by 0x49907FA: R_execClosure (eval.c:1918)
2021-11-28T21:20:17.8569519Z ==4279==    by 0x49904AD: Rf_applyClosure (eval.c:1844)
2021-11-28T21:20:17.8570005Z ==4279== 
2021-11-28T21:20:17.8570411Z ==4279== Invalid read of size 1
2021-11-28T21:20:17.8571116Z ==4279==    at 0x14EBDB30: LightGBM::Common::SkipNewLine(char const*) (common.h:868)
2021-11-28T21:20:17.8572170Z ==4279==    by 0x14EC2FFF: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:619)
2021-11-28T21:20:17.8573278Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8574377Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8575374Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8576207Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8576694Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8577147Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8577555Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8577972Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8578463Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8578892Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8579432Z ==4279==  Address 0x1fa72730 is 16 bytes after a block of size 1,407,168 in arena "client"
2021-11-28T21:20:17.8579897Z ==4279== 
2021-11-28T21:20:17.8580220Z ==4279== Invalid read of size 1
2021-11-28T21:20:17.8580782Z ==4279==    at 0x14EBDB40: LightGBM::Common::SkipNewLine(char const*) (common.h:871)
2021-11-28T21:20:17.8581723Z ==4279==    by 0x14EC2FFF: LightGBM::GBDT::LoadModelFromString(char const*, unsigned long) (gbdt_model_text.cpp:619)
2021-11-28T21:20:17.8582633Z ==4279==    by 0x151E41D3: LightGBM::Booster::LoadModelFromString(char const*) (c_api.cpp:726)
2021-11-28T21:20:17.8583473Z ==4279==    by 0x151D2446: LGBM_BoosterLoadModelFromString (c_api.cpp:1579)
2021-11-28T21:20:17.8584326Z ==4279==    by 0x15202CE7: LGBM_BoosterLoadModelFromString_R (lightgbm_R.cpp:482)
2021-11-28T21:20:17.8585012Z ==4279==    by 0x49428FE: R_doDotCall (dotcode.c:601)
2021-11-28T21:20:17.8585501Z ==4279==    by 0x494DADC: do_dotcall (dotcode.c:1284)
2021-11-28T21:20:17.8585938Z ==4279==    by 0x498E13B: Rf_eval (eval.c:851)
2021-11-28T21:20:17.8586354Z ==4279==    by 0x49944A5: do_set (eval.c:2990)
2021-11-28T21:20:17.8586774Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8587195Z ==4279==    by 0x4992F28: do_begin (eval.c:2538)
2021-11-28T21:20:17.8587622Z ==4279==    by 0x498DEE2: Rf_eval (eval.c:823)
2021-11-28T21:20:17.8588170Z ==4279==  Address 0x1fa72730 is 16 bytes after a block of size 1,407,168 in arena "client"
2021-11-28T21:20:17.8588620Z ==4279== 

The last line I see before that that looks like a testthat::context() call is

2021-11-28T21:20:17.8352640Z lgb.load(): W[LightGBM] [Info] Number of positive: 3140, number of negative: 3373

So I think the errors came from tests somewhere between these two points:

https://github.com/david-cortes/LightGBM/blob/b1b4e2b778549af06ea02e9bbd14cbd5d606a475/R-package/tests/testthat/test_lgb.Booster.R#L119

https://github.com/david-cortes/LightGBM/blob/b1b4e2b778549af06ea02e9bbd14cbd5d606a475/R-package/tests/testthat/test_lgb.Booster.R#L372

In case it helps...there were some changes to loading Boosters from text in #4782. Maybe there is an issue in the interaction between those changes and the changes in this PR.

I can try to look later and see if I find anything.

@david-cortes
Copy link
Contributor Author

@jameslamb : turns out it was an issue with null terminators being lost in conversions. Should be fixed now.

@jameslamb
Copy link
Collaborator

jameslamb commented Dec 4, 2021

/gha run r-valgrind

Workflow R valgrind tests has been triggered! 🚀
https://github.com/microsoft/LightGBM/actions/runs/1537734979

Status: success ✔️.

@jameslamb
Copy link
Collaborator

thank you so much! Changes look good to me! I'll check back in a bit to see what valgrind says.

@jameslamb
Copy link
Collaborator

jameslamb commented Dec 4, 2021

/gha run r-solaris

Workflow Solaris CRAN check has been triggered! 🚀
https://github.com/microsoft/LightGBM/actions/runs/1537756361

solaris-x86-patched: https://builder.r-hub.io/status/lightgbm_3.3.1.99.tar.gz-0e1b5e71a33b4d42808c0351cd8a6262
solaris-x86-patched-ods: https://builder.r-hub.io/status/lightgbm_3.3.1.99.tar.gz-51991374bacf4139be836ee8051dc87f
Reports also have been sent to LightGBM public e-mail: https://yopmail.com?lightgbm_rhub_checks
Status: success ✔️.

@jameslamb jameslamb self-requested a review December 4, 2021 04:35
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given @StrikerRUS 's support for the general idea of this PR (#4685 (review)), the fact that all CI jobs (including valgrind and Solaris) are passing, and the fact that all my review comments have been addressed thoroughly, I'm approving this PR.

Thanks for the AWESOME work @david-cortes ! This is a really big improvement in usability for the R package 🚀

@jameslamb jameslamb changed the title [R-package] enable saving Booster with saveRDS() and loading it with readRDS() [R-package] enable saving Booster with saveRDS() and loading it with readRDS() (fixes #4296) Dec 4, 2021
@jameslamb jameslamb merged commit 12b1527 into microsoft:master Dec 4, 2021
@StrikerRUS StrikerRUS mentioned this pull request Jan 6, 2022
13 tasks
@jameslamb jameslamb mentioned this pull request Oct 7, 2022
40 tasks
@github-actions
Copy link

This pull request 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[R-package] Request: work with R serialization functions
3 participants