Question about PC exception - VxWorks

This is a discussion on Question about PC exception - VxWorks ; Hi All, Thanks for your time reading this post. I am debugging a program which has the following structure: void signal_handler (int signo) { msgQSend( msgQ, ... ); } void signalTask () { ... signal( SIGUSR1, signal_handler ); ... while( ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Question about PC exception

  1. Question about PC exception

    Hi All,

    Thanks for your time reading this post.

    I am debugging a program which has the following structure:

    void signal_handler (int signo) {
    msgQSend( msgQ, ... );
    }

    void signalTask () {
    ...
    signal( SIGUSR1, signal_handler );
    ...
    while( 1 ) {
    msgQReceive( msgQ, ... );
    ...
    }
    }

    void appTask () {
    while( 1 ) {
    ...
    if( some_condition )
    kill( signalTaskID, SIGUSR1 );
    }
    }

    The problem is, after running for a while (works fine during this
    period including the if condition is satisfied in the appTask),
    however some time later when the "some_condition" is met again and
    thus signal handles is triggered once more, PC value of the signal
    task will become zero or some other meaningless value after the signal
    handler exits, thus the signal task gets suspended.

    Can anyone give me some clue that why or any general situations the PC
    value can be changed abnormally like this? Thanks a lot!!!


  2. Re: Question about PC exception

    Some more error info that I got for this exception:

    Exception number 0: Task: 0x351980 (rSignalTest)

    Branch through zero
    Program Counter: 0
    Status Register: 0x20000013

    Thanks


  3. Re: Question about PC exception

    On Aug 11, 2:35 am, david wrote:
    > Some more error info that I got for this exception:
    >
    > Exception number 0: Task: 0x351980 (rSignalTest)
    >
    > Branch through zero
    > Program Counter: 0
    > Status Register: 0x20000013
    >
    > Thanks


    Hi David,
    Try installing the signal handler again before exiting
    from the signal handler.ie..
    void signal_handler (int signo) {
    msgQSend( msgQ, ... );
    signal( SIGUSR1, signal_handler );
    }

    cheers


+ Reply to Thread