RuntimeError when writing to /dev/null
See original GitHub issueThis error occur in my unit tests, where I write data to /dev/null to throw it away. It only happens when writing empty datasets. Testcase:
import h5py
with h5py.File("/dev/null", "w") as f:
f.create_dataset("foo", data=[])
f.create_dataset("bar", data=[])
Output:
Traceback (most recent call last):
File "h5py-dev-null.py", line 5, in <module>
f.create_dataset("bar", data=[])
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/home/chn/env/lib/python3.8/site-packages/h5py/_hl/files.py", line 475, in __exit__
self.close()
File "/home/chn/env/lib/python3.8/site-packages/h5py/_hl/files.py", line 457, in close
h5i.dec_ref(id_)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5i.pyx", line 153, in h5py.h5i.dec_ref
RuntimeError: Can't decrement id ref count (unable to extend file properly, errno = 22, error message = 'Invalid argument')
Segmentation fault
The expected result is either to work correctly or fail with OSError or equivalent. Versions:
Ubuntu 20.04.1 LTS
h5py 3.1.0
HDF5 1.12.0
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0]
sys.platform linux
sys.maxsize 9223372036854775807
numpy 1.18.3
cython (built with) 0.29.21
numpy (built against) 1.17.5
HDF5 (built against) 1.12.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
End of record when writing to /dev/null - Stack Overflow
In our program the STDOUT of all non-root MPI processes is closed and reopened to write to /dev/null . (Except in Debug mode,...
Read more >What happens when you write to /dev/null? What's the point?
The null device acts like a black hole. Anything written to it is discarded, and if you try to read from it you...
Read more >1755635 – jupyter_client: cannot start manager with stdout ...
It looks like jupyter_client cannot start a manager when stdout refers to /dev/null, at least in mock. Here's a transcript from a mock ......
Read more >38122 – "file already opened in another unit" error when ...
The following program runs without error when compiled with g77 3.4.6 on Redhat Linux: character*72 fnint data fnint /'/dev/null'/ ...
Read more >FORTRAN runtime error: Cannot write to file opened for READ
You received this message because you are subscribed to a topic in the Google Groups "Nek5000" group. To unsubscribe from this topic, visit ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Finally one year later, I managed to report it upstream: https://github.com/HDFGroup/hdf5/issues/1498
Sure! Thanks a ton for pinpointing the crash - should not be hard to make a C-only reproducer now. I will post a link here when it is done.