[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decladebug

Title:Digital Ladebug debugger
Moderator:TLE::LUCIA
Created:Fri Feb 28 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:969
Total number of notes:3959

852.0. "Decladebug and librt and Signals" by RHETT::HALETKY () Wed Feb 26 1997 11:28

    Hello,
    
    We have a cusotmer that has the following code, when debugging
    decladebug traps a segv that does not occur when running the program
    outside the debugger. Ignoring signals does not work. Any suggestions?
    
    #include <signal.h>
    #include <time.h>
    
    timer_t timer_id;
    struct itimerspec remtim;
    
    static struct sigaction old_action, action;
    static sigset_t sigmask, old_sigmask;
    
    static void setimr_alarm (int signal);
    
    main()
    {
        struct  itimerspec  waketim, otime;
            int i;
    
        sigemptyset( &sigmask );
        sigaddset( &sigmask, SIGALRM );
    
        action.sa_handler = setimr_alarm;
        sigemptyset( &action.sa_mask );
        sigaddset( &action.sa_mask, SIGALRM );
    
        action.sa_flags = 0;
    
        sigaction( SIGALRM, &action, &old_action );
    
        sigprocmask( SIG_BLOCK, &sigmask, &old_sigmask );
    
        if (timer_create( TIMEOFDAY, (struct sigevent *)0, &timer_id)) {
                printf("timer_create: failed\n");
            exit(1);
        }
    
        memset( &waketim, 0, sizeof(waketim));
    
        waketim.it_value.tv_nsec = 250000000;
    
        if (timer_settime( timer_id, 0, &waketim, 0)){
                printf("timer_settime: failed\n");
            exit(1);
        }
    
        sigprocmask( SIG_UNBLOCK, &sigmask, NULL );
        timer_gettime (timer_id, &remtim);
    
            sleep(1);
        printf("done!\n");
    }
    
    static void setimr_alarm (int signal)
    {
    
            printf("setimr_alarm: remtim = %d\n", remtim.it_value.tv_nsec);
        timer_gettime (timer_id, &remtim);
            printf("setimr_alarm: remtim = %d\n", remtim.it_value.tv_nsec);
    }
    
    
    compilation is done with:
    	cc -g file.c -o file -lrt
    
    Best regards,
    Ed Haletky
    Digital CSC
T.RTitleUserPersonal
Name
DateLines
852.1TLE::MURRAYWanfang MurrayWed Feb 26 1997 15:024
Thanks for the problem report.  I will take a look at this.

Wanfang
852.2TLE::MURRAYWanfang MurrayFri Feb 28 1997 12:186

It's interesting.  I am able to reproduce this problem with both ladebug
and dbx on PTB system.  

Wanfang
852.3RT interference?RHETT::HALETKYMon Mar 03 1997 13:427
    This is good to read. I was curious as to what is happening. For now
    the customer can't use any debugger except print messages. :}
    
    Could it be the Real Time system getting in the way?
    
    -Ed Haletky
    Digital CSC
852.4TLE::MURRAYWanfang MurrayMon Mar 03 1997 14:238

Ladebug and dbx is tracing system calls like exec and fork.  However,
those system calls also mean something in the RT habitat.  Now, I am
in the middle instrumenting ladebug only care about these system calls
in the basic habitat context.   The fix is coming.

Wanfang