Fault when sending signals on a mips-machine?

bridged with qdn.public.qnxrtp.mips
Post Reply
Johan Green-Petersen

Fault when sending signals on a mips-machine?

Post by Johan Green-Petersen » Thu May 16, 2002 5:01 pm

I have an application where one process sends a signal to another process,
using the SignalKill() function. The application has been built for x86 and
for mipsle. The application run as expected on the x86-machine, but not on
the mips-machine. The signal code si_code is wrong on the mips-machine. I
have made the following small application to illustrate the problem:

#include <stdio.h>
#include <signal.h>

int sig = 0;

/* Signal handler */
void handler(int signo, siginfo_t* info, void* other) {
printf("TEST5: signal signo %d, code %d, value %d\n",
info->si_signo, info->si_code, info->si_value.sival_int);
printf("TEST5: address signo %08x, code %08x, value %08x\n",
&info->si_signo, &info->si_code, &info->si_value.sival_int);
sig = 1;
}

int main(int argc, char **argv) {
int ch;

if ((ch = fork()) == 0) {
/* set own handler */
signal( SIGUSR1, handler );

while (sig == 0)
sleep(1);
} else {
sleep(2);
SignalKill( 0, ch, 0, SIGUSR1, (-100), 12345678);
}

return 0;
}

Output on the x86-machine:
TEST5: signal signo 16, code -100, value 12345678
TEST5: address signo 08047a08, code 08047a0c, value 08047a1c

Output on mipsle-machine:
TEST5: signal signo 16, code 134335424, value 12345678
TEST5: address signo 0801cbc0, code 0801cbc4, value 0801cbd4

(code = address signo)

What is wrong?

The mipsle-machine is a malta-board and the file used to create a boot image
is equal to /mipsle/boot/build/malta.build, except for including the
application file.

Thanks,
Johan

Post Reply

Return to “qdn.public.qnxrtp.mips”