Bug 103931 - system call issue - Error : sigsuspend doesn't return from block stage in the case of SIGINT signal
Summary: system call issue - Error : sigsuspend doesn't return from block stage in the...
Status: NEW
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: other_other
URL:
Keywords:
: 103921 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-01 22:43 UTC by abhishek
Modified: 2018-03-25 17:49 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.7.10-1.45-desktop
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description abhishek 2015-09-01 22:43:55 UTC
void sig_handler1(int signo)
{
        printf("I am in SIGINT handler ......\n");
}



void *thread_func1(void *arg)
{
sigset_t s1;
struct sigaction act1;

        printf("I m in 1 thread...pid=%lu....ppid=%lu..\n",getpid(),getppid());
        sigfillset(&s1);
        sigdelset(&s1,SIGINT);    // in case of other Signal , working fine
        pthread_sigmask(SIG_SETMASK,&s1,0);


        printf("before suspend t1 \n");
        sigsuspend(&s1);                // only one signal
        printf("After suspend t1 \n");  // ERROR ---- not coming here

        printf("exit from t1 \n");
        pthread_exit(NULL);
}


int main()
{

        sigfillset(&s1);
        sigdelset(&s1,SIGINT);
        sigprocmask(SIG_SETMASK,&s1,NULL);

        sigfillset(&act1.sa_mask);
        act1.sa_flags=0;
        act1.sa_handler=sig_handler1;
        sigaction(SIGINT,&act1,NULL);
        -----
        ------   
        -------


        pthread_attr_init(&tha1);
        pthread_attr_setschedpolicy(&tha1,SCHED_FIFO);
        p1.sched_priority=10;
        pthread_attr_setschedparam(&tha1,&p1);

        ret1=pthread_create(&tid[0],&tha1,thread_func1,NULL);
        if(ret1>0){printf("error  is %s",strerror(ret1));exit(1);}
        printf("thread1 created......\n");
        -----
        ------   
        -------

        sigsuspend(&s1);
        printf("111111111111111111 \n");
        sigsuspend(&s1);
        printf("2222222222222222\n");
        sigsuspend(&s1);
        printf("333333333333333333\n");

        pthread_join(tid[0],NULL);
        pthread_join(tid[1],NULL);
        pthread_join(tid[2],NULL);
        pthread_join(tid[3],NULL);
    
}




OS - opensuse12.1
uname o/p- ->   3.7.10-1.45-desktop #1 SMP PREEMPT Tue Dec 16 20:27:58 UTC 2014 (4c885a1) x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Randy Dunlap 2018-03-25 17:49:20 UTC
*** Bug 103921 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.