2010-04-15 20:52:19     php error under bf533 stamp board

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

2010-04-15 20:52:19     php error under bf533 stamp board

w w (CHINA)

Message: 88482   

 

hi, all

 

I download the latest uClinux Distribution uClinux-dist-2009R1.1-RC4.tar.bz2 and compiled ok, and run well on my bf533 stamp board. I compiled php and run on the board.

 

When the system start, I can run command php well, but after the system run some time, the command php error.

 

What's the matter ?

 

root:~> php -v

PHP 5.2.5 (cgi-fcgi) (built: Apr 15 2010 10:42:53)

Copyright (c) 1997-2007 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

root:~>

 

some time later, when I run php, the error is like this

 

root:~> php -v

php: page allocation failure. order:10, mode:0x40d0

Hardware Trace:

   0 Target : <0x00004b38> { _dump_stack + 0x0 }

     Source : <0x00031cde> { ___alloc_pages_internal + 0x1a6 } CALL pcrel

   1 Target : <0x00031cde> { ___alloc_pages_internal + 0x1a6 }

     Source : <0x0000f712> { _printk + 0x16 } RTS

   2 Target : <0x0000f70e> { _printk + 0x12 }

     Source : <0x0000ffaa> { _vprintk + 0x132 } RTS

   3 Target : <0x0000ff9e> { _vprintk + 0x126 }

     Source : <0xffa00c2a> { __common_int_entry + 0xda }

   4 Target : <0xffa00bc8> { __common_int_entry + 0x78 }

     Source : <0xffa00a0c> { _return_from_int + 0x58 }

   5 Target : <0xffa00a0c> { _return_from_int + 0x58 }

     Source : <0xffa009e2> { _return_from_int + 0x2e }

   6 Target : <0xffa009b4> { _return_from_int + 0x0 }

     Source : <0xffa00bc4> { __common_int_entry + 0x74 }

   7 Target : <0xffa00bc2> { __common_int_entry + 0x72 }

     Source : <0xffa00336> { _asm_do_IRQ + 0x6a }

   8 Target : <0xffa0032e> { _asm_do_IRQ + 0x62 }

     Source : <0x00013550> { __local_bh_enable + 0x40 } RTS

   9 Target : <0x00013510> { __local_bh_enable + 0x0 }

     Source : <0x00013638> { ___do_softirq + 0x9c } JUMP.L

  10 Target : <0x00013630> { ___do_softirq + 0x94 }

     Source : <0x00013614> { ___do_softirq + 0x78 } IF !CC JUMP

  11 Target : <0x000135f6> { ___do_softirq + 0x5a }

     Source : <0x001303e8> { _net_rx_action + 0x88 } RTS

  12 Target : <0x001303c2> { _net_rx_action + 0x62 }

     Source : <0x001303f4> { _net_rx_action + 0x94 } JUMP.S

  13 Target : <0x001303f2> { _net_rx_action + 0x92 }

     Source : <0x00130978> { _process_backlog + 0xc8 } RTS

  14 Target : <0x0013096a> { _process_backlog + 0xba }

     Source : <0x00130982> { _process_backlog + 0xd2 } JUMP.S

  15 Target : <0x0013097a> { _process_backlog + 0xca }

     Source : <0x0013095c> { _process_backlog + 0xac } IF CC JUMP

Stack info:

SP: [0x0056fc38] <0x0056fc38> /* kernel dynamic memory */

FP: (0x0056fc34)

Memory from 0x0056fc30 to 00570000

0056fc30: 0056fc38 (00000000)[00031cb6]<00031ce2> 03eb1700  00000000  000240d0

03eb18e8

0056fc50: 0000000a  000040d0  00000001  00000048  0056e000  0056e000  00000000

000240d0

0056fc70: 0056e000  00000010  00000000  00000000  00000000  00000000  00383000 <

00031e06>

0056fc90: 005e4840  003826a0  00000005  ffffffda  00000000  00001802  00000000 <

0003937a>

0056fcb0: 005e4840  00000004  00000000 <000395ec> 00000000  0056fcfc <00009344>

03eb1700

0056fcd0: 000000d0  0038369f  000018f5  00000383  00000000  00000000  00fbfc80

02bc3b40

0056fcf0: 00020000  0000ffff  000080d0  0025ac94 <00061fe6> 03e47100  00000002

0056fe08

0056fd10: 00000fff  00000000  00000000  00000005 <00040cd0><00040df8> 0056e000

00000005

0056fd30: 00001802  00000000  00001802  00000000  00fbff80  00000000  00000000

00fbff84

0056fd50: 00000080  00682740  0056fe64 <0006245e> 0056e000  020ac600  00229018

00020000

0056fd70: 0000008c  0000003f  00000000  03ddf9fc  005e4840  0025ac60  001d2e70 <

00750fc8>

0056fd90: 0056fdb4  00682740  003b95c0  0023e110  0027ec08  00000003  00000001

464c457f

0056fdb0: 00010101  00000000  00000000  006a0003  00000001  00001160  00000034

00007440

0056fdd0: 10000002  00200034  00280004  000e000f  0025cd40  00000000  00000000

00000000

0056fdf0: 00000000  00000000  00020000  00000000  00000000  80000010  464c457f

00010101

0056fe10: 00000000  00000000  006a0002  00000001  0003ef24  00000034  003b9618

00000002

0056fe30: 00200034  00280007  001a001b  03e470c0  00fbff80  00000000  00000000

00000000

0056fe50: 00000000  00020000  00000000  00000000  80000050  ffffffc0 <000405ea>

002293e8

0056fe70: 020ac600  00229018  fffffff8  00000000  0000003f <0056ff24> 03ddf9fc <

0056ff24>

0056fe90: 020ac600  00000000  0056e000  0056e000  03ddf9fc <0004184a> 020ac600

0000000b

0056feb0:<00750fc8> 00000000  03e8e000  00fc0704  00fc0778  00fc0704  00000000

00000001

0056fed0: 00000000 <0000155a> 0000152c  03e8e000  00fc0778  00fc0704  00fc0754 <

03c4d2fa>

0056fef0: 00000004  00000000 <0056ff24> ffa00880  00000000  ffffe000  00751a50

00fa8776

0056ff10: 0025a7e0  00216408  00000003  00fc0754  00751a50  03c4d482  00008000

00002000

0056ff30: 00000000  00570000  03c4d482  03c4d482 <03d14e76> ffa00fb4  02001025

03c72c47

0056ff50: 03c62367  03c72c40  03c62366  00000000  00000000  00000000  00000000

00000000

0056ff70: 00000000  00000000  00000000  00000000  00000000  00000000  00000000

00000000

0056ff90: 00000000  00000000  00000000  00000000  00000000  00000000  00000000

03c7aba4

0056ffb0: 00fc06ac  03ddf9f0  03ddf9fc <00759c90> 03ddffac <00750fc8> 00fa877f

03c4d478

0056ffd0: 0000000b  00000000  00fc0778  00751a50  00fc0754  00000003  00fc0704

00fc0778

0056fff0: 00fa8776  00fa8776  0000000b  00000006

Return addresses in stack:

   frame  1 : <0x00031cb6> { ___alloc_pages_internal + 0x17e }

    address : <0x00031ce2> { ___alloc_pages_internal + 0x1aa }

    address : <0x00031e06> { ___get_free_pages + 0x1e }

    address : <0x0003937a> { _do_mmap_pgoff + 0x32e }

    address : <0x000395ec> { _do_mmap_pgoff + 0x5a0 }

    address : <0x00009344> { _complete + 0x24 }

    address : <0x00061fe6> { _elf_fdpic_map_file + 0x582 }

    address : <0x00040cd0> { _flush_old_exec + 0x354 }

    address : <0x00040df8> { _flush_old_exec + 0x47c }

    address : <0x0006245e> { _load_elf_fdpic_binary + 0x2d2 }

    address : <0x00750fc8> [ sh + 0xfc8 ]

    address : <0x000405ea> { _search_binary_handler + 0x82 }

    address : <0x0056ff24> /* kernel dynamic memory */

    address : <0x0056ff24> /* kernel dynamic memory */

    address : <0x0004184a> { _do_execve + 0x15a }

    address : <0x00750fc8> [ sh + 0xfc8 ]

    address : <0x0000155a> { _sys_execve + 0x2e }

    address : <0x03c4d2fa> [ /lib/libc.so.0 + 0xd2fa ]

    address : <0x0056ff24> /* kernel dynamic memory */

    address : <0x03d14e76> [ /bin/busybox + 0x14e76 ]

    address : <0x00759c90> [ /bin/busybox + 0x4ac90 ]

    address : <0x00750fc8> [ sh + 0xfc8 ]

Mem-Info:

DMA per-cpu:

CPU    0: hi:   18, btch:   3 usd:   1

Active_anon:0 active_file:3 inactive_anon:0

inactive_file:0 dirty:0 writeback:0 unstable:0

free:10372 slab:856 mapped:0 pagetables:0 bounce:0

DMA free:41488kB min:4096kB low:5120kB high:6144kB active_anon:0kB inactive_anon

:0kB active_file:12kB inactive_file:0kB present:64004kB pages_scanned:0 all_unre

claimable? no

lowmem_reserve[]: 0 0 0

DMA: 124*4kB 124*8kB 98*16kB 85*32kB 62*64kB 62*128kB 43*256kB 3*512kB 5*1024kB

1*2048kB 1*4096kB 0*8192kB 0*16384kB 0*32768kB = 41488kB

3 total pagecache pages

16127 pages RAM

720 pages reserved

0 pages shared

4999 pages non-shared

Allocation of length 3682304 from process 1124 failed

DMA per-cpu:

CPU    0: hi:   18, btch:   3 usd:   1

Active_anon:0 active_file:3 inactive_anon:0

inactive_file:0 dirty:0 writeback:0 unstable:0

free:10372 slab:856 mapped:0 pagetables:0 bounce:0

DMA free:41488kB min:4096kB low:5120kB high:6144kB active_anon:0kB inactive_anon

:0kB active_file:12kB inactive_file:0kB present:64004kB pages_scanned:0 all_unre

claimable? no

lowmem_reserve[]: 0 0 0

DMA: 124*4kB 124*8kB 98*16kB 85*32kB 62*64kB 62*128kB 43*256kB 3*512kB 5*1024kB

1*2048kB 1*4096kB 0*8192kB 0*16384kB 0*32768kB = 41488kB

3 total pagecache pages

Unable to load executable

SIGSEGV

root:~>

QuoteReplyEditDelete

 

 

2010-04-15 22:22:15     Re: php error under bf533 stamp board

w w (CHINA)

Message: 88483   

 

I run command  cat /proc/buddyinfo like this:

 

this status the php is ok,

 

root:~> cat /proc/buddyinfo

Node 0, zone      DMA     60    130     96     93     89     70     57      5      1      1     1     0      0      0

root:~>

 

root:~> cat /proc/buddyinfo

Node 0, zone      DMA     60    130     96     93     89     70     57      5      1      2      0      0      0      0

root:~>

 

 

 

this status the php is error,

 

root:~> cat /proc/buddyinfo

Node 0, zone      DMA     60    130     96     93     89     70     57      5      1      1      0      0      0      0

root:~>

 

root:~> cat /proc/buddyinfo

Node 0, zone      DMA     60    130     96     93     89     70     57      5      2     0      0      0      0      0

root:~>

QuoteReplyEditDelete

 

 

2010-04-15 23:21:49     Re: php error under bf533 stamp board

Sonic Zhang (CHINA)

Message: 88484   

 

You are out of memory. So, free more memory first.

QuoteReplyEditDelete

 

 

2010-04-16 01:48:45     Re: php error under bf533 stamp board

w w (CHINA)

Message: 88488   

 

thank you sir.

 

But I run free on my console, I can get enough memory,

 

root:/home/usr/bin> free

              total         used         free       shared      buffers

  Mem:        61788        23280        38508            0            0

root:/home/usr/bin>

 

My memory is 64M, and I can get free 38M memory.

QuoteReplyEditDelete

 

 

2010-04-17 22:13:55     Re: php error under bf533 stamp board

w w (CHINA)

Message: 88548   

 

Sonic Zhang, can you give me some suggestions?

 

Thank you !

QuoteReplyEditDelete

 

 

2010-04-19 00:40:50     Re: php error under bf533 stamp board

Sonic Zhang (CHINA)

Message: 88563   

 

Move your filesystem to nor flash to free more memory.

QuoteReplyEditDelete

 

 

2010-04-19 01:47:24     Re: php error under bf533 stamp board

w w (CHINA)

Message: 88564   

 

Thank you zhang. I don't understand "Move my filesystem to nor flash". My nor flash is 4M, nand flash is 64M, memory is 64M. This is my nor flash and nand flash partitions.

 

Creating 3 MTD partitions on "bfin-async-flash":

0x00000000-0x00020000 : "bootloader(nor)"

0x00020000-0x00180000 : "linux kernel(nor)"

0x00180000-0x00400000 : "file system(nor)"

NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-bi

t)

Scanning device for bad blocks

Creating 1 MTD partitions on "NAND 64MiB 3,3V 8-bit":

0x00000000-0x04000000 : "file system"

 

Both my kernel and filesystem are on the nor flash.

QuoteReplyEditDelete

 

 

2010-04-19 02:23:59     Re: php error under bf533 stamp board

Sonic Zhang (CHINA)

Message: 88566   

 

If you have already put your file system to NOR or NAND flash, the only way you can try is to change the php code not to allocated a 4M continous memory region.

QuoteReplyEditDelete

 

 

2010-04-20 09:32:46     Re: php error under bf533 stamp board

w w (CHINA)

Message: 88648   

 

My SDRAM is 64M.

 

Why do I must use Nor flash ?

 

Where is the SDRAM ?

QuoteReplyEditDelete

 

 

2010-04-20 15:34:46     Re: php error under bf533 stamp board

Mike Frysinger (UNITED STATES)

Message: 88660   

 

you dont have to use NOR ... like Sonic said, any external flash storage should work

QuoteReplyEditDelete

 

 

2010-04-20 22:11:35     Re: php error under bf533 stamp board

w w (CHINA)

Message: 88683   

 

you dont have to use NOR ... like Sonic said, any external flash storage should work

 

---

 

thank you Mike, I am in fog.

 

root:/home/usr/bin> free

   total         used         free       shared      buffers

  Mem:        61788        23280        38508            0            0

You see I have enough free memory(23M), but why could't my php malloc 4M memory ?

QuoteReplyEditDelete

 

 

2010-04-20 22:28:09     Re: php error under bf533 stamp board

Mike Frysinger (UNITED STATES)

Message: 88685   

 

as you've seen in the past, total free memory is not the same thing as free contiguous memory.  move everything out of RAM that doesnt need to be there and it helps fragmentation a lot.

QuoteReplyEditDelete

 

 

2010-04-21 01:09:03     Re: php error under bf533 stamp board

w w (CHINA)

Message: 88691   

 

How does move things out of RAM ?

QuoteReplyEditDelete

 

 

2010-04-21 01:28:20     Re: php error under bf533 stamp board

Sonic Zhang (CHINA)

Message: 88692   

 

put your rootfs into NAND flash. Boot kernel from rootfs on NAND flash.

 

If this still doesn't solve the problem, revise the php source code to split an allocation of 4M continous memory into 4 allocations of 1M continuous memory.

QuoteReplyEditDelete

Attachments

    Outcomes