Comments (16)
I created a PR (#209) which contains a unit test for this edge case.
from hdf5r.
I think the issue occurs whenever there's a function from the HDF5 library that expects a buffer.
if(XLENGTH(R_buf) == 0) {
buf = NULL;
}
else {
buf = ...
}
// ...
... = H5SomeFunction(..., buf, ...);
It appears this buffer shouldn't be NULL (otherwise the error H5SomeFunction(): buf parameter can't be NULL
is thrown).
Question is, with what should each of these buf = NULL
be replaced? I've had some success by replacing buf = NULL;
with buf = R_alloc(1, 1); // allocate 1 byte
, but that causes other problems down the road.
from hdf5r.
I managed to solve the issue by replacing the XLENGTH(.) == 0
condition with TYPEOF(.) == NILSXP
:
const void* buf;
if(TYPEOF(R_buf) == NILSXP) {
buf = NULL;
}
else {
buf = (void *) VOIDPTR(R_buf);
}
I created PR #211 which allows the unit tests I added in #209 to pass. It should be noted that I only performed the substitution only where needed for allowing the tests in #209 to pass.
from hdf5r.
sorry for the late reply. Will try to look at the fix over the Christmas break and thanks for the PR.
from hdf5r.
No worries and thanks! Is there anything I can help out with? Would it help to schedule a call?
from hdf5r.
just a quick update. I had an initial look at this, but I need to dig deeper. A purely technical issue is that the places where you made the fix all need to be moved. The reason is that this code is auto-generated, so the way the code is generated has to be adapted upstream. As that code is somewhat ... ugly, I need to do that adaptation on my end.
Stay tuned
from hdf5r.
Thanks for looking into this!
this code is auto-generated
It's good to hear that the code is auto-generated. I couldn't imagine maintaining this code base across different versions of HDF5 library.
Out of curiosity, is the script that generates the code in a public repository?
from hdf5r.
Fixed in #214.
You can look for the for the code generates the wrapper files under /inst/CWrappers... but beware, it is not pretty.
from hdf5r.
Aha, that's what the patches are for! Makes sense :)
Thanks for fixing the issue!
from hdf5r.
@rcannood : I had to revert the changes for now and reopen the issue. The hdf5r.Extra package is causing a reverse dependency error.
The code for the fix is located in the branch
https://github.com/hhoeflin/hdf5r/tree/bug/fix_empty_attrs_again
from hdf5r.
It seems @ycli1995 fixed ycli1995/hdf5r.Extra#1
Could we get this fix merged and released? π
from hdf5r.
Hi @hhoeflin!
I ran a revdepcheck on this branch:
> revdepcheck::revdep_check(timeout = as.difftime(600, units = "mins"), num_workers = 8)
ββ CHECK βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 13 packages ββ
β readNSx 0.0.2 ββ E: 0 | W: 0 | N: 0
β hdf5r.Extra 0.0.5 ββ E: 0 | W: 0 | N: 0
β rblt 0.2.4.6 ββ E: 0 | W: 0 | N: 0
β dynutils 1.0.11 ββ E: 0 | W: 0 | N: 0
I didn't let it finish completely, but I can already confirm that this PR does not introduce new errors to hdf5r.Extra
anymore.
Would you be able to merge the PR? π
from hdf5r.
from hdf5r.
Awesome, thanks!
from hdf5r.
Hi @hhoeflin !
I see that branch bug/fix_empty_attrs_again
has not yet been merged.
Might I inquire about the status of this fix?
The described issue has been a blocking issue for months on end now, and it's saddening to see that a fix for it exists but is simply not being merged / released.
Happy to help out with whatever you would need help with!
Kind regards,
Robrecht
from hdf5r.
Hey @hhoeflin !
Thanks for releasing hdf5r 1.3.11! π π π
I can confirm this has fixed my issue.
from hdf5r.
Related Issues (20)
- How do you save a modified copy?
- issue with read10x_h5 function in seurat HOT 1
- On system with 'clang', configure finds gcc HOT 1
- fatal error: hdf5.h: No such file or directory, change from R devel r83603 to r83630 HOT 3
- Build fails if `patch` not installed HOT 1
- make_id_char function error
- Ubuntu20.4 install hdf5r failed HOT 2
- Several tests fail on PowerPC: error #000: H5T.c in H5Tget_class(): line 2084: not a datatype etc. [ FAIL 54 | WARN 0 | SKIP 3 | PASS 442 ] HOT 1
- When I quote hdf5r in R, I get an error.
- Error : C stack usage 15925440 is too close to the limit
- install hdf5r fail in centos7.9 HOT 1
- Fix CRAN check errors from 2024-01-07 HOT 1
- URL links to HDF5 documentation not working HOT 1
- Installation error using R
- Any plans on supporting ROS3 cloud driver? HOT 1
- I can't add values of a vector into a dataset
- incompatible pointer type HOT 1
- Request for creating H5R_OBJECT access
- Consider `pkg-config` for finding the compiler flags? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hdf5r.