Call to H5close()

All,

Can the call to H5close() cause the an application to crash ?

Regards

Ram

Hi Ram,

All,

Can the call to H5close() cause the an application to crash ?

  You'll need to give more information before anyone can answer this question...

    Quincey

···

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

Regards

Ram

All,

I have a class which makes use of hdf5 API's . I close all the resources
( dataset, dataspaces ) after Write/Read operations . When the class
destructor is called I have a call to H5close() . Sometimes the
execution of this function call leads to a Crash . I would like to know
is there any scenario when a call to H5close() fails ?

Regards

Ram

···

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 1:40 AM
To: Ramakrishnan Iyer
Cc: HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

All,

Can the call to H5close() cause the an application to crash ?

            You'll need to give more information before anyone can
answer this question...

                        Quincey

Regards

Ram

I could imagine such a crash when memory is corrupted by the application,
like the application has freed some HDF5-internal memory - which it should not
do, but can happen in a buggy application.

Also, H5close() closes the library, it must be ensured that no other call
to HDF5 follows after this call. Usually HDF5 registers its own destructor
call via an atexit() routine. If you don't disable this, and call your destructor
in addition to HDF5's one, it will also lead to problems.

But these are deterministic and reproducible. Main problem seems to be your "sometimes"
issue. This very much sounds like random memory corruption error.

  Werner

···

On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer <ramakrishnan.iyer@altair.com> wrote:

All,

I have a class which makes use of hdf5 API's . I close all the resources
( dataset, dataspaces ) after Write/Read operations . When the class
destructor is called I have a call to H5close() . Sometimes the
execution of this function call leads to a Crash . I would like to know
is there any scenario when a call to H5close() fails ?

Regards

Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 1:40 AM
To: Ramakrishnan Iyer
Cc: HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

All,

Can the call to H5close() cause the an application to crash ?

            You'll need to give more information before anyone can
answer this question...

                        Quincey

Regards

Ram

--
___________________________________________________________________________
Dr. Werner Benger <werner@cct.lsu.edu> Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Hi Ram,

I could imagine such a crash when memory is corrupted by the application,
like the application has freed some HDF5-internal memory - which it should not
do, but can happen in a buggy application.

  As Werner says, usually this sort of error is caused by an application leaking HDF5 objects or corrupting memory in some way that causing the HDF5 library to get confused when H5close() tries to close any open resources (including the internal resources used by the library).

Also, H5close() closes the library, it must be ensured that no other call
to HDF5 follows after this call. Usually HDF5 registers its own destructor
call via an atexit() routine. If you don't disable this, and call your destructor
in addition to HDF5's one, it will also lead to problems.

  Calling H5dont_atexit() before using any HDF5 routines might help. (But I'm guessing won't change anything, if some sort of resource leak or corruption is involved)

  Quincey

···

On Apr 28, 2009, at 12:44 AM, Werner Benger wrote:

But these are deterministic and reproducible. Main problem seems to be your "sometimes"
issue. This very much sounds like random memory corruption error.

  Werner

On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer <ramakrishnan.iyer@altair.com > > wrote:

All,

I have a class which makes use of hdf5 API's . I close all the resources
( dataset, dataspaces ) after Write/Read operations . When the class
destructor is called I have a call to H5close() . Sometimes the
execution of this function call leads to a Crash . I would like to know
is there any scenario when a call to H5close() fails ?

Regards

Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 1:40 AM
To: Ramakrishnan Iyer
Cc: HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

All,

Can the call to H5close() cause the an application to crash ?

           You'll need to give more information before anyone can
answer this question...

                       Quincey

Regards

Ram

--
___________________________________________________________________________
Dr. Werner Benger <werner@cct.lsu.edu> Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Hi Dimitris,

I had problems with H5close on linux, crashing the application if before using h5close I used any file manipulation functions, like fopen, fwrite. Needless to say HDF5 and OS functions did not operate on the same file. On windows it does not happen.

  That's very weird. Do you have an example program showing this behavior?

    Quincey

···

On Apr 28, 2009, at 1:58 AM, Dimitris Servis wrote:

HTH

-- dimitris

2009/4/28 Werner Benger <werner@cct.lsu.edu>
I could imagine such a crash when memory is corrupted by the application,
like the application has freed some HDF5-internal memory - which it should not
do, but can happen in a buggy application.

Also, H5close() closes the library, it must be ensured that no other call
to HDF5 follows after this call. Usually HDF5 registers its own destructor
call via an atexit() routine. If you don't disable this, and call your destructor
in addition to HDF5's one, it will also lead to problems.

But these are deterministic and reproducible. Main problem seems to be your "sometimes"
issue. This very much sounds like random memory corruption error.

       Werner

On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer <ramakrishnan.iyer@altair.com > > wrote:

All,

I have a class which makes use of hdf5 API's . I close all the resources
( dataset, dataspaces ) after Write/Read operations . When the class
destructor is called I have a call to H5close() . Sometimes the
execution of this function call leads to a Crash . I would like to know
is there any scenario when a call to H5close() fails ?

Regards

Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 1:40 AM
To: Ramakrishnan Iyer
Cc: HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

All,

Can the call to H5close() cause the an application to crash ?

           You'll need to give more information before anyone can
answer this question...

                       Quincey

Regards

Ram

--
___________________________________________________________________________
Dr. Werner Benger <werner@cct.lsu.edu> Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

I had problems with H5close on linux, crashing the application if before
using h5close I used any file manipulation functions, like fopen, fwrite.
Needless to say HDF5 and OS functions did not operate on the same file. On
windows it does not happen.

HTH

-- dimitris

···

2009/4/28 Werner Benger <werner@cct.lsu.edu>

I could imagine such a crash when memory is corrupted by the application,
like the application has freed some HDF5-internal memory - which it should
not
do, but can happen in a buggy application.

Also, H5close() closes the library, it must be ensured that no other call
to HDF5 follows after this call. Usually HDF5 registers its own destructor
call via an atexit() routine. If you don't disable this, and call your
destructor
in addition to HDF5's one, it will also lead to problems.

But these are deterministic and reproducible. Main problem seems to be your
"sometimes"
issue. This very much sounds like random memory corruption error.

       Werner

On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer < > ramakrishnan.iyer@altair.com> wrote:

All,

I have a class which makes use of hdf5 API's . I close all the resources
( dataset, dataspaces ) after Write/Read operations . When the class
destructor is called I have a call to H5close() . Sometimes the
execution of this function call leads to a Crash . I would like to know
is there any scenario when a call to H5close() fails ?

Regards

Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 1:40 AM
To: Ramakrishnan Iyer
Cc: HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

All,

Can the call to H5close() cause the an application to crash ?

           You'll need to give more information before anyone can
answer this question...

                       Quincey

Regards

Ram

--
___________________________________________________________________________
Dr. Werner Benger <werner@cct.lsu.edu> Visualization
Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to
hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Unfortunatelly not yet... I will have to finish my testing first and submit
the driver code to you...

-- dimitris

···

2009/4/28 Quincey Koziol <koziol@hdfgroup.org>

Hi Dimitris,
On Apr 28, 2009, at 1:58 AM, Dimitris Servis wrote:

I had problems with H5close on linux, crashing the application if before
using h5close I used any file manipulation functions, like fopen, fwrite.
Needless to say HDF5 and OS functions did not operate on the same file. On
windows it does not happen.

That's very weird. Do you have an example program showing this behavior?

Quincey

HTH

-- dimitris

2009/4/28 Werner Benger <werner@cct.lsu.edu>

I could imagine such a crash when memory is corrupted by the application,
like the application has freed some HDF5-internal memory - which it should
not
do, but can happen in a buggy application.

Also, H5close() closes the library, it must be ensured that no other call
to HDF5 follows after this call. Usually HDF5 registers its own destructor
call via an atexit() routine. If you don't disable this, and call your
destructor
in addition to HDF5's one, it will also lead to problems.

But these are deterministic and reproducible. Main problem seems to be
your "sometimes"
issue. This very much sounds like random memory corruption error.

       Werner

On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer < >> ramakrishnan.iyer@altair.com> wrote:

All,

I have a class which makes use of hdf5 API's . I close all the resources
( dataset, dataspaces ) after Write/Read operations . When the class
destructor is called I have a call to H5close() . Sometimes the
execution of this function call leads to a Crash . I would like to know
is there any scenario when a call to H5close() fails ?

Regards

Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 1:40 AM
To: Ramakrishnan Iyer
Cc: HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

All,

Can the call to H5close() cause the an application to crash ?

           You'll need to give more information before anyone can
answer this question...

                       Quincey

Regards

Ram

--

___________________________________________________________________________
Dr. Werner Benger <werner@cct.lsu.edu> Visualization
Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University
(CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to
hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

All,

I replaced the usage of H5close() with H5garbage_collect() in the
destructor . This solved the Crash issue . What according do you caused
this change of behavior?

Regards

Ram

···

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 5:29 PM
To: Werner Benger
Cc: Ramakrishnan Iyer; HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 28, 2009, at 12:44 AM, Werner Benger wrote:

I could imagine such a crash when memory is corrupted by the
application,
like the application has freed some HDF5-internal memory - which it
should not
do, but can happen in a buggy application.

        As Werner says, usually this sort of error is caused by an
application leaking HDF5 objects or corrupting memory in some way that
causing the HDF5 library to get confused when H5close() tries to close
any open resources (including the internal resources used by the
library).

Also, H5close() closes the library, it must be ensured that no other
call
to HDF5 follows after this call. Usually HDF5 registers its own
destructor
call via an atexit() routine. If you don't disable this, and call
your destructor
in addition to HDF5's one, it will also lead to problems.

        Calling H5dont_atexit() before using any HDF5 routines might
help.
(But I'm guessing won't change anything, if some sort of resource leak
or corruption is involved)

        Quincey

But these are deterministic and reproducible. Main problem seems to
be your "sometimes"
issue. This very much sounds like random memory corruption error.

      Werner

On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer <ramakrishnan.iyer@altair.com > > wrote:

All,

I have a class which makes use of hdf5 API's . I close all the
resources
( dataset, dataspaces ) after Write/Read operations . When the class
destructor is called I have a call to H5close() . Sometimes the
execution of this function call leads to a Crash . I would like to
know
is there any scenario when a call to H5close() fails ?

Regards

Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 1:40 AM
To: Ramakrishnan Iyer
Cc: HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:

All,

Can the call to H5close() cause the an application to crash ?

           You'll need to give more information before anyone can
answer this question...

                       Quincey

Regards

Ram

--

________________________________________________________________________
___

Dr. Werner Benger <werner@cct.lsu.edu> Visualization
Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University
(CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to

hdf-forum-subscribe@hdfgroup.org

.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Hi Ram,

All,
I replaced the usage of H5close() with H5garbage_collect() in the destructor . This solved the Crash issue . What according do you caused this change of behavior?

  I don't really know for certain. Do you have a standalone test program that shows the error and we could debug?

    Quincey

···

On May 11, 2009, at 1:35 AM, Ramakrishnan Iyer wrote:

Regards
Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 5:29 PM
To: Werner Benger
Cc: Ramakrishnan Iyer; HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 28, 2009, at 12:44 AM, Werner Benger wrote:

> I could imagine such a crash when memory is corrupted by the
> application,
> like the application has freed some HDF5-internal memory - which it
> should not
> do, but can happen in a buggy application.

        As Werner says, usually this sort of error is caused by an
application leaking HDF5 objects or corrupting memory in some way that
causing the HDF5 library to get confused when H5close() tries to close
any open resources (including the internal resources used by the
library).

> Also, H5close() closes the library, it must be ensured that no other
> call
> to HDF5 follows after this call. Usually HDF5 registers its own
> destructor
> call via an atexit() routine. If you don't disable this, and call
> your destructor
> in addition to HDF5's one, it will also lead to problems.

        Calling H5dont_atexit() before using any HDF5 routines might help.
(But I'm guessing won't change anything, if some sort of resource leak
or corruption is involved)

        Quincey

> But these are deterministic and reproducible. Main problem seems to
> be your "sometimes"
> issue. This very much sounds like random memory corruption error.
>
> Werner
>
> On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer <ramakrishnan.iyer@altair.com > > > wrote:
>
>> All,
>>
>> I have a class which makes use of hdf5 API's . I close all the
>> resources
>> ( dataset, dataspaces ) after Write/Read operations . When the class
>> destructor is called I have a call to H5close() . Sometimes the
>> execution of this function call leads to a Crash . I would like to
>> know
>> is there any scenario when a call to H5close() fails ?
>>
>> Regards
>>
>> Ram
>>
>> -----Original Message-----
>> From: Quincey Koziol [mailto:koziol@hdfgroup.org]
>> Sent: Tuesday, April 28, 2009 1:40 AM
>> To: Ramakrishnan Iyer
>> Cc: HDF forum
>> Subject: Re: [hdf-forum] Call to H5close()
>>
>> Hi Ram,
>>
>> On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:
>>
>> All,
>>
>> Can the call to H5close() cause the an application to crash ?
>>
>> You'll need to give more information before anyone can
>> answer this question...
>>
>> Quincey
>>
>> Regards
>>
>> Ram
>>
>
> --
> ___________________________________________________________________________
> Dr. Werner Benger <werner@cct.lsu.edu> Visualization
> Research
> Laboratory for Creative Arts and Technology (LCAT)
> Center for Computation & Technology at Louisiana State University
> (CCT/LSU)
> 239 Johnston Hall, Baton Rouge, Louisiana 70803
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
>
> ----------------------------------------------------------------------
> This mailing list is for HDF software users discussion.
> To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org
> .
> To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.
>

Hi Ram,

on first impression, I might think that H5garbage_collect() can be called
multiple times, but H5close() only once.

Is it ensured in your code that this destructor can be called only once,
i.e., that there exists only one such object and there are no temporary
copies?

(Quincey, what would happen if H5close() is called multiple times? Is
  it safe against multiple calls?)

Cheers,
  Werner

···

On Mon, 11 May 2009 20:48:46 -0500, Quincey Koziol <koziol@hdfgroup.org> wrote:

Hi Ram,

On May 11, 2009, at 1:35 AM, Ramakrishnan Iyer wrote:

All,
I replaced the usage of H5close() with H5garbage_collect() in the
destructor . This solved the Crash issue . What according do you
caused this change of behavior?

  I don't really know for certain. Do you have a standalone test
program that shows the error and we could debug?

    Quincey

Regards
Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 5:29 PM
To: Werner Benger
Cc: Ramakrishnan Iyer; HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 28, 2009, at 12:44 AM, Werner Benger wrote:

> I could imagine such a crash when memory is corrupted by the
> application,
> like the application has freed some HDF5-internal memory - which it
> should not
> do, but can happen in a buggy application.

        As Werner says, usually this sort of error is caused by an
application leaking HDF5 objects or corrupting memory in some way that
causing the HDF5 library to get confused when H5close() tries to close
any open resources (including the internal resources used by the
library).

> Also, H5close() closes the library, it must be ensured that no other
> call
> to HDF5 follows after this call. Usually HDF5 registers its own
> destructor
> call via an atexit() routine. If you don't disable this, and call
> your destructor
> in addition to HDF5's one, it will also lead to problems.

        Calling H5dont_atexit() before using any HDF5 routines might
help.
(But I'm guessing won't change anything, if some sort of resource leak
or corruption is involved)

        Quincey

> But these are deterministic and reproducible. Main problem seems to
> be your "sometimes"
> issue. This very much sounds like random memory corruption error.
>
> Werner
>
> On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer >> <ramakrishnan.iyer@altair.com >> > > wrote:
>
>> All,
>>
>> I have a class which makes use of hdf5 API's . I close all the
>> resources
>> ( dataset, dataspaces ) after Write/Read operations . When the
class
>> destructor is called I have a call to H5close() . Sometimes the
>> execution of this function call leads to a Crash . I would like to
>> know
>> is there any scenario when a call to H5close() fails ?
>>
>> Regards
>>
>> Ram
>>
>> -----Original Message-----
>> From: Quincey Koziol [mailto:koziol@hdfgroup.org]
>> Sent: Tuesday, April 28, 2009 1:40 AM
>> To: Ramakrishnan Iyer
>> Cc: HDF forum
>> Subject: Re: [hdf-forum] Call to H5close()
>>
>> Hi Ram,
>>
>> On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:
>>
>> All,
>>
>> Can the call to H5close() cause the an application to crash ?
>>
>> You'll need to give more information before anyone can
>> answer this question...
>>
>> Quincey
>>
>> Regards
>>
>> Ram
>>
>
> --
>
___________________________________________________________________________
> Dr. Werner Benger <werner@cct.lsu.edu> Visualization
> Research
> Laboratory for Creative Arts and Technology (LCAT)
> Center for Computation & Technology at Louisiana State University
> (CCT/LSU)
> 239 Johnston Hall, Baton Rouge, Louisiana 70803
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
>
----------------------------------------------------------------------
> This mailing list is for HDF software users discussion.
> To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org
> .
> To unsubscribe, send a message to hdf-forum-
unsubscribe@hdfgroup.org.
>

--
___________________________________________________________________________
Dr. Werner Benger <werner@cct.lsu.edu> Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

Hi Werner,

Hi Ram,

on first impression, I might think that H5garbage_collect() can be called
multiple times, but H5close() only once.

Is it ensured in your code that this destructor can be called only once,
i.e., that there exists only one such object and there are no temporary
copies?

(Quincey, what would happen if H5close() is called multiple times? Is
it safe against multiple calls?)

  It should be. But it's an odd way of interacting with the library and may tickle some obscure bug... :slight_smile:

    Quincey

···

On May 11, 2009, at 10:04 PM, Werner Benger wrote:

Cheers,
  Werner

On Mon, 11 May 2009 20:48:46 -0500, Quincey Koziol <koziol@hdfgroup.org > > wrote:

Hi Ram,

On May 11, 2009, at 1:35 AM, Ramakrishnan Iyer wrote:

All,
I replaced the usage of H5close() with H5garbage_collect() in the
destructor . This solved the Crash issue . What according do you
caused this change of behavior?

  I don't really know for certain. Do you have a standalone test
program that shows the error and we could debug?

    Quincey

Regards
Ram

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Tuesday, April 28, 2009 5:29 PM
To: Werner Benger
Cc: Ramakrishnan Iyer; HDF forum
Subject: Re: [hdf-forum] Call to H5close()

Hi Ram,

On Apr 28, 2009, at 12:44 AM, Werner Benger wrote:

> I could imagine such a crash when memory is corrupted by the
> application,
> like the application has freed some HDF5-internal memory - which it
> should not
> do, but can happen in a buggy application.

       As Werner says, usually this sort of error is caused by an
application leaking HDF5 objects or corrupting memory in some way that
causing the HDF5 library to get confused when H5close() tries to close
any open resources (including the internal resources used by the
library).

> Also, H5close() closes the library, it must be ensured that no other
> call
> to HDF5 follows after this call. Usually HDF5 registers its own
> destructor
> call via an atexit() routine. If you don't disable this, and call
> your destructor
> in addition to HDF5's one, it will also lead to problems.

       Calling H5dont_atexit() before using any HDF5 routines might
help.
(But I'm guessing won't change anything, if some sort of resource leak
or corruption is involved)

       Quincey

> But these are deterministic and reproducible. Main problem seems to
> be your "sometimes"
> issue. This very much sounds like random memory corruption error.
>
> Werner
>
> On Mon, 27 Apr 2009 23:42:59 -0500, Ramakrishnan Iyer <ramakrishnan.iyer@altair.com >>> > > wrote:
>
>> All,
>>
>> I have a class which makes use of hdf5 API's . I close all the
>> resources
>> ( dataset, dataspaces ) after Write/Read operations . When the
class
>> destructor is called I have a call to H5close() . Sometimes the
>> execution of this function call leads to a Crash . I would like to
>> know
>> is there any scenario when a call to H5close() fails ?
>>
>> Regards
>>
>> Ram
>>
>> -----Original Message-----
>> From: Quincey Koziol [mailto:koziol@hdfgroup.org]
>> Sent: Tuesday, April 28, 2009 1:40 AM
>> To: Ramakrishnan Iyer
>> Cc: HDF forum
>> Subject: Re: [hdf-forum] Call to H5close()
>>
>> Hi Ram,
>>
>> On Apr 27, 2009, at 6:18 AM, Ramakrishnan Iyer wrote:
>>
>> All,
>>
>> Can the call to H5close() cause the an application to crash ?
>>
>> You'll need to give more information before anyone can
>> answer this question...
>>
>> Quincey
>>
>> Regards
>>
>> Ram
>>
>
> --
>
___________________________________________________________________________
> Dr. Werner Benger <werner@cct.lsu.edu> Visualization
> Research
> Laboratory for Creative Arts and Technology (LCAT)
> Center for Computation & Technology at Louisiana State University
> (CCT/LSU)
> 239 Johnston Hall, Baton Rouge, Louisiana 70803
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
>
----------------------------------------------------------------------
> This mailing list is for HDF software users discussion.
> To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org
> .
> To unsubscribe, send a message to hdf-forum-
unsubscribe@hdfgroup.org.
>

--
___________________________________________________________________________
Dr. Werner Benger <werner@cct.lsu.edu> Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
239 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Hi all

In my case it must have been a deployment issue. In one of my unit tests I
wanted to completely close the library at each test and reopen it in the
next one. The problem appeared only on Linux which builds on a build server.
Typically I develop on windows and have special scripts on Linux. I have a
library that links statically with HDF5 and provides some functionality and
the unit test links with that one. But since H5close is used in the unit
test, the guy who set up the build server had the unit test link with the
shared HDF5 library, so in the end, there would be 2 instances of the
library linked through 2 different shared objects, and H5close was called
from one, while handles where created through handles in my library. I am
not sure this was the problem and I am not sure how references from one
library ended up in the H5close of the other, as by the time I noticed that
I had already solved it by using my own functions that iterate and close all
remaining HDF5 objects on my library's side.

HTH

-- dimitris