Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-12-2005, 10:39 PM   #1
Registered: Feb 2005
Posts: 91

Rep: Reputation: 15
unhandled page fault from assembler code


My application gives me unhandled page fault after it runs in long time. My processor is arm920t. The failed pc is 0x00226d8 which is assembler:
ldr r1 [r2]
But the r2's value is 0x00000000. My source code is in cpp. The assembler statement is nor directly from my code. Actually the function, which contains the assembler code, runs ok. I mean all assemebler code directly from my cpp code runs fine. Between my code and the return statement, there are some cleaning works for this function which is added by the cpp compiler. The failed assembler code is among them.

My questions is where I can find the information about that piece assembler code. How does arm-gcc compiler compose a function for cpp?

Old 09-13-2005, 04:26 PM   #2
Registered: May 2002
Location: dracut MA
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 109Reputation: 109
ldr r1 [r2]
If the value of r2 is 0, then I expect this should always fail. The reason is that when you see a memory location inside those braces, it
is a dereference. This statement means to load r1 into the memory pointed to by r2. However, the memory pointed to by location
0x00000000 is usually some garbage value. Hence, you get your crash/exception/fault.
Old 09-14-2005, 03:29 PM   #3
Registered: Feb 2005
Posts: 91

Original Poster
Rep: Reputation: 15

The following code is the arm assembly code.

   236d8:	e3e03d7d 	mvn	r3, #8000	; 0x1f40
   236dc:	e243302b 	sub	r3, r3, #43	; 0x2b
   236e0:	e24b1018 	sub	r1, fp, #24	; 0x18
   236e4:	e7916003 	ldr	r6, [r1, r3]
   236e8:	e2853004 	add	r3, r5, #4	; 0x4
   236ec:	e5932000 	ldr	r2, [r3]
   236f0:	e2823004 	add	r3, r2, #4	; 0x4
   236f4:	e5932000 	ldr	r2, [r3]
   236f8:	e5921000 	ldr	r1, [r2]
The 204 line in rpmConnect.cpp is
return rc;
The assembly code is grenerated by cpp compiler to restore stack/environment back. I need to know what are they doing and what could cause the problem. Thanks.

The following is the error messages in /proc/kmsg
<7>fw: unhandled page fault at pc=0x000236f8, lr=0x40026fc0 (bad address=0x00000
000, code 7)
<4>pc : [<000236f8>] lr : [<40026fc0>] Not tainted
<4>sp : bf3fddac ip : bf3fdcd0 fp : bf3ffd2c
<4>r10: 400369f4 r9 : 0001c53c r8 : 00000c04
<4>r7 : 00000080 r6 : 00000000 r5 : 0004f518 r4 : 0003e888
<4>r3 : bf1ff9a0 r2 : 00000000 r1 : 00000000 r0 : 00000000
<4>Flags: nZCv IRQs on FIQs on Mode USER_32 Segment user
<4>Control: C000317F Table: 27724000 DAC: 00000015


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to redirect PHP code to another page bahadur Programming 3 03-21-2005 06:59 AM
dpkg returned an error code (1) Segmentation fault questionman Debian 6 11-02-2004 01:04 AM
segmentation fault in following peice of code :please help linorg Programming 2 03-18-2004 09:57 PM
Page Fault in Nonpaged Area XPediTioN Slackware 0 09-30-2003 08:57 AM
RedHat 8.0 ---> W2k - Page Fault Abrid Linux - Newbie 1 09-18-2003 11:34 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration