2011-03-29 08:44:30     Application invoking

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-03-29 08:44:30     Application invoking

Jayaprabhu Nadarajan (INDIA)

Message: 99428   




Following is the size of our application.


  text    data    bss     dec     hex  filename

2805117  225197 7976056 11006370 a7f1a2 App


Before I start my application. Following is the buddyinfo details


Node 0, zone      DMA      0      0      0      7      4      3      2      2      4      5      3      2      0      0


As you can see there are two 8M chunks available.

My application is not booting if i have only one 8M Chunk. It crashes because it could not load the bss+data.


In working case if i do cat /proc/<pid>/maps


My data+bss(7.9M) is loaded in a contiguous memory and my text region(2.6M) is loaded in another contiguous memory. Apart from this some dynamic libraries are loaded but those size appears to be smaller.


My question is why the kernel needs two 8M chunks to start my application. One 8M chunk to load my data+bss is agreed. But why the other one.


Since i have adequate 4M chunks and 2M chunks, why it is not using those.







2011-03-29 14:05:13     Re: Application invoking

Mike Frysinger (UNITED STATES)

Message: 99433   


the `nm` output is not what corresponds to maps.  for FDPIC, use `readelf -l` to see the region sizes.  for FLAT, use flthdr.




2011-03-30 03:29:52     Re: Application invoking

Jayaprabhu Nadarajan (INDIA)

Message: 99458   


Hi Mike,


Following is the output of readelf -l




Elf file type is EXEC (Executable file)

Entry point 0x4e818

There are 7 program headers, starting at offset 52


Program Headers:

  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align

  PHDR           0x000034 0x00000034 0x00000034 0x000e0 0x000e0 R E 0x4

  INTERP         0x000114 0x00000114 0x00000114 0x00014 0x00014 R   0x1

      [Requesting program interpreter: /lib/ld-uClibc.so.0]

  LOAD           0x000000 0x00000000 0x00000000 0x2acea8 0x2acea8 R E 0x1000

  LOAD           0x2acea8 0x002b0ea8 0x002b0ea8 0x36fac 0x7d2424 RW  0x1000

  DYNAMIC        0x2cabfc 0x002cebfc 0x002cebfc 0x00110 0x00110 RW  0x4

  GNU_EH_FRAME   0x2acc64 0x002acc64 0x002acc64 0x00244 0x00244 R   0x4

  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x20000 RWE 0x8


Section to Segment mapping:

  Segment Sections...


   01     .interp

   02     .interp .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .rofixup .eh_frame_hdr

   03     .eh_frame .gcc_except_table .ctors .dtors .jcr .data.rel.ro .dynamic .data .got .bss

   04     .dynamic

   05     .eh_frame_hdr

   06     .interp .hash




The memory size is 7.8M for Bss+data and another 2.6M for text


Then why two 8M Chunks is required?








2011-03-30 03:40:10     Re: Application invoking

Mike Frysinger (UNITED STATES)

Message: 99459   


is it actually FDPIC ?


that app will need at least one 8MiB mapping and one 4MiB mapping.  and because it's the data that is 8MiB, every time you fork or run a new process, it'll need a dedicated 8MiB mapping.  for FDPIC apps, the text at least can be shared.


look at the actual crash message to see what memory chunks are available.


what rootfs are you running out of ?