Comment 4 for bug 861296

Revision history for this message
Dr. David Alan Gilbert (davidgil-uk) wrote :

That one is much more fun; running under gdb it fails at:

2031Mb allocated using slize size = 5*406Mb OK
2031Mb allocated using slize size = 4*507Mb OK
Couldn't allocate the heap: 2031Mb
slize size = 677Mb slize no= 2/3

I added debug to print the pointers:

Slize 2 @ 0xffffffff
Slize 1 @ 0x6a613000
Slize 0 @ 0x40113000

and /proc/.../maps looks like:

daveg@panda-01:~$ cat /proc/19930/maps
00008000-00009000 r-xp 00000000 b3:02 61316 /home/daveg/t2
00010000-00011000 r--p 00000000 b3:02 61316 /home/daveg/t2
00011000-00012000 rw-p 00001000 b3:02 61316 /home/daveg/t2
40000000-40016000 r-xp 00000000 b3:02 189877 /lib/arm-linux-gnueabi/ld-2.13.so
40016000-4001a000 rw-p 00000000 00:00 0
4001d000-4001e000 r--p 00015000 b3:02 189877 /lib/arm-linux-gnueabi/ld-2.13.so
4001e000-4001f000 rw-p 00016000 b3:02 189877 /lib/arm-linux-gnueabi/ld-2.13.so
40031000-40106000 r-xp 00000000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
40106000-4010d000 ---p 000d5000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
4010d000-4010f000 r--p 000d4000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
4010f000-40110000 rw-p 000d6000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
40110000-94b13000 rw-p 00000000 00:00 0
befdf000-bf000000 rw-p 00000000 00:00 0 [stack]
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]

ulimit -a shows:
virtual memory (kbytes, -v) unlimited

and max memory size is also:
max memory size (kbytes, -m) unlimited

What's happening here is that the 3rd map would run into the stack, and it's not using the heap space below the libraries,
but instead it's failing.

2010Mb allocated using slize size = 32*62Mb OK
2010Mb allocated using slize size = 31*64Mb OK
Couldn't allocate the heap: 2010Mb
slize size = 67Mb slize no= 29/30
Slize 29 @ 0xffffffff
Slize 28 @ 0xb64c3000
Slize 27 @ 0xb215d000
Slize 26 @ 0xaddd9000
Slize 25 @ 0xa9ad2000
Slize 24 @ 0xa5707000
Slize 23 @ 0xa13e7000
Slize 22 @ 0x9d0df000
Slize 21 @ 0x98d8d000
Slize 20 @ 0x949a7000
Slize 19 @ 0x905d9000
Slize 18 @ 0x8c280000
Slize 17 @ 0x87e8d000
Slize 16 @ 0x83ab7000
Slize 15 @ 0x7f767000
Slize 14 @ 0x7b3bf000
Slize 13 @ 0x77022000
Slize 12 @ 0x72c5e000
Slize 11 @ 0x6e8a1000
Slize 10 @ 0x6a55e000
Slize 9 @ 0x6617a000
Slize 8 @ 0x61ddf000
Slize 7 @ 0x5da1e000
Slize 6 @ 0x59671000
Slize 5 @ 0x552e8000
Slize 4 @ 0x50fe1000
Slize 3 @ 0x4cca7000
Slize 2 @ 0x48954000
Slize 1 @ 0x4460a000
Slize 0 @ 0x402fa000
^Z
[2]+ Stopped ./t2
daveg@panda-01:~$ ps -eaf|grep t2
daveg 19928 19775 0 14:38 pts/1 00:00:01 gdb ./t2
daveg 19930 19928 0 14:38 pts/1 00:00:00 /home/daveg/t2
daveg 19975 19775 3 14:42 pts/1 00:00:00 ./t2
daveg 19977 19775 0 14:42 pts/1 00:00:00 grep --color=auto t2
daveg@panda-01:~$ cat /proc/19975/maps
00008000-00009000 r-xp 00000000 b3:02 61317 /home/daveg/t2
00010000-00011000 r--p 00000000 b3:02 61317 /home/daveg/t2
00011000-00012000 rw-p 00001000 b3:02 61317 /home/daveg/t2
4005a000-40070000 r-xp 00000000 b3:02 189877 /lib/arm-linux-gnueabi/ld-2.13.so
40070000-40071000 rw-p 00000000 00:00 0
40077000-40078000 r--p 00015000 b3:02 189877 /lib/arm-linux-gnueabi/ld-2.13.so
40078000-40079000 rw-p 00016000 b3:02 189877 /lib/arm-linux-gnueabi/ld-2.13.so
400b5000-400b7000 rw-p 00000000 00:00 0
400f4000-400f5000 rw-p 00000000 00:00 0
40218000-402ed000 r-xp 00000000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
402ed000-402f4000 ---p 000d5000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
402f4000-402f6000 r--p 000d4000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
402f6000-402f7000 rw-p 000d6000 b3:02 189898 /lib/arm-linux-gnueabi/libc-2.13.so
402f7000-445fa000 rw-p 00000000 00:00 0
4460a000-4890a000 rw-p 00000000 00:00 0
48954000-4cc54000 rw-p 00000000 00:00 0
4cca7000-50fa7000 rw-p 00000000 00:00 0
50fe1000-552e1000 rw-p 00000000 00:00 0
552e8000-595e8000 rw-p 00000000 00:00 0
59671000-5d971000 rw-p 00000000 00:00 0
5da1e000-61d1e000 rw-p 00000000 00:00 0
61ddf000-660df000 rw-p 00000000 00:00 0
6617a000-6a47a000 rw-p 00000000 00:00 0
6a55e000-6e85e000 rw-p 00000000 00:00 0
6e8a1000-72ba1000 rw-p 00000000 00:00 0
72c5e000-76f5e000 rw-p 00000000 00:00 0
77022000-7b322000 rw-p 00000000 00:00 0
7b3bf000-7f6bf000 rw-p 00000000 00:00 0
7f767000-83a67000 rw-p 00000000 00:00 0
83ab7000-87db7000 rw-p 00000000 00:00 0
87e8d000-8c18d000 rw-p 00000000 00:00 0
8c280000-90580000 rw-p 00000000 00:00 0
905d9000-948d9000 rw-p 00000000 00:00 0
949a7000-98ca7000 rw-p 00000000 00:00 0
98d8d000-9d08d000 rw-p 00000000 00:00 0
9d0df000-a13df000 rw-p 00000000 00:00 0
a13e7000-a56e7000 rw-p 00000000 00:00 0
a5707000-a9a07000 rw-p 00000000 00:00 0
a9ad2000-addd2000 rw-p 00000000 00:00 0
addd9000-b20d9000 rw-p 00000000 00:00 0
b215d000-b645d000 rw-p 00000000 00:00 0
b64c3000-ba7c3000 rw-p 00000000 00:00 0
be9fa000-bea1b000 rw-p 00000000 00:00 0 [stack]
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]

Here it's the same - we're running out of space at the top, and not using the space below 4......

(Are we supposed to?)

Dave