Discussion:
[uClinux-dev] Segmentation fault while running some applications!
Arshan Awais
2012-12-04 05:32:44 UTC
Permalink
hi,
i m having an issue when i run iptables on AT91SAM9X in uClinux. I get
following messages when i run iptables command:

# iptables -v
pgd = c0474000
[ffff198c] *pgd=203f0031, *pte=00000000, *ppte=00000000

Pid: 372, comm: iptables
CPU: 0 Not tainted (2.6.30.4-uc0 #195)
PC is at 0x401446c4
LR is at 0x9ad0
pc : [<401446c4>] lr : [<00009ad0>] psr: 60000010
sp : bef16d50 ip : 401446c0 fp : 00000000
r10: 40025000 r9 : 00000000 r8 : 00000000
r7 : 00000002 r6 : bef16eb4 r5 : bef16f8f r4 : ffff198c
r3 : ffff198c r2 : 00000000 r1 : ffff198c r0 : ffff198c
Flags: nZCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
Control: 0005317f Table: 20474000 DAC: 00000015
[<c00282c4>] (show_regs+0x0/0x50) from [<c002cd64>] (__do_user_fault+0x5c/0xa4)
r5:ffff198c r4:c1c5b9c0
[<c002cd08>] (__do_user_fault+0x0/0xa4) from [<c002d020>]
(do_page_fault+0x1f8/0x230)
r7:c182a214 r6:c1c5b9c0 r5:000000o_Dat0026d40>] (ret_from_exception+0x0/0x10)
Exception sto 0xc12f5ff8)
5fa0: ffff198c ffff198c 00000000 ffff198c
5fc0: ffff198c bef16f8f bef16eb4 00000002 00000000 00000000 40025000 00000000
5fe0: 401446c0 bef16d50 00009ad0 401446c4 60000010 ffffffff
Segmentation fault

Kindly help me solving the issue...
Greg Ungerer
2012-12-11 01:51:35 UTC
Permalink
Hi Arshan,
Post by Arshan Awais
hi,
i m having an issue when i run iptables on AT91SAM9X in uClinux. I get
# iptables -v
pgd = c0474000
[ffff198c] *pgd=203f0031, *pte=00000000, *ppte=00000000
Pid: 372, comm: iptables
CPU: 0 Not tainted (2.6.30.4-uc0 #195)
PC is at 0x401446c4
You need to figure out where this address is.

Are you truly running with MMU disabled?
You will pretty easily be able to tell from your kernel .config.

Regards
Greg
Post by Arshan Awais
LR is at 0x9ad0
pc : [<401446c4>] lr : [<00009ad0>] psr: 60000010
sp : bef16d50 ip : 401446c0 fp : 00000000
r10: 40025000 r9 : 00000000 r8 : 00000000
r7 : 00000002 r6 : bef16eb4 r5 : bef16f8f r4 : ffff198c
r3 : ffff198c r2 : 00000000 r1 : ffff198c r0 : ffff198c
Flags: nZCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
Control: 0005317f Table: 20474000 DAC: 00000015
[<c00282c4>] (show_regs+0x0/0x50) from [<c002cd64>] (__do_user_fault+0x5c/0xa4)
r5:ffff198c r4:c1c5b9c0
[<c002cd08>] (__do_user_fault+0x0/0xa4) from [<c002d020>]
(do_page_fault+0x1f8/0x230)
r7:c182a214 r6:c1c5b9c0 r5:000000o_Dat0026d40>] (ret_from_exception+0x0/0x10)
Exception sto 0xc12f5ff8)
5fa0: ffff198c ffff198c 00000000 ffff198c
5fc0: ffff198c bef16f8f bef16eb4 00000002 00000000 00000000 40025000 00000000
5fe0: 401446c0 bef16d50 00009ad0 401446c4 60000010 ffffffff
Segmentation fault
Kindly help me solving the issue...
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/options/uclinux-dev
Arshan Awais
2012-12-12 09:01:04 UTC
Permalink
Thanks for reply Greg!

No, the MMU is enabled in the kernel configuration.

On Tue, Dec 11, 2012 at 6:51 AM, Greg Ungerer
Post by Greg Ungerer
Hi Arshan,
Post by Arshan Awais
hi,
i m having an issue when i run iptables on AT91SAM9X in uClinux. I get
# iptables -v
pgd = c0474000
[ffff198c] *pgd=203f0031, *pte=00000000, *ppte=00000000
Pid: 372, comm: iptables
CPU: 0 Not tainted (2.6.30.4-uc0 #195)
PC is at 0x401446c4
You need to figure out where this address is.
Are you truly running with MMU disabled?
You will pretty easily be able to tell from your kernel .config.
Regards
Greg
Post by Arshan Awais
LR is at 0x9ad0
pc : [<401446c4>] lr : [<00009ad0>] psr: 60000010
sp : bef16d50 ip : 401446c0 fp : 00000000
r10: 40025000 r9 : 00000000 r8 : 00000000
r7 : 00000002 r6 : bef16eb4 r5 : bef16f8f r4 : ffff198c
r3 : ffff198c r2 : 00000000 r1 : ffff198c r0 : ffff198c
Flags: nZCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
Control: 0005317f Table: 20474000 DAC: 00000015
[<c00282c4>] (show_regs+0x0/0x50) from [<c002cd64>]
(__do_user_fault+0x5c/0xa4)
r5:ffff198c r4:c1c5b9c0
[<c002cd08>] (__do_user_fault+0x0/0xa4) from [<c002d020>]
(do_page_fault+0x1f8/0x230)
r7:c182a214 r6:c1c5b9c0 r5:000000o_Dat0026d40>]
(ret_from_exception+0x0/0x10)
Exception sto 0xc12f5ff8)
5fa0: ffff198c ffff198c 00000000 ffff198c
5fc0: ffff198c bef16f8f bef16eb4 00000002 00000000 00000000 40025000 00000000
5fe0: 401446c0 bef16d50 00009ad0 401446c4 60000010 ffffffff
Segmentation fault
Kindly help me solving the issue...
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/options/uclinux-dev
Arshan Awais
2012-12-12 14:11:40 UTC
Permalink
I have tried to compile the kernel by disabling the MMU, but it gives
following errors during compilation:

In file included from arch/arm/mm/proc-arm926.S:36:
arch/arm/mm/proc-macros.S:81:2: error: #error PTE shared bit mismatch
arch/arm/mm/proc-macros.S:84:2: error: #error PTE bufferable bit mismatch
arch/arm/mm/proc-macros.S:87:2: error: #error PTE cacheable bit mismatch

I am a bit confused about disabling the MMU because AT91SAM9X has MMU
support...can u make me clear about that?
Post by Arshan Awais
Thanks for reply Greg!
No, the MMU is enabled in the kernel configuration.
On Tue, Dec 11, 2012 at 6:51 AM, Greg Ungerer
Post by Greg Ungerer
Hi Arshan,
Post by Arshan Awais
hi,
i m having an issue when i run iptables on AT91SAM9X in uClinux. I get
# iptables -v
pgd = c0474000
[ffff198c] *pgd=203f0031, *pte=00000000, *ppte=00000000
Pid: 372, comm: iptables
CPU: 0 Not tainted (2.6.30.4-uc0 #195)
PC is at 0x401446c4
You need to figure out where this address is.
Are you truly running with MMU disabled?
You will pretty easily be able to tell from your kernel .config.
Regards
Greg
Post by Arshan Awais
LR is at 0x9ad0
pc : [<401446c4>] lr : [<00009ad0>] psr: 60000010
sp : bef16d50 ip : 401446c0 fp : 00000000
r10: 40025000 r9 : 00000000 r8 : 00000000
r7 : 00000002 r6 : bef16eb4 r5 : bef16f8f r4 : ffff198c
r3 : ffff198c r2 : 00000000 r1 : ffff198c r0 : ffff198c
Flags: nZCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
Control: 0005317f Table: 20474000 DAC: 00000015
[<c00282c4>] (show_regs+0x0/0x50) from [<c002cd64>]
(__do_user_fault+0x5c/0xa4)
r5:ffff198c r4:c1c5b9c0
[<c002cd08>] (__do_user_fault+0x0/0xa4) from [<c002d020>]
(do_page_fault+0x1f8/0x230)
r7:c182a214 r6:c1c5b9c0 r5:000000o_Dat0026d40>]
(ret_from_exception+0x0/0x10)
Exception sto 0xc12f5ff8)
5fa0: ffff198c ffff198c 00000000 ffff198c
5fc0: ffff198c bef16f8f bef16eb4 00000002 00000000 00000000 40025000 00000000
5fe0: 401446c0 bef16d50 00009ad0 401446c4 60000010 ffffffff
Segmentation fault
Kindly help me solving the issue...
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2012-12-13 12:59:15 UTC
Permalink
Hi Arshan,
Post by Arshan Awais
I have tried to compile the kernel by disabling the MMU, but it gives
No, you don't want to do that. Having the MMU enabled is fine in
this case.

I would guess from your original dump that the code is most
likely executing code in uClibc (I assume that is what you are
using if you are building with the uClinux-dist).

Try this from the command line of your AT91SAM9X platform:

cat /proc/self/maps

I expect you will see something like:

00008000-00085000 r-xp 00000000 1f:02 1141 /bin/sh
0008d000-00092000 rw-p 0007d000 1f:02 1141 /bin/sh
00092000-0009e000 rwxp 00092000 00:00 0 [heap]
40000000-40005000 r-xp 00000000 1f:02 1286522 /lib/ld-uClibc-0.9.29.so
40005000-40006000 rw-p 40005000 00:00 0
4000c000-4000d000 r--p 00004000 1f:02 1286522 /lib/ld-uClibc-0.9.29.so
4000d000-4000e000 rw-p 00005000 1f:02 1286522 /lib/ld-uClibc-0.9.29.so
4000e000-4005b000 r-xp 00000000 1f:02 1287024 /lib/libuClibc-0.9.29.so
4005b000-40062000 ---p 4005b000 00:00 0
40062000-40063000 r--p 0004c000 1f:02 1287024 /lib/libuClibc-0.9.29.so
40063000-40064000 rw-p 0004d000 1f:02 1287024 /lib/libuClibc-0.9.29.so
40064000-40067000 rw-p 40064000 00:00 0
bedce000-bedd0000 rwxp beffe000 00:00 0 [stack]


Compare what you find with your dump addresses.

Regards
Greg
Post by Arshan Awais
arch/arm/mm/proc-macros.S:81:2: error: #error PTE shared bit mismatch
arch/arm/mm/proc-macros.S:84:2: error: #error PTE bufferable bit mismatch
arch/arm/mm/proc-macros.S:87:2: error: #error PTE cacheable bit mismatch
I am a bit confused about disabling the MMU because AT91SAM9X has MMU
support...can u make me clear about that?
Post by Arshan Awais
Thanks for reply Greg!
No, the MMU is enabled in the kernel configuration.
On Tue, Dec 11, 2012 at 6:51 AM, Greg Ungerer
Post by Greg Ungerer
Hi Arshan,
Post by Arshan Awais
hi,
i m having an issue when i run iptables on AT91SAM9X in uClinux. I get
# iptables -v
pgd = c0474000
[ffff198c] *pgd=203f0031, *pte=00000000, *ppte=00000000
Pid: 372, comm: iptables
CPU: 0 Not tainted (2.6.30.4-uc0 #195)
PC is at 0x401446c4
You need to figure out where this address is.
Are you truly running with MMU disabled?
You will pretty easily be able to tell from your kernel .config.
Regards
Greg
Post by Arshan Awais
LR is at 0x9ad0
pc : [<401446c4>] lr : [<00009ad0>] psr: 60000010
sp : bef16d50 ip : 401446c0 fp : 00000000
r10: 40025000 r9 : 00000000 r8 : 00000000
r7 : 00000002 r6 : bef16eb4 r5 : bef16f8f r4 : ffff198c
r3 : ffff198c r2 : 00000000 r1 : ffff198c r0 : ffff198c
Flags: nZCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
Control: 0005317f Table: 20474000 DAC: 00000015
[<c00282c4>] (show_regs+0x0/0x50) from [<c002cd64>]
(__do_user_fault+0x5c/0xa4)
r5:ffff198c r4:c1c5b9c0
[<c002cd08>] (__do_user_fault+0x0/0xa4) from [<c002d020>]
(do_page_fault+0x1f8/0x230)
r7:c182a214 r6:c1c5b9c0 r5:000000o_Dat0026d40>]
(ret_from_exception+0x0/0x10)
Exception sto 0xc12f5ff8)
5fa0: ffff198c ffff198c 00000000 ffff198c
5fc0: ffff198c bef16f8f bef16eb4 00000002 00000000 00000000 40025000 00000000
5fe0: 401446c0 bef16d50 00009ad0 401446c4 60000010 ffffffff
Segmentation fault
Kindly help me solving the issue...
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/options/uclinux-dev
Arshan Awais
2012-12-18 12:58:00 UTC
Permalink
Hi Greg,

I recompiled my kernel and used "None" option instead of uClibc,
uC-libc or glibc in menuconfig. (because i am also having issues in
compilation when i select options other than 'None' while library
selection)
This time when i ran iptables -v, i got the following dump:

iptables[377] killed because of sig - 11

STACK DUMP:

0xbec1dd50: 00029b74 00000000 00009d34 00000000 00000000 400e7ff0 401f8000

0xbec1dd6c: bec1deb4 00000002 00009ddc 00029b74 00000000 00009d34 00000000

0xbec1dd88: 00000000 00000000 40025000 00000000 bec1dd68 400e7fa8 ffff3b24

0xbec1dda4: 00000000 00000000 40025000 40025878 bec1de64 400256c0 00000000

0xbec1ddc0: 00000000 00000000 00000000 00000004 00000000 00000000 00000000

0xbec1dddc: 00000000 00000000 00000000 00000000 00000000 00000000 00000000

0xbec1ddf8: 00000000 00000000 00000000 00000000 00000000 00000000 400de5cc

0xbec1de14: 4001d8d8 00000000 0177ff8e 00000000 4001dbd0 4001e3d0 00008df4

0xbec1de30: 400256c0 40025000 00000000 4001df30 0003e998 4000de14 4001dbd0

0xbec1de4c: 00000001 00000001 00000000 400256c0 bec1dec0 00000000 400de5cc



Pid: 377, comm: iptables

CPU: 0 Not tainted (2.6.30.4-uc0 #190)

PC is at 0x401446c4

LR is at 0x9e08

pc : [<401446c4>] lr : [<00009e08>] psr: 60000010

sp : bec1dd50 ip : 401446c0 fp : 00000000

r10: 40025000 r9 : 00000000 r8 : 00000000

r7 : 00000002 r6 : bec1deb4 r5 : bec1df8d r4 : fffec998

r3 : fffec998 r2 : 00000000 r1 : fffec998 r0 : fffec998

Flags: nZCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user

Control: 0005317f T_coredump+0x168/0xb14)

r5:bec1de68 r4:0000000a

[<c008acc8>]oredump+0x0/0xb14) from [<c004b318>] (get_signa8)

[<c004b040>] (get_signal_ter+0x0/0x318al+0x0_notify_resume+0x30/0x34)

[<c0028a3c>] (do_notify_resume+0x0/from [<c0025e0c>] (work_pending+0x1c/0x20)

00000000 1f:05 286 /bin/iptables

0003d000-00041000 rwx0000-4001d000 r-xp 00000000 1f:05 118 /lib/ld-2.8.so

4001d000-4001f000 rwxp 4001d000 1f:05 118

40024000-40025000 r-xp 0001c000 1f:05 118 /lib/ld-2.8.so

40025000-40026000 rwxp 0001d000 1f:05 118 /lib/ld-2.8.so

40026000-400ca000 r-xp 00000000 1f:05 126 /lib/libm-2.8.so

400ca000-400d1000 ---p 000a4000 1f:05 126 /lib/libm-2.8.so

400d1000-400d2000 r-xp 000a3000 1f:05 126 /lib/libm-2.8.so

400d2000-400d3000 rwxp 000a4000 1f:05 126 /lib/libm-2.8.so

400d3000-401ee000 r-xp 00000000 1f:05 151 /lib/libc-2.8.so

401ee000-401f6000 ---p 0011b000 1f:05 151 /lib/libc-2.8.so

401f6000-401f8000 r-xp 0011b000 1f:05 151 /lib/libc-2.8.so

401f8000-401f9000 rwxp 0011d000 1f:05 151 /lib/libc-2.8.so

401f9000-401fc000 rwxp 401f9000 1f:05 151

bec1c000-bec1e000 rw-p beffe000 1f:05 151

Segmentation fault


Sorry for posting such long dumps, but i think thats how you can get
whole picture of the issue.

Thanks...
Post by Greg Ungerer
Hi Arshan,
Post by Arshan Awais
I have tried to compile the kernel by disabling the MMU, but it gives
No, you don't want to do that. Having the MMU enabled is fine in
this case.
I would guess from your original dump that the code is most
likely executing code in uClibc (I assume that is what you are
using if you are building with the uClinux-dist).
cat /proc/self/maps
00008000-00085000 r-xp 00000000 1f:02 1141 /bin/sh
0008d000-00092000 rw-p 0007d000 1f:02 1141 /bin/sh
00092000-0009e000 rwxp 00092000 00:00 0 [heap]
40000000-40005000 r-xp 00000000 1f:02 1286522 /lib/ld-uClibc-0.9.29.so
40005000-40006000 rw-p 40005000 00:00 0
4000c000-4000d000 r--p 00004000 1f:02 1286522 /lib/ld-uClibc-0.9.29.so
4000d000-4000e000 rw-p 00005000 1f:02 1286522 /lib/ld-uClibc-0.9.29.so
4000e000-4005b000 r-xp 00000000 1f:02 1287024 /lib/libuClibc-0.9.29.so
4005b000-40062000 ---p 4005b000 00:00 0
40062000-40063000 r--p 0004c000 1f:02 1287024 /lib/libuClibc-0.9.29.so
40063000-40064000 rw-p 0004d000 1f:02 1287024 /lib/libuClibc-0.9.29.so
40064000-40067000 rw-p 40064000 00:00 0
bedce000-bedd0000 rwxp beffe000 00:00 0 [stack]
Compare what you find with your dump addresses.
Regards
Greg
Post by Arshan Awais
arch/arm/mm/proc-macros.S:81:2: error: #error PTE shared bit mismatch
arch/arm/mm/proc-macros.S:84:2: error: #error PTE bufferable bit mismatch
arch/arm/mm/proc-macros.S:87:2: error: #error PTE cacheable bit mismatch
I am a bit confused about disabling the MMU because AT91SAM9X has MMU
support...can u make me clear about that?
Post by Arshan Awais
Thanks for reply Greg!
No, the MMU is enabled in the kernel configuration.
On Tue, Dec 11, 2012 at 6:51 AM, Greg Ungerer
Post by Greg Ungerer
Hi Arshan,
Post by Arshan Awais
hi,
i m having an issue when i run iptables on AT91SAM9X in uClinux. I get
# iptables -v
pgd = c0474000
[ffff198c] *pgd=203f0031, *pte=00000000, *ppte=00000000
Pid: 372, comm: iptables
CPU: 0 Not tainted (2.6.30.4-uc0 #195)
PC is at 0x401446c4
You need to figure out where this address is.
Are you truly running with MMU disabled?
You will pretty easily be able to tell from your kernel .config.
Regards
Greg
Post by Arshan Awais
LR is at 0x9ad0
pc : [<401446c4>] lr : [<00009ad0>] psr: 60000010
sp : bef16d50 ip : 401446c0 fp : 00000000
r10: 40025000 r9 : 00000000 r8 : 00000000
r7 : 00000002 r6 : bef16eb4 r5 : bef16f8f r4 : ffff198c
r3 : ffff198c r2 : 00000000 r1 : ffff198c r0 : ffff198c
Flags: nZCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
Control: 0005317f Table: 20474000 DAC: 00000015
[<c00282c4>] (show_regs+0x0/0x50) from [<c002cd64>]
(__do_user_fault+0x5c/0xa4)
r5:ffff198c r4:c1c5b9c0
[<c002cd08>] (__do_user_fault+0x0/0xa4) from [<c002d020>]
(do_page_fault+0x1f8/0x230)
r7:c182a214 r6:c1c5b9c0 r5:000000o_Dat0026d40>]
(ret_from_exception+0x0/0x10)
Exception sto 0xc12f5ff8)
5fa0: ffff198c ffff198c 00000000 ffff198c
5fc0: ffff198c bef16f8f bef16eb4 00000002 00000000 00000000 40025000 00000000
5fe0: 401446c0 bef16d50 00009ad0 401446c4 60000010 ffffffff
Segmentation fault
Kindly help me solving the issue...
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/options/uclinux-dev
Steve deRosier
2012-12-18 15:27:46 UTC
Permalink
Post by Arshan Awais
Hi Greg,
I recompiled my kernel and used "None" option instead of uClibc,
uC-libc or glibc in menuconfig. (because i am also having issues in
compilation when i select options other than 'None' while library
selection)
iptables[377] killed because of sig - 11
You sort of need a C library for any C code you're working with. I
suppose if you're hand-writing assembly code, you wouldn't need it,
but, last I looked iptables is C code and should require to link
against a C library of some sort. If you're getting successful
compilation and link and not building any of the three supported C
libraries, then you've got pretty big problems. Depending on your
environment, I see one of the following possibilities:

1. You're actually not building a cross-compiled image for your
target. In other words: you're building using your host's compilers
targeting your host computer. Then you're moving the exe to a
different target processor and boom!
2. Your x-compiler is linking against some of it's preconfigured C
libraries, if static, that's probably OK, but if it's a shared link,
you'll need to push those into your filesystem image.
3. Your compiler is linking against some left-over objects, but those
aren't getting inserted into your image because you've turned off the
C libs.
4. All is well with your environment, and you've edited some code and
inserted a read/write to an invalid address (most likely null) and you
need to debug that.

I'm sure there's more possibilities, but 4 seems like enough for now.

If you're using a stock uClinux, and a stock target board, and a
proper environment, most things should pretty well work out of the
box. Do other programs function properly and iptables is the only
thing that's failing? If that's the case, it's possible there's a bug
in whatever version of iptables that you're working with. Or, you need
to enable some feature it depends on that's not turned on by default.

Just a few ideas, hope it helps.

- Steve
Arshan Awais
2012-12-19 14:00:53 UTC
Permalink
Thanks Steve,

Point no. 1 and 4 dont apply in my case because i have compiled
iptables along with the file system applications. I will check rest of
the two options and let u know.

And the answer for your question for my other programs is that some
other applications e.g. df is also causing same issue. While rest of
the applications are working properly. I downloaded a pre-build image
of file-system that contained 'df' utility, in that case df was
working perfect.
Post by Steve deRosier
Post by Arshan Awais
Hi Greg,
I recompiled my kernel and used "None" option instead of uClibc,
uC-libc or glibc in menuconfig. (because i am also having issues in
compilation when i select options other than 'None' while library
selection)
iptables[377] killed because of sig - 11
You sort of need a C library for any C code you're working with. I
suppose if you're hand-writing assembly code, you wouldn't need it,
but, last I looked iptables is C code and should require to link
against a C library of some sort. If you're getting successful
compilation and link and not building any of the three supported C
libraries, then you've got pretty big problems. Depending on your
1. You're actually not building a cross-compiled image for your
target. In other words: you're building using your host's compilers
targeting your host computer. Then you're moving the exe to a
different target processor and boom!
2. Your x-compiler is linking against some of it's preconfigured C
libraries, if static, that's probably OK, but if it's a shared link,
you'll need to push those into your filesystem image.
3. Your compiler is linking against some left-over objects, but those
aren't getting inserted into your image because you've turned off the
C libs.
4. All is well with your environment, and you've edited some code and
inserted a read/write to an invalid address (most likely null) and you
need to debug that.
I'm sure there's more possibilities, but 4 seems like enough for now.
If you're using a stock uClinux, and a stock target board, and a
proper environment, most things should pretty well work out of the
box. Do other programs function properly and iptables is the only
thing that's failing? If that's the case, it's possible there's a bug
in whatever version of iptables that you're working with. Or, you need
to enable some feature it depends on that's not turned on by default.
Just a few ideas, hope it helps.
- Steve
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/options/uclinux-dev
Arshan Awais
2012-12-27 05:18:16 UTC
Permalink
Hi,

Thanks for everyone who helped me in some way or the other. I was not
able to solve problem that i mentioned. At last i downloaded the
pre-built file system image from the following link:

ftp://www.at91.com/pub/oe/linux4sam_2.0/images/Angstrom-console-at91sam9-image-glibc-ipk-2009.X-stable-at91sam9xeek.rootfs.jffs2

It did not include the iptabes user space utility so i download the
iptables source and cross-compiled it with '--enable-static' and
'--disable-shared' flags, then transfered the binaries to my board.
Now iptables is working fine :-)
Post by Arshan Awais
Thanks Steve,
Point no. 1 and 4 dont apply in my case because i have compiled
iptables along with the file system applications. I will check rest of
the two options and let u know.
And the answer for your question for my other programs is that some
other applications e.g. df is also causing same issue. While rest of
the applications are working properly. I downloaded a pre-build image
of file-system that contained 'df' utility, in that case df was
working perfect.
Post by Steve deRosier
Post by Arshan Awais
Hi Greg,
I recompiled my kernel and used "None" option instead of uClibc,
uC-libc or glibc in menuconfig. (because i am also having issues in
compilation when i select options other than 'None' while library
selection)
iptables[377] killed because of sig - 11
You sort of need a C library for any C code you're working with. I
suppose if you're hand-writing assembly code, you wouldn't need it,
but, last I looked iptables is C code and should require to link
against a C library of some sort. If you're getting successful
compilation and link and not building any of the three supported C
libraries, then you've got pretty big problems. Depending on your
1. You're actually not building a cross-compiled image for your
target. In other words: you're building using your host's compilers
targeting your host computer. Then you're moving the exe to a
different target processor and boom!
2. Your x-compiler is linking against some of it's preconfigured C
libraries, if static, that's probably OK, but if it's a shared link,
you'll need to push those into your filesystem image.
3. Your compiler is linking against some left-over objects, but those
aren't getting inserted into your image because you've turned off the
C libs.
4. All is well with your environment, and you've edited some code and
inserted a read/write to an invalid address (most likely null) and you
need to debug that.
I'm sure there's more possibilities, but 4 seems like enough for now.
If you're using a stock uClinux, and a stock target board, and a
proper environment, most things should pretty well work out of the
box. Do other programs function properly and iptables is the only
thing that's failing? If that's the case, it's possible there's a bug
in whatever version of iptables that you're working with. Or, you need
to enable some feature it depends on that's not turned on by default.
Just a few ideas, hope it helps.
- Steve
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/options/uclinux-dev
Continue reading on narkive:
Loading...