Showing error 2208

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


Source:

   1# 1 "stack_BUG.c"
   2# 1 "<built-in>"
   3# 1 "<command-line>"
   4# 1 "stack_BUG.c"
   5# 1 "/usr/include/pthread.h" 1 3 4
   6# 23 "/usr/include/pthread.h" 3 4
   7# 1 "/usr/include/features.h" 1 3 4
   8# 363 "/usr/include/features.h" 3 4
   9# 1 "/usr/include/sys/cdefs.h" 1 3 4
  10# 372 "/usr/include/sys/cdefs.h" 3 4
  11# 1 "/usr/include/bits/wordsize.h" 1 3 4
  12# 373 "/usr/include/sys/cdefs.h" 2 3 4
  13# 364 "/usr/include/features.h" 2 3 4
  14# 387 "/usr/include/features.h" 3 4
  15# 1 "/usr/include/gnu/stubs.h" 1 3 4
  16
  17
  18
  19# 1 "/usr/include/bits/wordsize.h" 1 3 4
  20# 5 "/usr/include/gnu/stubs.h" 2 3 4
  21
  22
  23# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
  24# 8 "/usr/include/gnu/stubs.h" 2 3 4
  25# 388 "/usr/include/features.h" 2 3 4
  26# 24 "/usr/include/pthread.h" 2 3 4
  27# 1 "/usr/include/endian.h" 1 3 4
  28# 37 "/usr/include/endian.h" 3 4
  29# 1 "/usr/include/bits/endian.h" 1 3 4
  30# 38 "/usr/include/endian.h" 2 3 4
  31# 61 "/usr/include/endian.h" 3 4
  32# 1 "/usr/include/bits/byteswap.h" 1 3 4
  33# 62 "/usr/include/endian.h" 2 3 4
  34# 25 "/usr/include/pthread.h" 2 3 4
  35# 1 "/usr/include/sched.h" 1 3 4
  36# 27 "/usr/include/sched.h" 3 4
  37# 1 "/usr/include/bits/types.h" 1 3 4
  38# 28 "/usr/include/bits/types.h" 3 4
  39# 1 "/usr/include/bits/wordsize.h" 1 3 4
  40# 29 "/usr/include/bits/types.h" 2 3 4
  41
  42
  43typedef unsigned char __u_char;
  44typedef unsigned short int __u_short;
  45typedef unsigned int __u_int;
  46typedef unsigned long int __u_long;
  47
  48
  49typedef signed char __int8_t;
  50typedef unsigned char __uint8_t;
  51typedef signed short int __int16_t;
  52typedef unsigned short int __uint16_t;
  53typedef signed int __int32_t;
  54typedef unsigned int __uint32_t;
  55
  56
  57
  58
  59__extension__ typedef signed long long int __int64_t;
  60__extension__ typedef unsigned long long int __uint64_t;
  61
  62
  63
  64
  65
  66
  67
  68__extension__ typedef long long int __quad_t;
  69__extension__ typedef unsigned long long int __u_quad_t;
  70# 131 "/usr/include/bits/types.h" 3 4
  71# 1 "/usr/include/bits/typesizes.h" 1 3 4
  72# 132 "/usr/include/bits/types.h" 2 3 4
  73
  74
  75__extension__ typedef __u_quad_t __dev_t;
  76__extension__ typedef unsigned int __uid_t;
  77__extension__ typedef unsigned int __gid_t;
  78__extension__ typedef unsigned long int __ino_t;
  79__extension__ typedef __u_quad_t __ino64_t;
  80__extension__ typedef unsigned int __mode_t;
  81__extension__ typedef unsigned int __nlink_t;
  82__extension__ typedef long int __off_t;
  83__extension__ typedef __quad_t __off64_t;
  84__extension__ typedef int __pid_t;
  85__extension__ typedef struct { int __val[2]; } __fsid_t;
  86__extension__ typedef long int __clock_t;
  87__extension__ typedef unsigned long int __rlim_t;
  88__extension__ typedef __u_quad_t __rlim64_t;
  89__extension__ typedef unsigned int __id_t;
  90__extension__ typedef long int __time_t;
  91__extension__ typedef unsigned int __useconds_t;
  92__extension__ typedef long int __suseconds_t;
  93
  94__extension__ typedef int __daddr_t;
  95__extension__ typedef long int __swblk_t;
  96__extension__ typedef int __key_t;
  97
  98
  99__extension__ typedef int __clockid_t;
 100
 101
 102__extension__ typedef void * __timer_t;
 103
 104
 105__extension__ typedef long int __blksize_t;
 106
 107
 108
 109
 110__extension__ typedef long int __blkcnt_t;
 111__extension__ typedef __quad_t __blkcnt64_t;
 112
 113
 114__extension__ typedef unsigned long int __fsblkcnt_t;
 115__extension__ typedef __u_quad_t __fsblkcnt64_t;
 116
 117
 118__extension__ typedef unsigned long int __fsfilcnt_t;
 119__extension__ typedef __u_quad_t __fsfilcnt64_t;
 120
 121__extension__ typedef int __ssize_t;
 122
 123
 124
 125typedef __off64_t __loff_t;
 126typedef __quad_t *__qaddr_t;
 127typedef char *__caddr_t;
 128
 129
 130__extension__ typedef int __intptr_t;
 131
 132
 133__extension__ typedef unsigned int __socklen_t;
 134# 28 "/usr/include/sched.h" 2 3 4
 135
 136
 137# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
 138# 212 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 3 4
 139typedef unsigned int size_t;
 140# 31 "/usr/include/sched.h" 2 3 4
 141
 142
 143
 144# 1 "/usr/include/time.h" 1 3 4
 145# 74 "/usr/include/time.h" 3 4
 146
 147
 148typedef __time_t time_t;
 149
 150
 151
 152# 120 "/usr/include/time.h" 3 4
 153struct timespec
 154  {
 155    __time_t tv_sec;
 156    long int tv_nsec;
 157  };
 158# 35 "/usr/include/sched.h" 2 3 4
 159
 160
 161typedef __pid_t pid_t;
 162
 163
 164
 165
 166
 167# 1 "/usr/include/bits/sched.h" 1 3 4
 168# 74 "/usr/include/bits/sched.h" 3 4
 169struct sched_param
 170  {
 171    int __sched_priority;
 172  };
 173
 174
 175# 97 "/usr/include/bits/sched.h" 3 4
 176
 177
 178
 179
 180
 181
 182
 183
 184struct __sched_param
 185  {
 186    int __sched_priority;
 187  };
 188# 120 "/usr/include/bits/sched.h" 3 4
 189typedef unsigned long int __cpu_mask;
 190
 191
 192
 193
 194
 195
 196typedef struct
 197{
 198  __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
 199} cpu_set_t;
 200# 203 "/usr/include/bits/sched.h" 3 4
 201
 202
 203extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
 204  __attribute__ ((__nothrow__));
 205extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__)) ;
 206extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__));
 207
 208
 209# 44 "/usr/include/sched.h" 2 3 4
 210
 211
 212
 213
 214
 215
 216
 217extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
 218     __attribute__ ((__nothrow__));
 219
 220
 221extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__));
 222
 223
 224extern int sched_setscheduler (__pid_t __pid, int __policy,
 225          __const struct sched_param *__param) __attribute__ ((__nothrow__));
 226
 227
 228extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__));
 229
 230
 231extern int sched_yield (void) __attribute__ ((__nothrow__));
 232
 233
 234extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__));
 235
 236
 237extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__));
 238
 239
 240extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__));
 241# 126 "/usr/include/sched.h" 3 4
 242
 243# 26 "/usr/include/pthread.h" 2 3 4
 244# 1 "/usr/include/time.h" 1 3 4
 245# 30 "/usr/include/time.h" 3 4
 246
 247
 248
 249
 250
 251
 252
 253
 254# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
 255# 39 "/usr/include/time.h" 2 3 4
 256
 257
 258
 259# 1 "/usr/include/bits/time.h" 1 3 4
 260# 43 "/usr/include/time.h" 2 3 4
 261# 58 "/usr/include/time.h" 3 4
 262
 263
 264typedef __clock_t clock_t;
 265
 266
 267
 268# 92 "/usr/include/time.h" 3 4
 269typedef __clockid_t clockid_t;
 270# 104 "/usr/include/time.h" 3 4
 271typedef __timer_t timer_t;
 272# 131 "/usr/include/time.h" 3 4
 273
 274
 275struct tm
 276{
 277  int tm_sec;
 278  int tm_min;
 279  int tm_hour;
 280  int tm_mday;
 281  int tm_mon;
 282  int tm_year;
 283  int tm_wday;
 284  int tm_yday;
 285  int tm_isdst;
 286
 287
 288  long int tm_gmtoff;
 289  __const char *tm_zone;
 290
 291
 292
 293
 294};
 295
 296
 297
 298
 299
 300
 301
 302
 303struct itimerspec
 304  {
 305    struct timespec it_interval;
 306    struct timespec it_value;
 307  };
 308
 309
 310struct sigevent;
 311# 180 "/usr/include/time.h" 3 4
 312
 313
 314
 315extern clock_t clock (void) __attribute__ ((__nothrow__));
 316
 317
 318extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
 319
 320
 321extern double difftime (time_t __time1, time_t __time0)
 322     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
 323
 324
 325extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
 326
 327
 328
 329
 330
 331extern size_t strftime (char *__restrict __s, size_t __maxsize,
 332   __const char *__restrict __format,
 333   __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
 334
 335# 215 "/usr/include/time.h" 3 4
 336# 1 "/usr/include/xlocale.h" 1 3 4
 337# 28 "/usr/include/xlocale.h" 3 4
 338typedef struct __locale_struct
 339{
 340
 341  struct __locale_data *__locales[13];
 342
 343
 344  const unsigned short int *__ctype_b;
 345  const int *__ctype_tolower;
 346  const int *__ctype_toupper;
 347
 348
 349  const char *__names[13];
 350} *__locale_t;
 351
 352
 353typedef __locale_t locale_t;
 354# 216 "/usr/include/time.h" 2 3 4
 355
 356extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
 357     __const char *__restrict __format,
 358     __const struct tm *__restrict __tp,
 359     __locale_t __loc) __attribute__ ((__nothrow__));
 360# 230 "/usr/include/time.h" 3 4
 361
 362
 363
 364extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
 365
 366
 367
 368extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
 369
 370
 371
 372
 373
 374extern struct tm *gmtime_r (__const time_t *__restrict __timer,
 375       struct tm *__restrict __tp) __attribute__ ((__nothrow__));
 376
 377
 378
 379extern struct tm *localtime_r (__const time_t *__restrict __timer,
 380          struct tm *__restrict __tp) __attribute__ ((__nothrow__));
 381
 382
 383
 384
 385
 386extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
 387
 388
 389extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
 390
 391
 392
 393
 394
 395
 396
 397extern char *asctime_r (__const struct tm *__restrict __tp,
 398   char *__restrict __buf) __attribute__ ((__nothrow__));
 399
 400
 401extern char *ctime_r (__const time_t *__restrict __timer,
 402        char *__restrict __buf) __attribute__ ((__nothrow__));
 403
 404
 405
 406
 407extern char *__tzname[2];
 408extern int __daylight;
 409extern long int __timezone;
 410
 411
 412
 413
 414extern char *tzname[2];
 415
 416
 417
 418extern void tzset (void) __attribute__ ((__nothrow__));
 419
 420
 421
 422extern int daylight;
 423extern long int timezone;
 424
 425
 426
 427
 428
 429extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
 430# 313 "/usr/include/time.h" 3 4
 431extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
 432
 433
 434extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
 435
 436
 437extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
 438# 328 "/usr/include/time.h" 3 4
 439extern int nanosleep (__const struct timespec *__requested_time,
 440        struct timespec *__remaining);
 441
 442
 443
 444extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
 445
 446
 447extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
 448
 449
 450extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
 451     __attribute__ ((__nothrow__));
 452
 453
 454
 455
 456
 457
 458extern int clock_nanosleep (clockid_t __clock_id, int __flags,
 459       __const struct timespec *__req,
 460       struct timespec *__rem);
 461
 462
 463extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
 464
 465
 466
 467
 468extern int timer_create (clockid_t __clock_id,
 469    struct sigevent *__restrict __evp,
 470    timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
 471
 472
 473extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
 474
 475
 476extern int timer_settime (timer_t __timerid, int __flags,
 477     __const struct itimerspec *__restrict __value,
 478     struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
 479
 480
 481extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
 482     __attribute__ ((__nothrow__));
 483
 484
 485extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
 486# 417 "/usr/include/time.h" 3 4
 487
 488# 27 "/usr/include/pthread.h" 2 3 4
 489
 490# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
 491# 36 "/usr/include/bits/pthreadtypes.h" 3 4
 492typedef unsigned long int pthread_t;
 493
 494
 495typedef union
 496{
 497  char __size[36];
 498  long int __align;
 499} pthread_attr_t;
 500
 501
 502typedef struct __pthread_internal_slist
 503{
 504  struct __pthread_internal_slist *__next;
 505} __pthread_slist_t;
 506
 507
 508
 509
 510typedef union
 511{
 512  struct __pthread_mutex_s
 513  {
 514    int __lock;
 515    unsigned int __count;
 516    int __owner;
 517
 518
 519    int __kind;
 520    unsigned int __nusers;
 521    __extension__ union
 522    {
 523      int __spins;
 524      __pthread_slist_t __list;
 525    };
 526  } __data;
 527  char __size[24];
 528  long int __align;
 529} pthread_mutex_t;
 530
 531typedef union
 532{
 533  char __size[4];
 534  long int __align;
 535} pthread_mutexattr_t;
 536
 537
 538
 539
 540typedef union
 541{
 542  struct
 543  {
 544    int __lock;
 545    unsigned int __futex;
 546    __extension__ unsigned long long int __total_seq;
 547    __extension__ unsigned long long int __wakeup_seq;
 548    __extension__ unsigned long long int __woken_seq;
 549    void *__mutex;
 550    unsigned int __nwaiters;
 551    unsigned int __broadcast_seq;
 552  } __data;
 553  char __size[48];
 554  __extension__ long long int __align;
 555} pthread_cond_t;
 556
 557typedef union
 558{
 559  char __size[4];
 560  long int __align;
 561} pthread_condattr_t;
 562
 563
 564
 565typedef unsigned int pthread_key_t;
 566
 567
 568
 569typedef int pthread_once_t;
 570
 571
 572
 573
 574
 575typedef union
 576{
 577  struct
 578  {
 579    int __lock;
 580    unsigned int __nr_readers;
 581    unsigned int __readers_wakeup;
 582    unsigned int __writer_wakeup;
 583    unsigned int __nr_readers_queued;
 584    unsigned int __nr_writers_queued;
 585
 586
 587    unsigned char __flags;
 588    unsigned char __shared;
 589    unsigned char __pad1;
 590    unsigned char __pad2;
 591    int __writer;
 592  } __data;
 593  char __size[32];
 594  long int __align;
 595} pthread_rwlock_t;
 596
 597typedef union
 598{
 599  char __size[8];
 600  long int __align;
 601} pthread_rwlockattr_t;
 602
 603
 604
 605
 606
 607typedef volatile int pthread_spinlock_t;
 608
 609
 610
 611
 612typedef union
 613{
 614  char __size[20];
 615  long int __align;
 616} pthread_barrier_t;
 617
 618typedef union
 619{
 620  char __size[4];
 621  int __align;
 622} pthread_barrierattr_t;
 623# 29 "/usr/include/pthread.h" 2 3 4
 624# 1 "/usr/include/bits/setjmp.h" 1 3 4
 625# 29 "/usr/include/bits/setjmp.h" 3 4
 626typedef int __jmp_buf[6];
 627# 30 "/usr/include/pthread.h" 2 3 4
 628# 1 "/usr/include/bits/wordsize.h" 1 3 4
 629# 31 "/usr/include/pthread.h" 2 3 4
 630
 631
 632
 633enum
 634{
 635  PTHREAD_CREATE_JOINABLE,
 636
 637  PTHREAD_CREATE_DETACHED
 638
 639};
 640
 641
 642
 643enum
 644{
 645  PTHREAD_MUTEX_TIMED_NP,
 646  PTHREAD_MUTEX_RECURSIVE_NP,
 647  PTHREAD_MUTEX_ERRORCHECK_NP,
 648  PTHREAD_MUTEX_ADAPTIVE_NP
 649
 650  ,
 651  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
 652  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
 653  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
 654  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
 655
 656
 657
 658
 659
 660};
 661
 662
 663
 664
 665enum
 666{
 667  PTHREAD_MUTEX_STALLED,
 668  PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
 669  PTHREAD_MUTEX_ROBUST,
 670  PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
 671};
 672# 115 "/usr/include/pthread.h" 3 4
 673enum
 674{
 675  PTHREAD_RWLOCK_PREFER_READER_NP,
 676  PTHREAD_RWLOCK_PREFER_WRITER_NP,
 677  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
 678  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
 679};
 680# 147 "/usr/include/pthread.h" 3 4
 681enum
 682{
 683  PTHREAD_INHERIT_SCHED,
 684
 685  PTHREAD_EXPLICIT_SCHED
 686
 687};
 688
 689
 690
 691enum
 692{
 693  PTHREAD_SCOPE_SYSTEM,
 694
 695  PTHREAD_SCOPE_PROCESS
 696
 697};
 698
 699
 700
 701enum
 702{
 703  PTHREAD_PROCESS_PRIVATE,
 704
 705  PTHREAD_PROCESS_SHARED
 706
 707};
 708# 182 "/usr/include/pthread.h" 3 4
 709struct _pthread_cleanup_buffer
 710{
 711  void (*__routine) (void *);
 712  void *__arg;
 713  int __canceltype;
 714  struct _pthread_cleanup_buffer *__prev;
 715};
 716
 717
 718enum
 719{
 720  PTHREAD_CANCEL_ENABLE,
 721
 722  PTHREAD_CANCEL_DISABLE
 723
 724};
 725enum
 726{
 727  PTHREAD_CANCEL_DEFERRED,
 728
 729  PTHREAD_CANCEL_ASYNCHRONOUS
 730
 731};
 732# 220 "/usr/include/pthread.h" 3 4
 733
 734
 735
 736
 737
 738extern int pthread_create (pthread_t *__restrict __newthread,
 739      __const pthread_attr_t *__restrict __attr,
 740      void *(*__start_routine) (void *),
 741      void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
 742
 743
 744
 745
 746
 747extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
 748
 749
 750
 751
 752
 753
 754
 755extern int pthread_join (pthread_t __th, void **__thread_return);
 756# 263 "/usr/include/pthread.h" 3 4
 757extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__));
 758
 759
 760
 761extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
 762
 763
 764extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__));
 765
 766
 767
 768
 769
 770
 771
 772extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 773
 774
 775extern int pthread_attr_destroy (pthread_attr_t *__attr)
 776     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 777
 778
 779extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
 780     int *__detachstate)
 781     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 782
 783
 784extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
 785     int __detachstate)
 786     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 787
 788
 789
 790extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
 791          size_t *__guardsize)
 792     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 793
 794
 795extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
 796          size_t __guardsize)
 797     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 798
 799
 800
 801extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
 802           __attr,
 803           struct sched_param *__restrict __param)
 804     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 805
 806
 807extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
 808           __const struct sched_param *__restrict
 809           __param) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 810
 811
 812extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
 813     __attr, int *__restrict __policy)
 814     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 815
 816
 817extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
 818     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 819
 820
 821extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
 822      __attr, int *__restrict __inherit)
 823     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 824
 825
 826extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
 827      int __inherit)
 828     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 829
 830
 831
 832extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
 833      int *__restrict __scope)
 834     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 835
 836
 837extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
 838     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 839
 840
 841extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
 842          __attr, void **__restrict __stackaddr)
 843     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
 844
 845
 846
 847
 848
 849extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
 850          void *__stackaddr)
 851     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
 852
 853
 854extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
 855          __attr, size_t *__restrict __stacksize)
 856     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 857
 858
 859
 860
 861extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
 862          size_t __stacksize)
 863     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 864
 865
 866
 867extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
 868      void **__restrict __stackaddr,
 869      size_t *__restrict __stacksize)
 870     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3)));
 871
 872
 873
 874
 875extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
 876      size_t __stacksize) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 877# 413 "/usr/include/pthread.h" 3 4
 878extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
 879      __const struct sched_param *__param)
 880     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
 881
 882
 883extern int pthread_getschedparam (pthread_t __target_thread,
 884      int *__restrict __policy,
 885      struct sched_param *__restrict __param)
 886     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
 887
 888
 889extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
 890     __attribute__ ((__nothrow__));
 891# 478 "/usr/include/pthread.h" 3 4
 892extern int pthread_once (pthread_once_t *__once_control,
 893    void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
 894# 490 "/usr/include/pthread.h" 3 4
 895extern int pthread_setcancelstate (int __state, int *__oldstate);
 896
 897
 898
 899extern int pthread_setcanceltype (int __type, int *__oldtype);
 900
 901
 902extern int pthread_cancel (pthread_t __th);
 903
 904
 905
 906
 907extern void pthread_testcancel (void);
 908
 909
 910
 911
 912typedef struct
 913{
 914  struct
 915  {
 916    __jmp_buf __cancel_jmp_buf;
 917    int __mask_was_saved;
 918  } __cancel_jmp_buf[1];
 919  void *__pad[4];
 920} __pthread_unwind_buf_t __attribute__ ((__aligned__));
 921# 524 "/usr/include/pthread.h" 3 4
 922struct __pthread_cleanup_frame
 923{
 924  void (*__cancel_routine) (void *);
 925  void *__cancel_arg;
 926  int __do_it;
 927  int __cancel_type;
 928};
 929# 664 "/usr/include/pthread.h" 3 4
 930extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
 931     __attribute__ ((__regparm__ (1)));
 932# 676 "/usr/include/pthread.h" 3 4
 933extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
 934  __attribute__ ((__regparm__ (1)));
 935# 717 "/usr/include/pthread.h" 3 4
 936extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
 937     __attribute__ ((__regparm__ (1))) __attribute__ ((__noreturn__))
 938
 939     __attribute__ ((__weak__))
 940
 941     ;
 942
 943
 944
 945struct __jmp_buf_tag;
 946extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
 947
 948
 949
 950
 951
 952extern int pthread_mutex_init (pthread_mutex_t *__mutex,
 953          __const pthread_mutexattr_t *__mutexattr)
 954     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 955
 956
 957extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
 958     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 959
 960
 961extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
 962     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 963
 964
 965extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
 966     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 967
 968
 969
 970extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
 971        __const struct timespec *__restrict
 972        __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 973
 974
 975
 976extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
 977     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 978
 979
 980
 981extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
 982      __restrict __mutex,
 983      int *__restrict __prioceiling)
 984     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 985
 986
 987
 988extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
 989      int __prioceiling,
 990      int *__restrict __old_ceiling)
 991     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
 992
 993
 994
 995
 996extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
 997     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 998# 790 "/usr/include/pthread.h" 3 4
 999extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
1000     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1001
1002
1003extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
1004     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1005
1006
1007extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
1008      __restrict __attr,
1009      int *__restrict __pshared)
1010     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1011
1012
1013extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
1014      int __pshared)
1015     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1016
1017
1018
1019extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
1020          __attr, int *__restrict __kind)
1021     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1022
1023
1024
1025
1026extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
1027     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1028
1029
1030
1031extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
1032       __restrict __attr,
1033       int *__restrict __protocol)
1034     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1035
1036
1037
1038extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
1039       int __protocol)
1040     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1041
1042
1043extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
1044          __restrict __attr,
1045          int *__restrict __prioceiling)
1046     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1047
1048
1049extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
1050          int __prioceiling)
1051     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1052
1053
1054
1055extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
1056     int *__robustness)
1057     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1058
1059
1060
1061
1062
1063
1064
1065extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
1066     int __robustness)
1067     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1068# 872 "/usr/include/pthread.h" 3 4
1069extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
1070    __const pthread_rwlockattr_t *__restrict
1071    __attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1072
1073
1074extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
1075     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1076
1077
1078extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
1079     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1080
1081
1082extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
1083  __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1084
1085
1086
1087extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
1088           __const struct timespec *__restrict
1089           __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1090
1091
1092
1093extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
1094     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1095
1096
1097extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
1098     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1099
1100
1101
1102extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
1103           __const struct timespec *__restrict
1104           __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1105
1106
1107
1108extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
1109     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1110
1111
1112
1113
1114
1115extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
1116     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1117
1118
1119extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
1120     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1121
1122
1123extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
1124       __restrict __attr,
1125       int *__restrict __pshared)
1126     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1127
1128
1129extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
1130       int __pshared)
1131     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1132
1133
1134extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
1135       __restrict __attr,
1136       int *__restrict __pref)
1137     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1138
1139
1140extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
1141       int __pref) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1142
1143
1144
1145
1146
1147
1148
1149extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
1150         __const pthread_condattr_t *__restrict
1151         __cond_attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1152
1153
1154extern int pthread_cond_destroy (pthread_cond_t *__cond)
1155     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1156
1157
1158extern int pthread_cond_signal (pthread_cond_t *__cond)
1159     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1160
1161
1162extern int pthread_cond_broadcast (pthread_cond_t *__cond)
1163     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1164
1165
1166
1167
1168
1169
1170extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
1171         pthread_mutex_t *__restrict __mutex)
1172     __attribute__ ((__nonnull__ (1, 2)));
1173# 984 "/usr/include/pthread.h" 3 4
1174extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
1175       pthread_mutex_t *__restrict __mutex,
1176       __const struct timespec *__restrict
1177       __abstime) __attribute__ ((__nonnull__ (1, 2, 3)));
1178
1179
1180
1181
1182extern int pthread_condattr_init (pthread_condattr_t *__attr)
1183     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1184
1185
1186extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
1187     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1188
1189
1190extern int pthread_condattr_getpshared (__const pthread_condattr_t *
1191     __restrict __attr,
1192     int *__restrict __pshared)
1193     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1194
1195
1196extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
1197     int __pshared) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1198
1199
1200
1201extern int pthread_condattr_getclock (__const pthread_condattr_t *
1202          __restrict __attr,
1203          __clockid_t *__restrict __clock_id)
1204     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1205
1206
1207extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
1208          __clockid_t __clock_id)
1209     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1210# 1028 "/usr/include/pthread.h" 3 4
1211extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
1212     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1213
1214
1215extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
1216     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1217
1218
1219extern int pthread_spin_lock (pthread_spinlock_t *__lock)
1220     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1221
1222
1223extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
1224     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1225
1226
1227extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
1228     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1229
1230
1231
1232
1233
1234
1235extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
1236     __const pthread_barrierattr_t *__restrict
1237     __attr, unsigned int __count)
1238     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1239
1240
1241extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
1242     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1243
1244
1245extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
1246     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1247
1248
1249
1250extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
1251     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1252
1253
1254extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
1255     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1256
1257
1258extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
1259        __restrict __attr,
1260        int *__restrict __pshared)
1261     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1262
1263
1264extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
1265        int __pshared)
1266     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1267# 1095 "/usr/include/pthread.h" 3 4
1268extern int pthread_key_create (pthread_key_t *__key,
1269          void (*__destr_function) (void *))
1270     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1271
1272
1273extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__));
1274
1275
1276extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__));
1277
1278
1279extern int pthread_setspecific (pthread_key_t __key,
1280    __const void *__pointer) __attribute__ ((__nothrow__)) ;
1281
1282
1283
1284
1285extern int pthread_getcpuclockid (pthread_t __thread_id,
1286      __clockid_t *__clock_id)
1287     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1288# 1129 "/usr/include/pthread.h" 3 4
1289extern int pthread_atfork (void (*__prepare) (void),
1290      void (*__parent) (void),
1291      void (*__child) (void)) __attribute__ ((__nothrow__));
1292# 1143 "/usr/include/pthread.h" 3 4
1293
1294# 2 "stack_BUG.c" 2
1295# 1 "/usr/include/stdio.h" 1 3 4
1296# 30 "/usr/include/stdio.h" 3 4
1297
1298
1299
1300
1301# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1302# 35 "/usr/include/stdio.h" 2 3 4
1303# 45 "/usr/include/stdio.h" 3 4
1304struct _IO_FILE;
1305
1306
1307
1308typedef struct _IO_FILE FILE;
1309
1310
1311
1312
1313
1314# 65 "/usr/include/stdio.h" 3 4
1315typedef struct _IO_FILE __FILE;
1316# 75 "/usr/include/stdio.h" 3 4
1317# 1 "/usr/include/libio.h" 1 3 4
1318# 32 "/usr/include/libio.h" 3 4
1319# 1 "/usr/include/_G_config.h" 1 3 4
1320# 15 "/usr/include/_G_config.h" 3 4
1321# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1322# 16 "/usr/include/_G_config.h" 2 3 4
1323
1324
1325
1326
1327# 1 "/usr/include/wchar.h" 1 3 4
1328# 83 "/usr/include/wchar.h" 3 4
1329typedef struct
1330{
1331  int __count;
1332  union
1333  {
1334
1335    unsigned int __wch;
1336
1337
1338
1339    char __wchb[4];
1340  } __value;
1341} __mbstate_t;
1342# 21 "/usr/include/_G_config.h" 2 3 4
1343
1344typedef struct
1345{
1346  __off_t __pos;
1347  __mbstate_t __state;
1348} _G_fpos_t;
1349typedef struct
1350{
1351  __off64_t __pos;
1352  __mbstate_t __state;
1353} _G_fpos64_t;
1354# 53 "/usr/include/_G_config.h" 3 4
1355typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
1356typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
1357typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
1358typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
1359# 33 "/usr/include/libio.h" 2 3 4
1360# 53 "/usr/include/libio.h" 3 4
1361# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stdarg.h" 1 3 4
1362# 40 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stdarg.h" 3 4
1363typedef __builtin_va_list __gnuc_va_list;
1364# 54 "/usr/include/libio.h" 2 3 4
1365# 172 "/usr/include/libio.h" 3 4
1366struct _IO_jump_t; struct _IO_FILE;
1367# 182 "/usr/include/libio.h" 3 4
1368typedef void _IO_lock_t;
1369
1370
1371
1372
1373
1374struct _IO_marker {
1375  struct _IO_marker *_next;
1376  struct _IO_FILE *_sbuf;
1377
1378
1379
1380  int _pos;
1381# 205 "/usr/include/libio.h" 3 4
1382};
1383
1384
1385enum __codecvt_result
1386{
1387  __codecvt_ok,
1388  __codecvt_partial,
1389  __codecvt_error,
1390  __codecvt_noconv
1391};
1392# 273 "/usr/include/libio.h" 3 4
1393struct _IO_FILE {
1394  int _flags;
1395
1396
1397
1398
1399  char* _IO_read_ptr;
1400  char* _IO_read_end;
1401  char* _IO_read_base;
1402  char* _IO_write_base;
1403  char* _IO_write_ptr;
1404  char* _IO_write_end;
1405  char* _IO_buf_base;
1406  char* _IO_buf_end;
1407
1408  char *_IO_save_base;
1409  char *_IO_backup_base;
1410  char *_IO_save_end;
1411
1412  struct _IO_marker *_markers;
1413
1414  struct _IO_FILE *_chain;
1415
1416  int _fileno;
1417
1418
1419
1420  int _flags2;
1421
1422  __off_t _old_offset;
1423
1424
1425
1426  unsigned short _cur_column;
1427  signed char _vtable_offset;
1428  char _shortbuf[1];
1429
1430
1431
1432  _IO_lock_t *_lock;
1433# 321 "/usr/include/libio.h" 3 4
1434  __off64_t _offset;
1435# 330 "/usr/include/libio.h" 3 4
1436  void *__pad1;
1437  void *__pad2;
1438  void *__pad3;
1439  void *__pad4;
1440  size_t __pad5;
1441
1442  int _mode;
1443
1444  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
1445
1446};
1447
1448
1449typedef struct _IO_FILE _IO_FILE;
1450
1451
1452struct _IO_FILE_plus;
1453
1454extern struct _IO_FILE_plus _IO_2_1_stdin_;
1455extern struct _IO_FILE_plus _IO_2_1_stdout_;
1456extern struct _IO_FILE_plus _IO_2_1_stderr_;
1457# 366 "/usr/include/libio.h" 3 4
1458typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
1459
1460
1461
1462
1463
1464
1465
1466typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
1467     size_t __n);
1468
1469
1470
1471
1472
1473
1474
1475typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
1476
1477
1478typedef int __io_close_fn (void *__cookie);
1479# 418 "/usr/include/libio.h" 3 4
1480extern int __underflow (_IO_FILE *);
1481extern int __uflow (_IO_FILE *);
1482extern int __overflow (_IO_FILE *, int);
1483# 462 "/usr/include/libio.h" 3 4
1484extern int _IO_getc (_IO_FILE *__fp);
1485extern int _IO_putc (int __c, _IO_FILE *__fp);
1486extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
1487extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
1488
1489extern int _IO_peekc_locked (_IO_FILE *__fp);
1490
1491
1492
1493
1494
1495extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1496extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1497extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1498# 492 "/usr/include/libio.h" 3 4
1499extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
1500   __gnuc_va_list, int *__restrict);
1501extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
1502    __gnuc_va_list);
1503extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
1504extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
1505
1506extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
1507extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
1508
1509extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
1510# 76 "/usr/include/stdio.h" 2 3 4
1511
1512
1513
1514
1515typedef __gnuc_va_list va_list;
1516# 91 "/usr/include/stdio.h" 3 4
1517typedef __off_t off_t;
1518# 103 "/usr/include/stdio.h" 3 4
1519typedef __ssize_t ssize_t;
1520
1521
1522
1523
1524
1525
1526
1527typedef _G_fpos_t fpos_t;
1528
1529
1530
1531
1532# 165 "/usr/include/stdio.h" 3 4
1533# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
1534# 166 "/usr/include/stdio.h" 2 3 4
1535
1536
1537
1538extern struct _IO_FILE *stdin;
1539extern struct _IO_FILE *stdout;
1540extern struct _IO_FILE *stderr;
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
1551
1552extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
1553
1554
1555
1556
1557extern int renameat (int __oldfd, __const char *__old, int __newfd,
1558       __const char *__new) __attribute__ ((__nothrow__));
1559
1560
1561
1562
1563
1564
1565
1566
1567extern FILE *tmpfile (void) ;
1568# 212 "/usr/include/stdio.h" 3 4
1569extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;
1570
1571
1572
1573
1574
1575extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
1576# 230 "/usr/include/stdio.h" 3 4
1577extern char *tempnam (__const char *__dir, __const char *__pfx)
1578     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
1579
1580
1581
1582
1583
1584
1585
1586
1587extern int fclose (FILE *__stream);
1588
1589
1590
1591
1592extern int fflush (FILE *__stream);
1593
1594# 255 "/usr/include/stdio.h" 3 4
1595extern int fflush_unlocked (FILE *__stream);
1596# 269 "/usr/include/stdio.h" 3 4
1597
1598
1599
1600
1601
1602
1603extern FILE *fopen (__const char *__restrict __filename,
1604      __const char *__restrict __modes) ;
1605
1606
1607
1608
1609extern FILE *freopen (__const char *__restrict __filename,
1610        __const char *__restrict __modes,
1611        FILE *__restrict __stream) ;
1612# 298 "/usr/include/stdio.h" 3 4
1613
1614# 309 "/usr/include/stdio.h" 3 4
1615extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
1616# 322 "/usr/include/stdio.h" 3 4
1617extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
1618  __attribute__ ((__nothrow__)) ;
1619
1620
1621
1622
1623extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ;
1624
1625
1626
1627
1628
1629
1630extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
1631
1632
1633
1634extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
1635      int __modes, size_t __n) __attribute__ ((__nothrow__));
1636
1637
1638
1639
1640
1641extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
1642         size_t __size) __attribute__ ((__nothrow__));
1643
1644
1645extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
1646
1647
1648
1649
1650
1651
1652
1653
1654extern int fprintf (FILE *__restrict __stream,
1655      __const char *__restrict __format, ...);
1656
1657
1658
1659
1660extern int printf (__const char *__restrict __format, ...);
1661
1662extern int sprintf (char *__restrict __s,
1663      __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1664
1665
1666
1667
1668
1669extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
1670       __gnuc_va_list __arg);
1671
1672
1673
1674
1675extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
1676
1677extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
1678       __gnuc_va_list __arg) __attribute__ ((__nothrow__));
1679
1680
1681
1682
1683
1684extern int snprintf (char *__restrict __s, size_t __maxlen,
1685       __const char *__restrict __format, ...)
1686     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1687
1688extern int vsnprintf (char *__restrict __s, size_t __maxlen,
1689        __const char *__restrict __format, __gnuc_va_list __arg)
1690     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
1691
1692# 420 "/usr/include/stdio.h" 3 4
1693extern int vdprintf (int __fd, __const char *__restrict __fmt,
1694       __gnuc_va_list __arg)
1695     __attribute__ ((__format__ (__printf__, 2, 0)));
1696extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
1697     __attribute__ ((__format__ (__printf__, 2, 3)));
1698
1699
1700
1701
1702
1703
1704
1705
1706extern int fscanf (FILE *__restrict __stream,
1707     __const char *__restrict __format, ...) ;
1708
1709
1710
1711
1712extern int scanf (__const char *__restrict __format, ...) ;
1713
1714extern int sscanf (__const char *__restrict __s,
1715     __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1716# 451 "/usr/include/stdio.h" 3 4
1717extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
1718
1719                               ;
1720extern int scanf (__const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
1721                              ;
1722extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__))
1723
1724                      ;
1725# 471 "/usr/include/stdio.h" 3 4
1726
1727
1728
1729
1730
1731
1732
1733
1734extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
1735      __gnuc_va_list __arg)
1736     __attribute__ ((__format__ (__scanf__, 2, 0))) ;
1737
1738
1739
1740
1741
1742extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
1743     __attribute__ ((__format__ (__scanf__, 1, 0))) ;
1744
1745
1746extern int vsscanf (__const char *__restrict __s,
1747      __const char *__restrict __format, __gnuc_va_list __arg)
1748     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
1749# 502 "/usr/include/stdio.h" 3 4
1750extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
1751
1752
1753
1754     __attribute__ ((__format__ (__scanf__, 2, 0))) ;
1755extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
1756
1757     __attribute__ ((__format__ (__scanf__, 1, 0))) ;
1758extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__))
1759
1760
1761
1762     __attribute__ ((__format__ (__scanf__, 2, 0)));
1763# 530 "/usr/include/stdio.h" 3 4
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773extern int fgetc (FILE *__stream);
1774extern int getc (FILE *__stream);
1775
1776
1777
1778
1779
1780extern int getchar (void);
1781
1782# 558 "/usr/include/stdio.h" 3 4
1783extern int getc_unlocked (FILE *__stream);
1784extern int getchar_unlocked (void);
1785# 569 "/usr/include/stdio.h" 3 4
1786extern int fgetc_unlocked (FILE *__stream);
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798extern int fputc (int __c, FILE *__stream);
1799extern int putc (int __c, FILE *__stream);
1800
1801
1802
1803
1804
1805extern int putchar (int __c);
1806
1807# 602 "/usr/include/stdio.h" 3 4
1808extern int fputc_unlocked (int __c, FILE *__stream);
1809
1810
1811
1812
1813
1814
1815
1816extern int putc_unlocked (int __c, FILE *__stream);
1817extern int putchar_unlocked (int __c);
1818
1819
1820
1821
1822
1823
1824extern int getw (FILE *__stream);
1825
1826
1827extern int putw (int __w, FILE *__stream);
1828
1829
1830
1831
1832
1833
1834
1835
1836extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
1837     ;
1838
1839
1840
1841
1842
1843
1844extern char *gets (char *__s) ;
1845
1846# 664 "/usr/include/stdio.h" 3 4
1847extern __ssize_t __getdelim (char **__restrict __lineptr,
1848          size_t *__restrict __n, int __delimiter,
1849          FILE *__restrict __stream) ;
1850extern __ssize_t getdelim (char **__restrict __lineptr,
1851        size_t *__restrict __n, int __delimiter,
1852        FILE *__restrict __stream) ;
1853
1854
1855
1856
1857
1858
1859
1860extern __ssize_t getline (char **__restrict __lineptr,
1861       size_t *__restrict __n,
1862       FILE *__restrict __stream) ;
1863
1864
1865
1866
1867
1868
1869
1870
1871extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
1872
1873
1874
1875
1876
1877extern int puts (__const char *__s);
1878
1879
1880
1881
1882
1883
1884extern int ungetc (int __c, FILE *__stream);
1885
1886
1887
1888
1889
1890
1891extern size_t fread (void *__restrict __ptr, size_t __size,
1892       size_t __n, FILE *__restrict __stream) ;
1893
1894
1895
1896
1897extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
1898        size_t __n, FILE *__restrict __s) ;
1899
1900# 736 "/usr/include/stdio.h" 3 4
1901extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
1902         size_t __n, FILE *__restrict __stream) ;
1903extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
1904          size_t __n, FILE *__restrict __stream) ;
1905
1906
1907
1908
1909
1910
1911
1912
1913extern int fseek (FILE *__stream, long int __off, int __whence);
1914
1915
1916
1917
1918extern long int ftell (FILE *__stream) ;
1919
1920
1921
1922
1923extern void rewind (FILE *__stream);
1924
1925# 772 "/usr/include/stdio.h" 3 4
1926extern int fseeko (FILE *__stream, __off_t __off, int __whence);
1927
1928
1929
1930
1931extern __off_t ftello (FILE *__stream) ;
1932# 791 "/usr/include/stdio.h" 3 4
1933
1934
1935
1936
1937
1938
1939extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
1940
1941
1942
1943
1944extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
1945# 814 "/usr/include/stdio.h" 3 4
1946
1947# 823 "/usr/include/stdio.h" 3 4
1948
1949
1950extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
1951
1952extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
1953
1954extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
1955
1956
1957
1958
1959extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1960extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1961extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1962
1963
1964
1965
1966
1967
1968
1969
1970extern void perror (__const char *__s);
1971
1972
1973
1974
1975
1976
1977# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
1978# 27 "/usr/include/bits/sys_errlist.h" 3 4
1979extern int sys_nerr;
1980extern __const char *__const sys_errlist[];
1981# 853 "/usr/include/stdio.h" 2 3 4
1982
1983
1984
1985
1986extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
1987
1988
1989
1990
1991extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1992# 872 "/usr/include/stdio.h" 3 4
1993extern FILE *popen (__const char *__command, __const char *__modes) ;
1994
1995
1996
1997
1998
1999extern int pclose (FILE *__stream);
2000
2001
2002
2003
2004
2005extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
2006# 912 "/usr/include/stdio.h" 3 4
2007extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
2008
2009
2010
2011extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
2012
2013
2014extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
2015# 942 "/usr/include/stdio.h" 3 4
2016
2017# 3 "stack_BUG.c" 2
2018
2019
2020
2021
2022
2023
2024
2025unsigned int __VERIFIER_nondet_uint();
2026static int top=0;
2027static unsigned int arr[(5)];
2028pthread_mutex_t m;
2029_Bool flag=(0);
2030
2031void error(void)
2032{
2033  ERROR: ;
2034  goto ERROR;
2035  return;
2036}
2037
2038void inc_top(void)
2039{
2040  top++;
2041}
2042
2043void dec_top(void)
2044{
2045  top--;
2046}
2047
2048int get_top(void)
2049{
2050  return top;
2051}
2052
2053int stack_empty(void)
2054{
2055  (top==0) ? (1) : (0);
2056}
2057
2058int push(unsigned int *stack, int x)
2059{
2060  if (top==(5))
2061  {
2062    printf("stack overflow\n");
2063    return (-1);
2064  }
2065  else
2066  {
2067    stack[get_top()] = x;
2068    inc_top();
2069  }
2070  return 0;
2071}
2072
2073int pop(unsigned int *stack)
2074{
2075  if (get_top()==0)
2076  {
2077    printf("stack underflow\n");
2078    return (-2);
2079  }
2080  else
2081  {
2082    dec_top();
2083    return stack[get_top()];
2084  }
2085  return 0;
2086}
2087
2088void *t1(void *arg)
2089{
2090  int i;
2091  unsigned int tmp;
2092
2093  for(i=0; i<(5); i++)
2094  {
2095    pthread_mutex_lock(&m);
2096    tmp = __VERIFIER_nondet_uint()%(5);
2097    if (push(arr,tmp)==(-1))
2098      error();
2099    flag=(1);
2100    pthread_mutex_unlock(&m);
2101  }
2102}
2103
2104void *t2(void *arg)
2105{
2106  int i;
2107
2108  for(i=0; i<(5); i++)
2109  {
2110    pthread_mutex_lock(&m);
2111    if (flag)
2112    {
2113      if (!(pop(arr)!=(-2)))
2114        error();
2115    }
2116    pthread_mutex_unlock(&m);
2117  }
2118}
2119
2120
2121int main(void)
2122{
2123  pthread_t id1, id2;
2124
2125  pthread_mutex_init(&m, 0);
2126
2127  pthread_create(&id1, ((void *)0), t1, ((void *)0));
2128  pthread_create(&id2, ((void *)0), t2, ((void *)0));
2129
2130  pthread_join(id1, ((void *)0));
2131  pthread_join(id2, ((void *)0));
2132
2133  return 0;
2134}