Showing error 2180

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: pthread-atomic/szymanski_safe.i
Line in file: 646
Project: SV-COMP 2013
Project version: 2.6.28
Tools: Manual Work
Entered: 2013-01-17 16:57:54 UTC


Source:

616extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
617        int __pshared)
618     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
619extern int pthread_key_create (pthread_key_t *__key,
620          void (*__destr_function) (void *))
621     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
622extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
623extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
624extern int pthread_setspecific (pthread_key_t __key,
625    __const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ;
626extern int pthread_getcpuclockid (pthread_t __thread_id,
627      __clockid_t *__clock_id)
628     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
629extern int pthread_atfork (void (*__prepare) (void),
630      void (*__parent) (void),
631      void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__));
632
633int flag1 = 0, flag2 = 0;
634int x;
635void *thr1() {
636  flag1 = 1;
637  while (flag2 >= 3);
638  flag1 = 3;
639  if (flag2 == 1) {
640    flag1 = 2;
641    while (flag2 != 4);
642  }
643  flag1 = 4;
644  while (flag2 >= 2);
645  x = 0;
646  if (!(x<=0)) ERROR: goto ERROR;;
647  while (2 <= flag2 && flag2 <= 3);
648  flag1 = 0;
649}
650void *thr2() {
651  flag2 = 1;
652  while (flag1 >= 3);
653  flag2 = 3;
654  if (flag1 == 1) {
655    flag2 = 2;
656    while (flag1 != 4);
Show full sources