1 / 7

Implementation

Implementation. cpp ../../$MY_TESTCASE.c > $MY_TESTCASE.cpp gcc -E -I ../../include/ $MY_TESTCASE.cpp > $MY_TESTCASE.i pblast.opt $MY_TESTCASE.i | tee -a $MY_TESTCASE.pblast.opt spec.opt $MY_TESTCASE.lock $MY_TESTCASE.i | tee -a $MY_TESTCASE.spec.opt blastgui.opt &. AV_LOCK(cachelock).

jenaya
Download Presentation

Implementation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Implementation • cpp ../../$MY_TESTCASE.c > $MY_TESTCASE.cpp • gcc -E -I ../../include/ $MY_TESTCASE.cpp > $MY_TESTCASE.i • pblast.opt $MY_TESTCASE.i | tee -a $MY_TESTCASE.pblast.opt • spec.opt $MY_TESTCASE.lock $MY_TESTCASE.i | tee -a $MY_TESTCASE.spec.opt • blastgui.opt &

  2. AV_LOCK(cachelock) pthread_mutex_lock(cachelock) semaphore(cachelock) Cache.cLock Specification and Event int lockStatus = 0;; void __event0__() { if ( lockStatus == 0 ) { lockStatus = 1; } else { __error__(); } } void __event1__() { if ( lockStatus == 1 ) { lockStatus = 0; } else { __error__(); } } global int lockStatus = 0; event { pattern { pthread_mutex_lock(&(cachelock)); } guard { lockStatus == 0 } action { lockStatus = 1; } } event { pattern { pthread_mutex_unlock(&(cachelock)); } guard { lockStatus == 1 } action { lockStatus = 0; } }

  3. ‘BLAST’ Execution Log 311 :: 311: FunctionCall(cache_free_one()) :: -1 196 :: 196: Block(cobj@cache_free_one = cachelist.prev;) :: 197 197 :: 197: Pred(Not (cobj@cache_free_one==&(cachelist))) :: 200 200 :: 200: FunctionCall(cacheobj_remove(cobj@cache_free_one)) :: -1 131 :: 131: Block(next@cacheobj_remove = * (cobj@cacheobj_remove ).next;prev@cacheobj_remove = * (cobj@cacheobj_remove ).prev;* (next@cacheobj_remove ).prev = prev@cacheobj_remove;* (prev@cacheobj_remove ).next = next@cacheobj_remove;) ::126 126 :: 126: Block(Return(0);) :: -1 -1 :: Skip :: 201 201 :: 201: Block(disk_usage = disk_usage - * (cobj@cache_free_one ).diskusage;tmpcobj@cache_free_one = * (cobj@cache_free_one );* (cobj@cache_free_one ).obj = 0;) :: 18 18 :: 18: Pred(Not (lockStatus==1)) :: 20 20 :: 20: FunctionCall(__error__()) :: -1 Error found! The system is unsafe :-(

  4. Cache Case – System is not safe

  5. Cache Case – System is safe

  6. static int cache_clear() { AV_LOCK(cachelock); while(cache_free_one()); AV_UNLOCK(cachelock); return 0; } Problem Identification static int cache_free_one() { struct cacheobj *cobj; struct cacheobj tmpcobj; ... cacheobj_remove(cobj); disk_usage -= cobj->diskusage; tmpcobj = *cobj; cobj->obj = NULL; AV_UNLOCK(cachelock); cacheobj_free(&tmpcobj); AV_LOCK(cachelock); return 1; }

  7. Description Quantity 1 System is safe 9 2 System is not safe 1 3 That’s it! 1 4 Syntax error 3 5 Limitation error 7 6 Parsing error 2 Total: 23 Test Results

More Related