QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
My QNX4.0 programs are SIGSEGVing when run on my QNX4.1 system.x09x09x09x09x09x09x09 |
Ref. No. |
QNX.000009327 |
Category(ies) |
Development, Configuration |
Issue |
We've just upgraded from QNX4.0 to QNX4.1 and are being plagued by a rash of SIGSEGVs on programs that were compiled and ran fine under 4.0. What's going on?
|
Solution |
The cause and solution to the problem could very well be the privity level of the processes in question.
QNX4.0 doesn't support the concept of privity levels. Every process runs with full privity; i.e. the privity field of any executable produced by the Watcom C compiler was set to 0.
But QNX4.1 does support privity levels. Processes compiled with a privity level of 1 can access hardware ports directly, overlay and use hardware-mapped RAM, and perform an array of restricted operations. Processes with privity level 3 can do none of the above; if they try, they are terminated with a segment violation (SIGSEGV). Processes with privity level 0 run with a privity level that matches that of the user invoking the process. In other words, if root runs a privity-0 process, it would run with privity 1; if "joe user" runs a privity-0 process, it would run with privity 3. Note that privity level 2 is reserved.
Under 4.1, the Watcom compiler generates executables with privity level 3 as the default. If these processes try to perform any restricted operations, they will SIGSEGV. If your program requires special privity, recompile the program with the appropriate -T setting (using cc).
To compile with privity levels use: privity 0x09cc -T 0 myprog.c -o myprog privity 1x09cc -T 1 myprog.c -o myprog privity 3x09cc myprog.c -o myprog
|
|