Hi Dimos,

I have not seen this behavior before. I’m guessing you have an open file handle 
that you missed closing, and the file close is getting triggered at exit.
To be able to look into this, I will need a simple program with your plugin 
that replicates this.

Thanks,
Mohamad

From: Hdf-forum <[email protected]> on behalf of Dimos 
Stamatakis <[email protected]>
Reply-To: hdf-forum <[email protected]>
Date: Thursday, May 12, 2016 at 11:39 AM
To: hdf-forum <[email protected]>
Subject: [Hdf-forum] extra file_close callback called after the end of user App 
by using the VOL plugin

Hello,

I have implemented a custom VOL plugin for HDF5 and I noticed that every time 
the application exits, the file_close callback is called one more time at the 
end. The contents of the object passed as a parameter are unspecified and 
sometimes the same as the previous objects, so it is hard for me to identify 
this redundant function call.

For example, having the following user application:

file_id = H5Fcreate(“myfile.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
status = H5Fclose(file_id);

The first API call will call the file_open callback through the VOL plugin.
The second API call will call the file_close callback through the VOL plugin 
with parameter the object specifying the file we want to close. This object 
contains the file name.
However, I see another call of the file_close callback at the very end with an 
invalid object (although not NULL) and file name garbage.
This causes my program to crash, since I am trying to close the underlying file 
which is invalid! I cannot think of a way to identify if this call is a 
redundant call and to ignore it.

Do you have nay idea of how to deal with this redundant callback?


Thanks,

Dimos

---
Dimokritos Stamatakis
PhD student,
Brandeis University

---
Dimokritos Stamatakis
PhD student,
Brandeis University

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to