Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to debug a VxWorks Page Fault

2,372 views
Skip to first unread message

Manie Steyn

unread,
Jul 30, 1999, 3:00:00 AM7/30/99
to
Hi,

I am using VxWorks 5.3.1 for a PC486 target. (actually a 200MHz Pentium
processor)
I have difficulty with interpreting the information provided when a Page
Fault occurs.

When the Page fault occurs in one of my tasks, I get the following
information printed on the console:

->
Page Fault
Program Counter: 0x0042ee21
Status Register: 0x00010297
Error Code: 0x00000002
Task: 0x1fdd230 "mpc_intr_task"
->

After this the "mpc_intr_task" is in the suspended state.

To find out where the Page fault occurred, I looked at where the Program
counter is pointing to as follows:

-> lkAddr 0x0042ee21
0x0042ed80 _somddevflag data
0x0042eef4 _mafuinfo data
0x0042ef04 _mafudevflag data
0x0042f00c _xtp_opt_arr data
0x0042f46c _xtp_opt_arr_len data
0x0042f470 _xtc_param_arr data
0x0042f570 _xtaf_tbl data
0x0042f634 _xtc_g_data_pkt_out data
0x0042f638 _xtc_g_data_byt_out data
0x0042f63c _xtc_g_rxmt_pkt_out data
0x0042f640 _xtc_g_rxmt_byt_out data
0x0042f644 _xtc_g_cntl_pkt_out data
value = 0 = 0x0

It looks like the Program Counter points to the data segment. I have made
the stack of this task large to rule out the possibility of stack
corruption by an ISR.
After the page fault checkStack() report this task as:

NAME ENTRY TID SIZE CUR HIGH MARGIN
------------ ------------ -------- ----- ----- ----- ------
tExcTask _excTask 1fe3e9c 7988 144 472 7516
tLogTask _logTask 1fe1584 4988 148 876 4112
tEvtTask _tEvtTask 1bdd818 6988 60 292 6696
mpc_intr_tas _mpc_intr_ta 1fdd230 39984 164 1132 38852
...

Questions:
1. What is the most likely scenario that could cause this to happen?

2. What is the meaning of the Status Register value 0x00010297?

3. What condition is indicated by Error Code 0x00000002?

4. Why don't I see a dump of the stack when the Page Fault happens?

5. Is it possible to do a stack trace on the suspended task without using
CrossWind? I do not have a network to connect the development tools when
the problen occurs.

Regards


-------------------------------------------------------------------
Manie Steyn mailto:mst...@ccii.co.za Ph: +27 (0)21 683 5490
Project Leader http://www.ccii.co.za Fax: +27 (0)21 683 5435
CCII Systems (Pty) LTD, Cape Town, SA Cell: +27 (0)82 894 6877
-------------------------------------------------------------------

Vicente Mendez

unread,
Aug 22, 1999, 3:00:00 AM8/22/99
to
You can do a stack dump by doing:

tt 0x1fdd230

where the hex number is the task id. A page fault means you are writing to
memory that is not yours, in other words, check your pointers. If you want to
see what the error is, you can get a little more human readable form by
typing

-> printErrno 0x00000002
S_errno_ENOENT
value = 15 = 0xf
->

I believe you can look these up in some header file.

Hope this helps

Vicente

0 new messages