DependableSystemsLab / LLFI

LLFI is an LLVM based fault injection tool, that injects faults into the LLVM IR of the application source code. The faults can be injected into specific program points, and the effect can be easily tracked back to the source code. Please refer to the paper below. NOTE: If you publish a paper using LLFI, please add it to PaperLLFI.bib
http://blogs.ubc.ca/karthik/2014/02/23/quantifying-the-accuracy-of-high-level-fault-injection-techniques/
Other
68 stars 35 forks source link

Software Failures description/implementation error #73

Closed karfair closed 9 years ago

karfair commented 9 years ago

For the some of the Software Failures listed here (marked in bold), I don't it it does what it's suppose to do.

RaceCondition(Timing)

Does nothing as PTHREAD_MUTEX_INITIALIZER initializes another mutex which is then unlocked?

virtual void injectFault(long llfi_index, unsigned size, unsigned fi_bit,char *buf){
        pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
        pthread_mutex_unlock(&mutex);
        return;
    }

ThreadKiller(Res)

Does the wrong thing as

int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
        void *(*start_routine)(void*), void *arg);
    From <http://pubs.opengroup.org/onlinepubs/007908799/xsh/pthread_create.html> 

int pthread_join(pthread_t thread, void **value_ptr);
    From <http://pubs.opengroup.org/onlinepubs/007908799/xsh/pthread_join.html> 

type difference between: pthread_t * and pthread_t, but the injection function assumes they are typed as pthread_t.

virtual void injectFault(long llfi_index, unsigned size, unsigned fi_bit,char *buf){
        pthread_t t = pthread_t(*buf);
        sleep(0.02);
        pthread_cancel(t);
        return;
    }

Deadlock(Res)

injects a deadlock before a call to pthread_join but only on the calling thread, not both. (doubles lock the mutex1 in the calling thread.

virtual void injectFault(long llfi_index, unsigned size, unsigned fi_bit,char *buf){
        pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
        pthread_mutex_lock(&mutex1);
        pthread_t thread1 = pthread_t(*buf);
        pthread_join(thread1, NULL);
        pthread_mutex_lock(&mutex1);
        return;
    }