Discussion:
seg fault error and some debug info
(too old to reply)
Brad H.
2011-07-22 06:15:42 UTC
Permalink
For every program that I try to run it misses on an address that is not
in any segment and so I get a seg fault. I can't figure this out at all.
Any guesses?

p testbin/argtest 3 4

faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loading
0x34000 == 0x34000

faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000

faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000

faultaddress: 0x4000b0
segment1
p: 0x35000 v:0x400000 loading
0x35000 == 0x35000

faultaddress: 0x401000
0x401000 is not between
( 0x400000, 0x401000 )
( 0x440000, 0x441000 )
( 0x7fff4000, 0x80000000 )
Fatal user mode trap 2 (TLB miss on load, epc 0x400ff8, vaddr 0x401000)
cs350
2011-07-22 07:09:19 UTC
Permalink
According to your example you are expecting argtest to have one page of
code starting at 0x40... and and one page starting at 0x440... . This
seems wrong because the text segment should be contiguous.

If my arithmetic is correct, 0x401000 should be the beginning of the
second page of the text segment.



-Alex
For every program that I try to run it misses on an address that is not in
any segment and so I get a seg fault. I can't figure this out at all. Any
guesses?
p testbin/argtest 3 4
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loading
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x4000b0
segment1
p: 0x35000 v:0x400000 loading
0x35000 == 0x35000
faultaddress: 0x401000
0x401000 is not between
( 0x400000, 0x401000 )
( 0x440000, 0x441000 )
( 0x7fff4000, 0x80000000 )
Fatal user mode trap 2 (TLB miss on load, epc 0x400ff8, vaddr 0x401000)
Brad H.
2011-07-22 16:03:46 UTC
Permalink
Post by cs350
( vbase1 = 0x400000, vtop1 = 0x401000 ) text segment boundaries
( vbase2 = 0x440000, vtop2 = 0x441000 ) data segment boundaries
( stackbase = 0x7fff4000, stacktop = 0x80000000 ) stack segment
boundaries

the text segment is contiguous but it is only one page in length
Post by cs350
According to your example you are expecting argtest to have one page of
code starting at 0x40... and and one page starting at 0x440... . This
seems wrong because the text segment should be contiguous.
If my arithmetic is correct, 0x401000 should be the beginning of the
second page of the text segment.
-Alex
For every program that I try to run it misses on an address that is
not in any segment and so I get a seg fault. I can't figure this out
at all. Any guesses?
p testbin/argtest 3 4
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loading
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x4000b0
segment1
p: 0x35000 v:0x400000 loading
0x35000 == 0x35000
faultaddress: 0x401000
0x401000 is not between
( 0x400000, 0x401000 )
( 0x440000, 0x441000 )
( 0x7fff4000, 0x80000000 )
Fatal user mode trap 2 (TLB miss on load, epc 0x400ff8, vaddr 0x401000)
cs350
2011-07-22 18:13:04 UTC
Permalink
Well, then you need to double check your segment boundaries, because if
testbin/add is faulting on 0x401000 it should be a valid address.

-Alex
Post by Brad H.
Post by cs350
( vbase1 = 0x400000, vtop1 = 0x401000 ) text segment boundaries
( vbase2 = 0x440000, vtop2 = 0x441000 ) data segment boundaries
( stackbase = 0x7fff4000, stacktop = 0x80000000 ) stack segment boundaries
the text segment is contiguous but it is only one page in length
Post by cs350
According to your example you are expecting argtest to have one page of
code starting at 0x40... and and one page starting at 0x440... . This
seems wrong because the text segment should be contiguous.
If my arithmetic is correct, 0x401000 should be the beginning of the
second page of the text segment.
-Alex
For every program that I try to run it misses on an address that is
not in any segment and so I get a seg fault. I can't figure this out
at all. Any guesses?
p testbin/argtest 3 4
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loading
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x4000b0
segment1
p: 0x35000 v:0x400000 loading
0x35000 == 0x35000
faultaddress: 0x401000
0x401000 is not between
( 0x400000, 0x401000 )
( 0x440000, 0x441000 )
( 0x7fff4000, 0x80000000 )
Fatal user mode trap 2 (TLB miss on load, epc 0x400ff8, vaddr 0x401000)
Brad H.
2011-07-22 19:09:14 UTC
Permalink
I wasn't testing on add, I was testing on argtest which doesn't have a
valid address of 0x401000. I haven't changed the way that boundaries are
set up. also if i allow the boundaries to be more then it loads from
0x401000 and then looks for 0x402000 and so on. I'm so confused.
Post by cs350
Well, then you need to double check your segment boundaries, because if
testbin/add is faulting on 0x401000 it should be a valid address.
-Alex
Post by Brad H.
Post by cs350
( vbase1 = 0x400000, vtop1 = 0x401000 ) text segment boundaries
( vbase2 = 0x440000, vtop2 = 0x441000 ) data segment boundaries
( stackbase = 0x7fff4000, stacktop = 0x80000000 ) stack segment boundaries
the text segment is contiguous but it is only one page in length
Post by cs350
According to your example you are expecting argtest to have one page of
code starting at 0x40... and and one page starting at 0x440... . This
seems wrong because the text segment should be contiguous.
If my arithmetic is correct, 0x401000 should be the beginning of the
second page of the text segment.
-Alex
For every program that I try to run it misses on an address that is
not in any segment and so I get a seg fault. I can't figure this out
at all. Any guesses?
p testbin/argtest 3 4
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loading
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x4000b0
segment1
p: 0x35000 v:0x400000 loading
0x35000 == 0x35000
faultaddress: 0x401000
0x401000 is not between
( 0x400000, 0x401000 )
( 0x440000, 0x441000 )
( 0x7fff4000, 0x80000000 )
Fatal user mode trap 2 (TLB miss on load, epc 0x400ff8, vaddr 0x401000)
cs350
2011-07-22 23:35:50 UTC
Permalink
Is the program entering into a loop of faulting on the beginning of a
consecutive set of pages? If you are sure that your segment boundaries are
correct, then all of those pages are invalid. So, you need to determine
why these addresses are showing up in vm_fault.

-Alex
I wasn't testing on add, I was testing on argtest which doesn't have a valid
address of 0x401000. I haven't changed the way that boundaries are set up.
also if i allow the boundaries to be more then it loads from 0x401000 and
then looks for 0x402000 and so on. I'm so confused.
Post by cs350
Well, then you need to double check your segment boundaries, because if
testbin/add is faulting on 0x401000 it should be a valid address.
-Alex
Post by Brad H.
Post by cs350
( vbase1 = 0x400000, vtop1 = 0x401000 ) text segment boundaries
( vbase2 = 0x440000, vtop2 = 0x441000 ) data segment boundaries
( stackbase = 0x7fff4000, stacktop = 0x80000000 ) stack segment boundaries
the text segment is contiguous but it is only one page in length
Post by cs350
According to your example you are expecting argtest to have one page of
code starting at 0x40... and and one page starting at 0x440... . This
seems wrong because the text segment should be contiguous.
If my arithmetic is correct, 0x401000 should be the beginning of the
second page of the text segment.
-Alex
For every program that I try to run it misses on an address that is
not in any segment and so I get a seg fault. I can't figure this out
at all. Any guesses?
p testbin/argtest 3 4
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loading
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x7fffffb0
stack
p: 0x34000 v:0x7ffff000 loaded
0x34000 == 0x34000
faultaddress: 0x4000b0
segment1
p: 0x35000 v:0x400000 loading
0x35000 == 0x35000
faultaddress: 0x401000
0x401000 is not between
( 0x400000, 0x401000 )
( 0x440000, 0x441000 )
( 0x7fff4000, 0x80000000 )
Fatal user mode trap 2 (TLB miss on load, epc 0x400ff8, vaddr 0x401000)
Loading...