2008-03-18 03:06:39 Page allocation failure
kanal kannan (INDIA)
Message: 52630 Hi all,
When i'm executing my application from the root prompt i'm getting the following error:
t:/bin> ./EXE_DCT_A_SRVR_NP
EXE_DCT_A_SRVR_: page allocation failure. order:13, mode:0x40d0
Hardware Trace:
0 Target : <0x000044d4> { _dump_stack + 0x0 }
Source : <0x00030332> { ___alloc_pages + 0x17a }
1 Target : <0x00030332> { ___alloc_pages + 0x17a }
Source : <0x0000c7b6> { _printk + 0x16 }
2 Target : <0x0000c7b2> { _printk + 0x12 }
Source : <0x0000c640> { _vprintk + 0x1b0 }
3 Target : <0x0000c634> { _vprintk + 0x1a4 }
Source : <0xffa01256> { __common_int_entry + 0xd8 }
4 Target : <0xffa011f4> { __common_int_entry + 0x76 }
Source : <0xffa00fcc> { _return_from_int + 0x58 }
5 Target : <0xffa00fcc> { _return_from_int + 0x58 }
Source : <0xffa00fa2> { _return_from_int + 0x2e }
6 Target : <0xffa00f74> { _return_from_int + 0x0 }
Source : <0xffa011f0> { __common_int_entry + 0x72 }
7 Target : <0xffa011ee> { __common_int_entry + 0x70 }
Source : <0xffa00550> { _asm_do_IRQ + 0x7c }
8 Target : <0xffa00548> { _asm_do_IRQ + 0x74 }
Source : <0x000106be> { __local_bh_enable + 0x3e }
9 Target : <0x00010680> { __local_bh_enable + 0x0 }
Source : <0x00010938> { ___do_softirq + 0x94 }
10 Target : <0x00010930> { ___do_softirq + 0x8c }
Source : <0x00010910> { ___do_softirq + 0x6c }
11 Target : <0x00010902> { ___do_softirq + 0x5e }
Source : <0x00010a2c> { _tasklet_action + 0x7c }
12 Target : <0x00010a26> { _tasklet_action + 0x76 }
Source : <0x00010a02> { _tasklet_action + 0x52 }
13 Target : <0x00010a00> { _tasklet_action + 0x50 }
Source : <0x0001aeee> { ___rcu_process_callbacks + 0xb6 }
14 Target : <0x0001aee8> { ___rcu_process_callbacks + 0xb0 }
Source : <0x0001ae7e> { ___rcu_process_callbacks + 0x46 }
15 Target : <0x0001ae7a> { ___rcu_process_callbacks + 0x42 }
Source : <0x0001af16> { ___rcu_process_callbacks + 0xde }
Stack from 00763c4c:
00000001 00030336 00000000 00000001 000040d0 005d4c4c 0000000d 000040d0
00000000 00000080 00000000 000240d0 00000000 00762000 00762000 00762000
00000010 00000000 0059d260 0003134e 00173630 00000000 0059eba0 00000020
000040d0 00000001 00000010 005892c0 00000000 00000000 000040d0 0059eba0
0143e94b 000315fe 0143d94c 0075df20 00000077 0000ffff 00000002 00000000
00000000 00130520 0002ece6 0143d94c 0002f0de 00000000 00130bd4 00000000
Call Trace:
[<00004303>] _printk_address+0x2b/0x154
[<0005b56a>] _load_flat_file+0x26e/0xa80
[<00010c0c>] _irq_exit+0x10/0x34
[<000c3c20>] _netlink_dump_start+0x24/0x138
[<000ee290>] _cookie_v4_check+0x174/0x33c
[<00033c5c>] _do_sync_read+0xb0/0xe8
[<000ee290>] _cookie_v4_check+0x174/0x33c
[<0002a670>] _test_clear_page_dirty+0xf8/0x118
[<0000108c>] __start+0x8c/0x134
[<0001ce94>] _autoremove_wake_function+0x0/0x30
[<000c3c20>] _netlink_dump_start+0x24/0x138
[<000ee290>] _cookie_v4_check+0x174/0x33c
[<0005bfe4>] _load_flat_binary+0x64/0x39c
[<0000108c>] __start+0x8c/0x134
[<000371f2>] _search_binary_handler+0x82/0x220
[<000385d2>] _do_execve+0x1b2/0x1f0
[<00004a1e>] _dma_unmap_sg+0x36/0x38
[<00001a5e>] _sys_execve+0x2e/0x54
[<00001a30>] _sys_execve+0x0/0x54
[<00130ba0>] ___alloc_bootmem_core+0x48/0x334
[<00130ba0>] ___alloc_bootmem_core+0x48/0x334
[<00008000>] _coreb_show_status+0xb0/0xd0
Mem-info:
DMA per-cpu:
CPU 0: Hot: hi: 18, btch: 3 usd: 6 Cold: hi: 6, btch: 1 usd: 5
Active:89 inactive:30 dirty:3 writeback:0 unstable:0 free:11335 slab:924 mapped:0 pagetables:0
DMA free:45340kB min:936kB low:1168kB high:1404kB active:356kB inactive:120kB present:54864kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0
DMA: 15*4kB 8*8kB 4*16kB 1*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 1*4096kB 1*8192kB 2*16384kB 0*32768kB = 45340kB
13824 pages of RAM
11363 free pages
1394 reserved pages
13 pages shared
0 pages swap cached
Allocation of length 21223756 from process 93 failed
DMA per-cpu:
CPU 0: Hot: hi: 18, btch: 3 usd: 6 Cold: hi: 6, btch: 1 usd: 5
Active:89 inactive:30 dirty:3 writeback:0 unstable:0 free:11335 slab:924 mapped:0 pagetables:0
DMA free:45340kB min:936kB low:1168kB high:1404kB active:356kB inactive:120kB present:54864kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0
DMA: 15*4kB 8*8kB 4*16kB 1*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 1*4096kB 1*8192kB 2*16384kB 0*32768kB = 45340kB
Unable to allocate RAM for process text/data, errno 12
Instruction fetch misaligned address violation
- Attempted misaligned instruction cache fetch. On a misaligned instruction fetch exception,
the return address provided in RETX is the destination address which is misaligned, rather than the address of the offending instruction.
CURRENT PROCESS:
COMM=EXE_DCT_A_SRVR_ PID=93
TEXT = 0x00000000-0x00000000 DATA = 0x00000000-0x00000000
BSS = 0x00000000-0x00000000 USER-STACK = 0x00000000
return address: 0x03481d58; contents of [PC-16...PC+8]:
00a0 3038 e120 f000 0a07 1c07 e300 0b0c
3210 43b8 63ff 9310 e801 0000 3007 0530 X
0010 0000 0578 e800 0003 3018 42ca 300a
RETE: 00000000 RETN: 00764000 RETX: 03481d58 RETS: 00000001
IPEND: 0030 SYSCFG: 0036
SEQSTAT: 0000002a SP: 00763f24
R0: ffffffff R1: 00660398 R2: 00660324 R3: 00660324
R4: 00660324 R5: 034d9399 R6: 00660374 R7: 034c0204
P0: 0000000b P1: 00660388 P2: 034dff4c P3: 034dedd0
P4: 00660398 P5: 034dd1ec FP: 00000000
A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000
LB0: 0348b233 LT0: 0348b220 LC0: ffffffff
LB1: 034bee69 LT1: 034bee68 LC1: 00000000
B0: 00000000 L0: 00000000 M0: 00000000 I0: 006602dc
B1: 00000000 L1: 00000000 M1: 00000000 I1: 034febb4
B2: 00000000 L2: 00000000 M2: 00000000 I2: 00000000
B3: 00000000 L3: 00000000 M3: 00000000 I3: 00000000
USP: 034ffbac ASTAT: 02002000
DCPLB_FAULT_ADDR=034ffba8
ICPLB_FAULT_ADDR=03481d58
Hardware Trace:
0 Target : <0x00004598> { _trap_c + 0x0 }
Source : <0xffa00c54> { _exception_to_level5 + 0xb4 }
1 Target : <0xffa00ba0> { _exception_to_level5 + 0x0 }
Source : <0xffa00b9e> { _ex_trap_c + 0x5a }
2 Target : <0xffa00ccc> { _trap + 0x0 }
Source : <0x03481d56> [ sh + 0x1d56 ]
3 Target : <0x03481d48> [ sh + 0x1d48 ]
Source : <0x0348336c> [ sh + 0x336c ]
4 Target : <0x0348335c> [ sh + 0x335c ]
Source : <0x03481d44> [ sh + 0x1d44 ]
5 Target : <0x03481d3a> [ sh + 0x1d3a ]
Source : <0xffa01256> { __common_int_entry + 0xd8 }
6 Target : <0xffa011f4> { __common_int_entry + 0x76 }
Source : <0xffa01494> { _evt_system_call + 0x64 }
7 Target : <0xffa01494> { _evt_system_call + 0x64 }
Source : <0xffa00e88> { _system_call + 0xb8 }
8 Target : <0xffa00e84> { _system_call + 0xb4 }
Source : <0xffa00e74> { _system_call + 0xa4 }
9 Target : <0xffa00e6e> { _system_call + 0x9e }
Source : <0xffa00e5e> { _system_call + 0x8e }
10 Target : <0xffa00e4c> { _system_call + 0x7c }
Source : <0xffa00e6c> { _system_call + 0x9c }
11 Target : <0xffa00e6a> { _system_call + 0x9a }
Source : <0xffa01856> { _schedule + 0x31e }
12 Target : <0xffa01804> { _schedule + 0x2cc }
Source : <0xffa00f02> { _new_old_task + 0x6 }
13 Target : <0xffa00efc> { _new_old_task + 0x0 }
Source : <0xffa00efa> { _resume + 0x2e }
14 Target : <0xffa00ecc> { _resume + 0x0 }
Source : <0xffa01800> { _schedule + 0x2c8 }
15 Target : <0xffa017fc> { _schedule + 0x2c4 }
Source : <0xffa01d60> { _memcpy + 0x30 }
Stack from 00763f04:
034dedd0 ffa00c58 0013e714 0013e714 0013e710 00660324 00660324 0072110c
03481d58 00000030 0000002a 00000000 00764000 03481d58 03481d58 00000001
ffffffff 02002000 034bee69 0348b233 034bee68 0348b220 00000000 ffffffff
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 034febb4 006602dc 034ffbac 00000000 034dd1ec 00660398
Call Trace:
93: Bus error
root:/bin>
here's my information about
root:~> cat proc/meminfo
MemTotal: 49720 kB
MemFree: 44952 kB
Buffers: 56 kB
Cached: 476 kB
SwapCached: 0 kB
Active: 512 kB
Inactive: 16 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 0 kB
Mapped: 0 kB
Slab: 4036 kB
SReclaimable: 160 kB
SUnreclaim: 3876 kB
PageTables: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 24860 kB
Committed_AS: 0 kB
VmallocTotal: 0 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
My image size comes around 4.1MB (the one which i'm loading into the kit via serial port out of which my application *.exe size comes around 1MB), I'm using uClinux-dist version 2007R1-Rc3.
i'm stuck at this point, i've gone through the forums and found out that the same error has occured for various people but none of them gave any suggestions or steps of how they overcome this problem. Please give a detailed explanation of how to eliminate this error.
Any help in this regard will be highly appreciated.
regards
Kannan
QuoteReplyEditDelete
2008-03-18 07:16:53 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52688 order:13 means you're trying to allocate a contiguous chunk of memory that is 32megs in size. that is rarely (if ever) going to succeed on a no-mmu system that only has ~50megs of external memory.
4096 * 2^13 -> 32meg
QuoteReplyEditDelete
2008-03-18 07:58:09 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52692 Hi Mike,
I need a solution for eliminating this problem. Though my application does not allocate memory.
I can infer that it is happening due to non availability of 32MB.
How to overcome this problem.
regards
Kannan
QuoteReplyEditDelete
2008-03-18 08:08:29 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52694 someone is attempting an allocation of order 13 ... find that allocation and stop doing it. there is no way to fix this issue on a system without virtual memory ... things become fragmented and you cant unfragment them.
QuoteReplyEditDelete
2008-03-18 10:02:38 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52698 Hi Mike,
While compiling the application in eclipse it gives the flatmem error is exhausted and so i increase the size
" flatmem : ORIGIN = 0x0, LENGTH = 0xffffff" changed the LENGTH=0x2ffffff
of the flat mem in the following file to "/opt/uClinux/bfin-uclinux/bfin-uclinux/lib/elf2flt.ld" and the linker error goes away.
After giving the following command " set bootargs root=/dev/mtdblock0 rw mem=30M max_mem=64M$#"
My page allocation error goes but still the following error occurs:
Unable to allocate RAM for process text/data, errno 12
Instruction fetch misaligned address violation
- Attempted misaligned instruction cache fetch. On a misaligned instruction fetch exception,
the return address provided in RETX is the destination address which is misaligned, rather than the address of the offending instruction.
CURRENT PROCESS:
COMM=EXE_DCT_A_SRVR_ PID=93
TEXT = 0x00000000-0x00000000 DATA = 0x00000000-0x00000000
BSS = 0x00000000-0x00000000 USER-STACK = 0x00000000
return address: 0x00781d58; contents of [PC-16...PC+8]:
00a0 3038 e120 f000 0a07 1c07 e300 0b0c
3210 43b8 63ff 9310 e801 0000 3007 0530 X
0010 0000 0578 e800 0003 3018 42ca 300a
RETE: 00000000 RETN: 0112a000 RETX: 00781d58 RETS: 00000001
IPEND: 0030 SYSCFG: 0036
SEQSTAT: 0000002a SP: 01129f24
R0: ffffffff R1: 01020398 R2: 01020324 R3: 01020324
R4: 01020324 R5: 007d9399 R6: 01020374 R7: 007c0204
P0: 0000000b P1: 01020388 P2: 007dff4c P3: 007dedd0
P4: 01020398 P5: 007dd1ec FP: 00000000
A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000
LB0: 0078b233 LT0: 0078b220 LC0: ffffffff
LB1: 007bee69 LT1: 007bee68 LC1: 00000000
B0: 00000000 L0: 00000000 M0: 00000000 I0: 010202dc
B1: 00000000 L1: 00000000 M1: 00000000 I1: 007febb4
B2: 00000000 L2: 00000000 M2: 00000000 I2: 00000000
B3: 00000000 L3: 00000000 M3: 00000000 I3: 00000000
USP: 007ffbac ASTAT: 02002000
DCPLB_FAULT_ADDR=007ffba8
ICPLB_FAULT_ADDR=00781d58
Hardware Trace:
0 Target : <0x00004598> { _trap_c + 0x0 }
Source : <0xffa00c54> { _exception_to_level5 + 0xb4 }
1 Target : <0xffa00ba0> { _exception_to_level5 + 0x0 }
Source : <0xffa00b9e> { _ex_trap_c + 0x5a }
2 Target : <0xffa00ccc> { _trap + 0x0 }
Source : <0x00781d56> [ sh + 0x1d56 ]
3 Target : <0x00781d48> [ sh + 0x1d48 ]
Source : <0x0078336c> [ sh + 0x336c ]
4 Target : <0x0078335c> [ sh + 0x335c ]
Source : <0x00781d44> [ sh + 0x1d44 ]
5 Target : <0x00781d3a> [ sh + 0x1d3a ]
Source : <0xffa01256> { __common_int_entry + 0xd8 }
6 Target : <0xffa011f4> { __common_int_entry + 0x76 }
Source : <0xffa01494> { _evt_system_call + 0x64 }
7 Target : <0xffa01494> { _evt_system_call + 0x64 }
Source : <0xffa00e88> { _system_call + 0xb8 }
8 Target : <0xffa00e84> { _system_call + 0xb4 }
Source : <0xffa00e74> { _system_call + 0xa4 }
9 Target : <0xffa00e6e> { _system_call + 0x9e }
Source : <0xffa00e5e> { _system_call + 0x8e }
10 Target : <0xffa00e4c> { _system_call + 0x7c }
Source : <0xffa00e6c> { _system_call + 0x9c }
11 Target : <0xffa00e6a> { _system_call + 0x9a }
Source : <0xffa01856> { _schedule + 0x31e }
12 Target : <0xffa01804> { _schedule + 0x2cc }
Source : <0xffa00f02> { _new_old_task + 0x6 }
13 Target : <0xffa00efc> { _new_old_task + 0x0 }
Source : <0xffa00efa> { _resume + 0x2e }
14 Target : <0xffa00ecc> { _resume + 0x0 }
Source : <0xffa01800> { _schedule + 0x2c8 }
15 Target : <0xffa017fc> { _schedule + 0x2c4 }
Source : <0xffa01d60> { _memcpy + 0x30 }
Stack from 01129f04:
007dedd0 ffa00c58 0013e714 0013e714 0013e710 01020324 01020324 00782ae8
00781d58 00000030 0000002a 00000000 0112a000 00781d58 00781d58 00000001
ffffffff 02002000 007bee69 0078b233 007bee68 0078b220 00000000 ffffffff
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 007febb4 010202dc 007ffbac 00000000 007dd1ec 01020398
Call Trace:
93: Bus error
Any help in this regard would be highly appreciated.
regards
Kannan
QuoteReplyEditDelete
2008-03-18 10:18:57 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52703 FLAT binaries are limited to 16megs in size ... simply hacking the linker script to ignore this limit just means you'll get a crash at runtime
QuoteReplyEditDelete
2008-03-19 07:17:19 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52750 Hi Mike,
I'm getting the following error when i compile my application in eclipse
/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/bin/ld.real: region flatmem is full (EXE_DCT_A_SRVR_NP.gdb section .bss)
/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/bin/ld.real: region flatmem is full (EXE_DCT_A_SRVR_NP.gdb section .bss)
collect2: ld returned 1 exit status
I'm also attaching my makefile for your reference.
Do i need to make any changes in my makefile to eliminate this linker error.
any help in this regard is highly appreciated.
with regards
Kannan
Makefile
QuoteReplyEditDelete
2008-03-19 08:54:04 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52751 the Makefile doesnt really tell you anything useful
you're most likely overflowing the aforementioned size limits ... there is no fix, you simply need to stop using so much space
run the link step without -elf2flt to produce just an ELF ... then you can use `readelf -l` to look at the program headers and that'll verify that sizes of the different PT_LOADs. you can use readelf in general to track down where you're allocating too big of objects.
QuoteReplyEditDelete
2008-03-19 09:48:35 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52753 Hi Mike,
Thanks for your reply and i'm now proceeding in the right direction. I followed your instructions and now the execution file was generated after i remove the -elf2flt from my makefile. And after loading & executing the application from the target, i get the following output:
root:/bin> ./EXE_DCT_A_SRVR_NP
EXE_DCT_A_SRVR_NP: applet not found
so i read the execution file using the readelf command and i'm getting the following output. I'm stuck at this point.
[root@localhost gdb]# bfin-uclinux-readelf -e EXE_DCT_A_SRVR_NP
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Analog Devices Blackfin
Version: 0x1
Entry point address: 0x14
Start of program headers: 52 (bytes into file)
Start of section headers: 2720940 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 2
Size of section headers: 40 (bytes)
Number of section headers: 25
Section header string table index: 22
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .init PROGBITS 00000000 001000 000012 00 AX 0 0 1
[ 2] .text PROGBITS 00000014 001014 0c39bc 00 AX 0 0 4
[ 3] .fini PROGBITS 000c39d0 0c49d0 00000e 00 AX 0 0 1
[ 4] .rodata PROGBITS 000c39e0 0c49e0 00bdc8 00 A 0 0 4
[ 5] .eh_frame PROGBITS 000cf7a8 0d07a8 0134dc 00 A 0 0 4
[ 6] .gcc_except_table PROGBITS 000e2c84 0e3c84 005198 00 A 0 0 4
[ 7] .ctors PROGBITS 000e8e1c 0e8e1c 0000a4 00 WA 0 0 4
[ 8] .dtors PROGBITS 000e8ec0 0e8ec0 000008 00 WA 0 0 4
[ 9] .jcr PROGBITS 000e8ec8 0e8ec8 000004 00 WA 0 0 4
[10] .data PROGBITS 000e8ecc 0e8ecc 006108 00 WA 0 0 4
[11] .bss NOBITS 000eefd4 0eefd4 2b5ce28 00 WA 0 0 4
[12] .comment PROGBITS 00000000 0eefd4 001815 00 0 0 1
[13] .debug_aranges PROGBITS 00000000 0f07f0 002fb0 00 0 0 8
[14] .debug_pubnames PROGBITS 00000000 0f37a0 01200c 00 0 0 1
[15] .debug_info PROGBITS 00000000 1057ac 0d8b02 00 0 0 1
[16] .debug_abbrev PROGBITS 00000000 1de2ae 013faa 00 0 0 1
[17] .debug_line PROGBITS 00000000 1f2258 0251c0 00 0 0 1
[18] .debug_frame PROGBITS 00000000 217418 009e34 00 0 0 4
[19] .debug_str PROGBITS 00000000 22124c 01a900 01 MS 0 0 1
[20] .debug_loc PROGBITS 00000000 23bb4c 043ae2 00 0 0 1
[21] .debug_ranges PROGBITS 00000000 27f62e 018d90 00 0 0 1
[22] .shstrtab STRTAB 00000000 2983be 0000ee 00 0 0 1
[23] .symtab SYMTAB 00000000 298894 017610 10 24 929 4
[24] .strtab STRTAB 00000000 2afea4 031a0e 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x001000 0x00000000 0x00000000 0xe7e1c 0xe7e1c R E 0x1000
LOAD 0x0e8e1c 0x000e8e1c 0x000e8e1c 0x061b8 0x2b62fe0 RW 0x1000
Section to Segment mapping:
Segment Sections...
00 .init .text .fini .rodata .eh_frame .gcc_except_table
01 .ctors .dtors .jcr .data .bss
Any help in this regard would be highly appreciated.
regards
Kannan
QuoteReplyEditDelete
2008-03-19 10:00:16 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52755 when i said drop -elf2flt, i meant so you could find where your application is going wrong ... the resulting binary has no chance of working on the board
your bss has a size of 0x2b5ce28 and that has no chance whatsoever of working
QuoteReplyEditDelete
2008-03-19 10:08:42 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52756 Hi Mike,
i got your point but i can't understand the follwoing line :
"your bss has a size of 0x2b5ce28 and that has no chance whatsoever of working"
what should i do now to eliminate this error.
regards
Kannan
QuoteReplyEditDelete
2008-03-19 10:21:59 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52757 what i said earlier: your code is doing something wrong by allocating that much space ... find that static allocation and stop allocating that much
if you dont know your own code, use the -s option with readelf to list all the symbols and their related sizes
QuoteReplyEditDelete
2008-03-20 08:00:57 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52834 Hi Mike,
My application allocates 4 buffers (of size 0.5MB) for accessing the video data & displaying it. This happens properly & displays video in TV. But when i integrate another application code with these buffers i'm facing stack overflow problem and that's the reason why .bss is overloaded. We need help to eliminate this error. I've even enabled the userspace->kernelspace linker in the make menuconfig, but still my *.bss is overloaded. When i access this buffer from the kernel space there stack does not overflow. But when my application access the .bss is overloaded.
Any help in this regarded will be highly appreciated.
regards
Kannan
QuoteReplyEditDelete
2008-03-20 08:19:40 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52836 then allocate them dynamically at runtime. the .bss is allocated as one large contiguous region and when you're talking such very large sizes, you'll most likely never have a region of that size available. in your initialization code, make individual calls to malloc() for each buffer so that they can be split up sanely.
that said, 0.5megs * 4 is still way below 0x2b5ce28, so you have other allocations that also need fixing
QuoteReplyEditDelete
2008-03-20 08:39:17 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52841 Hi Mike,
Thanks for your reply. My buffers are already present in the kernel and it's working fine for our sample video in out, but my application program was in the kernel. This time I'm trying to access those same buffers present in the kernel and my application is now in userspace. Thus i'm getting stack overflow error. whether this is the error due to the kernel access or cant i make such a large buffers in the user environment. If i'm not calling these buffers the bss size reduces to 0x6d1f0 from 0x2b5ce28. And these buffers are organised in circular manner. I'm just using those buffers in kernel and i'm not declaring it from my user application. If it's so then how can i dynamically allocate memory for those buffers.
regards
Kannan
QuoteReplyEditDelete
2008-03-20 08:54:42 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52842 then you're probably declaring the buffers incorrectly. if your buffers are already in kernel space and you're trying to access them directly from userspace but your bss is increasing like that, then it's because you arent declaring them as pointers, you're declaring them as storage. please consult a C programming manual/howto on pointers.
QuoteReplyEditDelete
2008-03-22 08:53:11 Re: Page allocation failure
kanal kannan (INDIA)
Message: 52920 Hi Mike,
I tried commenting the functions that are present in my main function and found out the size of .bss still remains same. Even though the main file contains only the associated directories and the associated functions are excluded from compilation but the problem remains the same.
Any help in this regard would be highly appreciated.
with regards
Kannan
QuoteReplyEditDelete
2008-03-22 13:40:04 Re: Page allocation failure
Mike Frysinger (UNITED STATES)
Message: 52924 the functions dont matter, the data does. i cant really give you any more pointers than all the ones ive already given without fixing the source code for you. sorry.