You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a bug when utilizing dcurl after first time. Calling dcurl_destroy in second time would yield double free error:
[dcurl] Implementation CPU (Intel SSE) is initialized successfully
test-dcurl(34354,0x1115395c0) malloc: *** error for object 0x7f9ed4d00000: pointer being freed was not allocated
test-dcurl(34354,0x1115395c0) malloc: *** set a breakpoint in malloc_error_break to debug
/bin/sh: line 1: 34354 Abort trap: 6 ./build/test-dcurl
make: *** [build/test-dcurl.done] Error 134
Step to reproduce:
Put another dcurl_init and dcurl_destroy in test_dcurl test, then simply make check.
The text was updated successfully, but these errors were encountered:
marktwtn
changed the title
Double free error when initialize/free repetitively
Bug: Encounter memory free error while calling initialize/destroy functions repetitively
Jan 31, 2019
In dcurl, we maintain a double-linked list with nodes representing different hardware architectures.
dcurl_init() should add the nodes into the list and dcurl_destroy() should remove the nodes from the list.
However, the current implementation of dcurl_destroy() does not call the corresponding function to remove it.
As calling dcurl_init() and dcurl_destroy() repeatedly without removing the nodes, the list would behave unexpectedly.
In this issue, the unexpected behaviour makes dcurl_destroy() call the function destroyImplContext() more times than it should have, which causes the memory free error.
jserv
changed the title
Bug: Encounter memory free error while calling initialize/destroy functions repetitively
Invalid memory operations on calling initialize/destroy functions repetitively
Feb 1, 2019
marktwtn
added a commit
to marktwtn/dcurl
that referenced
this issue
Feb 1, 2019
The memory double free error occurs if we initialize and destroy dcurl repeatedly.
dcurl maintains a list of nodes for different hardwares.
The error is caused by forgetting to remove the nodes from the list.
To fix it, add the corresponding function list_del() in dcurl_destroy().
Besides fixing the error, one of the testcases is modified
to repeatedly test the initialization and destruction of dcurl N times.
The value of N equals to 5.
CloseDLTcollab#94.
There's a bug when utilizing dcurl after first time. Calling
dcurl_destroy
in second time would yield double free error:Step to reproduce:
Put another
dcurl_init
anddcurl_destroy
intest_dcurl
test, then simplymake check
.The text was updated successfully, but these errors were encountered: