From 9dba568fc3cc1cb69011a457b45f5683deb82016 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 6 Jan 2005 16:16:16 -0500 Subject: [svn-r9761] Purpose: Bug fix. Description: threadsafe test (ttsafe) would seg-fault if --disable-production --enable-debug mode is used. Reason was that the fstack.nused field was not initialized when created. Solution: Init new fstack.nused with 0. Platforms tested: Tested in mir, using development/debug mode. Did not "h5committested" as change is trivial and limited to threadsafe mode. --- src/H5CS.c | 1 + src/H5FS.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/H5CS.c b/src/H5CS.c index 6543fc5..77bc3d7 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -87,6 +87,7 @@ H5FS_get_stack(void) /* no associated value with current thread - create one */ fstack = (H5FS_t *)HDmalloc(sizeof(H5FS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */ pthread_setspecific(H5TS_funcstk_key_g, (void *)fstack); + fstack->nused=0; } FUNC_LEAVE_NOAPI_NOFS(fstack); diff --git a/src/H5FS.c b/src/H5FS.c index 6543fc5..77bc3d7 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -87,6 +87,7 @@ H5FS_get_stack(void) /* no associated value with current thread - create one */ fstack = (H5FS_t *)HDmalloc(sizeof(H5FS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */ pthread_setspecific(H5TS_funcstk_key_g, (void *)fstack); + fstack->nused=0; } FUNC_LEAVE_NOAPI_NOFS(fstack); -- cgit v0.12