1.介绍

本文记录分析驱动模块kmalloc接口的flags参数使用不当,导致分配内存失败的问题,主要记录了分析过程和给出的解决方法。

1.1背景介绍

在对spi nand flash进行读写老化,因此在用户态通过rwcheck工具对flash进行读写老化,在读写老化过程中,高概率出现内核oom现象,具体板级信息说明如下:

内存大小:128M
CPU:双核A7

2.log分析

在读写测试时,oom log如下所示:

remove  : /mnt/UDISK/rwcheck.tmp.36 ... OK
remove  : /mnt/UDISK/rwcheck.tmp.37 ... OK
remove  : /mnt/UDISK/rwcheck.tmp.38 ... OK
remove  : /mnt/UDISK/rwcheck.tmp.39 ... OK
remove  : /mnt/UDISK/rwcheck.tmp.40 ... OK
remove  : /mnt/UDISK/rwcheck.tmp[ 8564.746419] kworker/u4:2: page allocation failure: order:0, mode:0x800(GFP_NOWAIT), nodemask=(null)
[ 8564.757843] CPU: 0 PID: 23458 Comm: kworker/u4:2 Not tainted 5.4.61+ #3
[ 8564.765197] Hardware name: Generic DT based system
[ 8564.770538] Workqueue: spi0 sunxi_spi_work
[ 8564.775123] [<c010e2f8>] (unwind_backtrace) from [<c010a874>] (show_stack+0x10/0x14)
[ 8564.783747] [<c010a874>] (show_stack) from [<c05ace30>] (dump_stack+0x7c/0x98)
[ 8564.791837] [<c05ace30>] (dump_stack) from [<c01c550c>] (warn_alloc+0xa0/0x154)
[ 8564.799985] [<c01c550c>] (warn_alloc) from [<c01c5e70>] (__alloc_pages_nodemask+0x878/0x8ac)
[ 8564.809375] [<c01c5e70>] (__alloc_pages_nodemask) from [<c01d1368>] (alloc_slab_page+0x24/0x5c)
[ 8564.819052] [<c01d1368>] (alloc_slab_page) from [<c01d1824>] (new_slab+0xdc/0x238)
[ 8564.827474] [<c01d1824>] (new_slab) from [<c01d2ae8>] (___slab_alloc.constprop.12+0x2e8/0x390)
[ 8564.837055] [<c01d2ae8>] (___slab_alloc.constprop.12) from [<c01d2bc4>] (__slab_alloc.constprop.11+0x34/0x40)
[ 8564.848086] [<c01d2bc4>] (__slab_alloc.constprop.11) from [<c01d2fb8>] (kmem_cache_alloc+0x98/0x174)
[ 8564.858253] [<c01d2fb8>] (kmem_cache_alloc) from [<c03624e0>] (sun6i_dma_prep_slave_sg+0x68/0x200)
[ 8564.868221] [<c03624e0>] (sun6i_dma_prep_slave_sg) from [<c03ef004>] (dmaengine_prep_slave_sg.constprop.9+0x38/0x48)
[ 8564.879930] [<c03ef004>] (dmaengine_prep_slave_sg.constprop.9) from [<c03f067c>] (sunxi_spi_config_dma_rx+0x1f0/0x298)
[ 8564.891830] [<c03f067c>] (sunxi_spi_config_dma_rx) from [<c03f079c>] (sunxi_spi_dma_rx_config+0x78/0x94)
[ 8564.902376] [<c03f079c>] (sunxi_spi_dma_rx_config) from [<c03f0ff0>] (sunxi_spi_work+0x58c/0x97c)
[ 8564.912252] [<c03f0ff0>] (sunxi_spi_work) from [<c012fd74>] (process_one_work+0x16c/0x20c)
[ 8564.921448] [<c012fd74>] (process_one_work) from [<c013033c>] (worker_thread+0x1fc/0x2dc)
[ 8564.930542] [<c013033c>] (worker_thread) from [<c0134b54>] (kthread+0x114/0x128)
[ 8564.938771] [<c0134b54>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 8564.946806] Exception stack(0xc6e05fb0 to 0xc6e05ff8)
[ 8564.952427] 5fa0:                                     00000000 00000000 00000000 00000000
[ 8564.961518] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 8564.970605] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 8564.977956] Mem-Info:
[ 8564.980490] active_anon:148 inactive_anon:1 isolated_anon:0
[ 8564.980490]  active_file:350 inactive_file:19749 isolated_file:0
[ 8564.980490]  unevictable:0 dirty:0 writeback:0 unstable:0
[ 8564.980490]  slab_reclaimable:660 slab_unreclaimable:1526
[ 8564.980490]  mapped:350 shmem:1 pagetables:27 bounce:0
[ 8564.980490]  free:3659 free_pcp:0 free_cma:1925
[ 8565.016051] Node 0 active_anon:592kB inactive_anon:4kB active_file:1400kB inactive_file:78996kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:1400kB dirty:0kB writeback:0kB shmem:4kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[ 8565.040730] Normal free:14636kB min:1336kB low:1668kB high:2000kB active_anon:572kB inactive_anon:4kB active_file:1400kB inactive_file:79136kB unevictable:0kB writepending:0kB present:131072kB managed:112884kB mlocked:0kB kernel_stack:408kB pagetables:108kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:7700kB
[ 8565.071295] lowmem_reserve[]: 0 0 0
[ 8565.075174] Normal: 60*4kB (UMC) 30*8kB (MEC) 15*16kB (UMC) 8*32kB (MEC) 17*64kB (MC) 12*128kB (MEC) 12*256kB (UMC) 4*512kB (MC) 2*1024kB (C) 2*2048kB (C) 0*4096kB = 14864kB
[ 8565.092420] Free pages count per migrate typeat order:     0      1      2      3      4      5      6      7      8      9     10
[ 8565.105574] zone   Normal, type    Unmovable      1      0      1      0      0      0      1      0      0      0      0
[ 8565.117871] zone   Normal, type      Movable     56     23     12      4     15      8      9      3      0      0      0
[ 8565.130202] zone   Normal, type  Reclaimable      0      1      0      2      0      2      0      0      0      0      0
[ 8565.142501] zone   Normal, type          CMA      3      6      2      2      2      2      2      1      2      2      0
[ 8565.154805] zone   Normal, type   HighAtomic      0      0      0      0      0      0      0      0      0      0      0
[ 8565.167104] zone   Normal, type      Isolate      0      0      0      0      0      0      0      0      0      0      0
[ 8565.179404] 20100 total pagecache pages
[ 8565.183665] 0 pages in swap cache
[ 8565.187346] Swap cache stats: add 0, delete 0, find 0/0
[ 8565.193149] Free swap  = 0kB
[ 8565.196342] Total swap = 0kB
[ 8565.199541] 32768 pages RAM
[ 8565.202637] 0 pages HighMem/MovableOnly
[ 8565.206894] 4547 pages reserved
[ 8565.210379] 2048 pages cma reserved
.41 ... [ 8565.215302] sunxi_spi_config_dma_rx()803 - [spi0] dmaengine_prep_slave_sg() failed!
[ 8570.286313] sunxi_spi_xfer()1406 - [spi0] xfer timeout
[ 8570.292146] sunxi-spinand-phy: clear cache
[ 8570.296853] sunxi-spinand: read single page failed: -1
[ 8570.302631] ubi0 warning: ubi_io_read: error -1 while reading 188 bytes from PEB 53:62680, read only 0 bytes, retry
[ 8579.134668] sunxi_spi_cpu_writel()1187 - [spi0] cpu transfer data time out!
[ 8584.206346] sunxi_spi_xfer()1406 - [spi0] xfer timeout
[ 8584.212929] sunxi-spinand: read single page failed: -1
[ 8584.218840] ubi0 warning: ubi_io_read: error -1 while reading 188 bytes from PEB 53:62680, read only 0 bytes, retry
[ 8593.052024] sunxi_spi_cpu_writel()1187 - [spi0] cpu transfer data time out!
[ 8598.126356] sunxi_spi_xfer()1406 - [spi0] xfer timeout
[ 8598.133018] sunxi-spinand: read single page failed: -1
[ 8598.138922] ubi0 warning: ubi_io_read: error -1 while reading 188 bytes from PEB 53:62680, read only 0 bytes, retry
[ 8606.972869] sunxi_spi_cpu_writel()1187 - [spi0] cpu transfer data time out!
[ 8612.057173] sunxi_spi_xfer()1406 - [spi0] xfer timeout
[ 8612.063842] sunxi-spinand: read single page failed: -1
[ 8612.069756] ubi0 error: ubi_io_read: error -1 while reading 188 bytes from PEB 53:62680, read 0 bytes
[ 8612.080147] CPU: 1 PID: 23376 Comm: rwcheck Not tainted 5.4.61+ #3
[ 8612.087023] Hardware name: Generic DT based system
[ 8612.092410] [<c010e2f8>] (unwind_backtrace) from [<c010a874>] (show_stack+0x10/0x14)
[ 8612.101088] [<c010a874>] (show_stack) from [<c05ace30>] (dump_stack+0x7c/0x98)
[ 8612.109187] [<c05ace30>] (dump_stack) from [<c03dca44>] (ubi_io_read+0x1e8/0x2d8)
[ 8612.117572] [<c03dca44>] (ubi_io_read) from [<c03daf74>] (ubi_eba_read_leb+0x1f8/0x2e8)
[ 8612.126487] [<c03daf74>] (ubi_eba_read_leb) from [<c03d9b54>] (ubi_leb_read+0x68/0xb0)
[ 8612.135345] [<c03d9b54>] (ubi_leb_read) from [<c0250500>] (ubifs_leb_read+0x28/0x70)
[ 8612.144017] [<c0250500>] (ubifs_leb_read) from [<c02519ec>] (ubifs_read_node+0xe0/0x214)
[ 8612.153075] [<c02519ec>] (ubifs_read_node) from [<c02694b0>] (ubifs_load_znode+0x98/0x3dc)
[ 8612.162324] [<c02694b0>] (ubifs_load_znode) from [<c025431c>] (ubifs_lookup_level0+0xf0/0x1bc)
[ 8612.171958] [<c025431c>] (ubifs_lookup_level0) from [<c0255a48>] (ubifs_tnc_next_ent+0x64/0x1c0)
[ 8612.181787] [<c0255a48>] (ubifs_tnc_next_ent) from [<c025b4b0>] (ubifs_add_orphan+0x64/0xd0)
[ 8612.191229] [<c025b4b0>] (ubifs_add_orphan) from [<c0245944>] (ubifs_jnl_update+0x28c/0x53c)
[ 8612.200678] [<c0245944>] (ubifs_jnl_update) from [<c024a494>] (ubifs_unlink+0x1b0/0x270)
[ 8612.209736] [<c024a494>] (ubifs_unlink) from [<c01e4ef0>] (vfs_unlink+0x64/0xf4)
[ 8612.218025] [<c01e4ef0>] (vfs_unlink) from [<c01e7998>] (do_unlinkat+0xe0/0x1ac)
[ 8612.226263] [<c01e7998>] (do_unlinkat) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[ 8612.234913] Exception stack(0xc6159fa8 to 0xc6159ff0)
[ 8612.240574] 9fa0:                   beab3a80 00000000 beab3a80 00000000 00000001 beab3a80
[ 8612.249716] 9fc0: beab3a80 00000000 00000000 0000000a 00009998 00000000 00000051 00000000
[ 8612.258851] 9fe0: 00023d74 beab3a6c b6ee0001 b6f257b6
[ 8612.264604] UBIFS error (ubi0:7 pid 23376): ubifs_leb_read: reading 188 bytes from LEB 55:58584 failed, error -1
[ 8612.276122] CPU: 1 PID: 23376 Comm: rwcheck Not tainted 5.4.61+ #3
[ 8612.283025] Hardware name: Generic DT based system
[ 8612.288421] [<c010e2f8>] (unwind_backtrace) from [<c010a874>] (show_stack+0x10/0x14)
[ 8612.297094] [<c010a874>] (show_stack) from [<c05ace30>] (dump_stack+0x7c/0x98)
[ 8612.305150] [<c05ace30>] (dump_stack) from [<c0250538>] (ubifs_leb_read+0x60/0x70)
[ 8612.313617] [<c0250538>] (ubifs_leb_read) from [<c02519ec>] (ubifs_read_node+0xe0/0x214)
[ 8612.322677] [<c02519ec>] (ubifs_read_node) from [<c02694b0>] (ubifs_load_znode+0x98/0x3dc)
[ 8612.331935] [<c02694b0>] (ubifs_load_znode) from [<c025431c>] (ubifs_lookup_level0+0xf0/0x1bc)
[ 8612.341575] [<c025431c>] (ubifs_lookup_level0) from [<c0255a48>] (ubifs_tnc_next_ent+0x64/0x1c0)
[ 8612.351405] [<c0255a48>] (ubifs_tnc_next_ent) from [<c025b4b0>] (ubifs_add_orphan+0x64/0xd0)
[ 8612.360839] [<c025b4b0>] (ubifs_add_orphan) from [<c0245944>] (ubifs_jnl_update+0x28c/0x53c)
[ 8612.370287] [<c0245944>] (ubifs_jnl_update) from [<c024a494>] (ubifs_unlink+0x1b0/0x270)
[ 8612.379342] [<c024a494>] (ubifs_unlink) from [<c01e4ef0>] (vfs_unlink+0x64/0xf4)
[ 8612.387630] [<c01e4ef0>] (vfs_unlink) from [<c01e7998>] (do_unlinkat+0xe0/0x1ac)
[ 8612.395867] [<c01e7998>] (do_unlinkat) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[ 8612.404516] Exception stack(0xc6159fa8 to 0xc6159ff0)
[ 8612.410176] 9fa0:                   beab3a80 00000000 beab3a80 00000000 00000001 beab3a80
[ 8612.419315] 9fc0: beab3a80 00000000 00000000 0000000a 00009998 00000000 00000051 00000000
[ 8612.428452] 9fe0: 00023d74 beab3a6c b6ee0001 b6f257b6
FAILED: Operation not permitted

从log可以分析出以下内容

  1. 内存大小,一共128M,只有一个内存结点Node 0和只有一个内存管理区zone Normal
//物理内存大小
[ 8565.199541] 32768 pages RAM//Node情况,只有一个Node 0
[ 8565.016051] Node 0 active_anon:592kB inactive_anon:4kB active_file:1400kB inactive_file:78996kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:1400kB dirty:0kB writeback:0kB shmem:4kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
...
//zone情况,只有Normal zone
[ 8565.075174] Normal: 60*4kB (UMC) 30*8kB (MEC) 15*16kB (UMC) 8*32kB (MEC) 17*64kB (MC) 12*128kB (MEC) 12*256kB (UMC) 4*512kB (MC) 2*1024kB (C) 2*2048kB (C) 0*4096kB = 14864kB//Normal zone区域的保留页数为0
[ 8565.071295] lowmem_reserve[]: 0 0 0
  1. 系统内存情况
[ 8565.040730] Normal free:14636kB min:1336kB low:1668kB high:2000kB active_anon:572kB inactive_anon:4kB active_file:1400kB inactive_file:79136kB unevictable:0kB writepending:0kB present:131072kB managed:112884kB mlocked:0kB kernel_stack:408kB pagetables:108kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:7700kB
[ 8565.071295] lowmem_reserve[]: 0 0 0
[ 8565.075174] Normal: 60*4kB (UMC) 30*8kB (MEC) 15*16kB (UMC) 8*32kB (MEC) 17*64kB (MC) 12*128kB (MEC) 12*256kB (UMC) 4*512kB (MC) 2*1024kB (C) 2*2048kB (C) 0*4096kB = 14864kB
[ 8565.092420] Free pages count per migrate typeat order:     0      1      2      3      4      5      6      7      8      9     10
[ 8565.105574] zone   Normal, type    Unmovable      1      0      1      0      0      0      1      0      0      0      0
[ 8565.117871] zone   Normal, type      Movable     56     23     12      4     15      8      9      3      0      0      0
[ 8565.130202] zone   Normal, type  Reclaimable      0      1      0      2      0      2      0      0      0      0      0
[ 8565.142501] zone   Normal, type          CMA      3      6      2      2      2      2      2      1      2      2      0
[ 8565.154805] zone   Normal, type   HighAtomic      0      0      0      0      0      0      0      0      0      0      0
[ 8565.167104] zone   Normal, type      Isolate      0      0      0      0      0      0      0      0      0      0      0
[ 8565.179404] 20100 total pagecache pages
[ 8565.183665] 0 pages in swap cache
[ 8565.187346] Swap cache stats: add 0, delete 0, find 0/0
[ 8565.193149] Free swap  = 0kB
[ 8565.196342] Total swap = 0kB
[ 8565.199541] 32768 pages RAM
[ 8565.202637] 0 pages HighMem/MovableOnly
[ 8565.206894] 4547 pages reserved
[ 8565.210379] 2048 pages cma reserved

从log可以看出,当前系统的空闲内存有14636kB,而系统的最高水位是2000kB,最低警戒水位为1336kB,低水位为1668kB,空闲cma内存为7700kB,为什么空闲内存比最低警戒水位多这么多,也无法分配出一个物理页面?

  1. 分配内存失败的堆栈
remove  : /mnt/UDISK/rwcheck.tmp[ 8564.746419] kworker/u4:2: page allocation failure: order:0, mode:0x800(GFP_NOWAIT), nodemask=(null)
[ 8564.757843] CPU: 0 PID: 23458 Comm: kworker/u4:2 Not tainted 5.4.61+ #3
[ 8564.765197] Hardware name: Generic DT based system
[ 8564.770538] Workqueue: spi0 sunxi_spi_work
[ 8564.775123] [<c010e2f8>] (unwind_backtrace) from [<c010a874>] (show_stack+0x10/0x14)
[ 8564.783747] [<c010a874>] (show_stack) from [<c05ace30>] (dump_stack+0x7c/0x98)
[ 8564.791837] [<c05ace30>] (dump_stack) from [<c01c550c>] (warn_alloc+0xa0/0x154)
[ 8564.799985] [<c01c550c>] (warn_alloc) from [<c01c5e70>] (__alloc_pages_nodemask+0x878/0x8ac)
[ 8564.809375] [<c01c5e70>] (__alloc_pages_nodemask) from [<c01d1368>] (alloc_slab_page+0x24/0x5c)
[ 8564.819052] [<c01d1368>] (alloc_slab_page) from [<c01d1824>] (new_slab+0xdc/0x238)
[ 8564.827474] [<c01d1824>] (new_slab) from [<c01d2ae8>] (___slab_alloc.constprop.12+0x2e8/0x390)
[ 8564.837055] [<c01d2ae8>] (___slab_alloc.constprop.12) from [<c01d2bc4>] (__slab_alloc.constprop.11+0x34/0x40)
[ 8564.848086] [<c01d2bc4>] (__slab_alloc.constprop.11) from [<c01d2fb8>] (kmem_cache_alloc+0x98/0x174)
[ 8564.858253] [<c01d2fb8>] (kmem_cache_alloc) from [<c03624e0>] (sun6i_dma_prep_slave_sg+0x68/0x200)
[ 8564.868221] [<c03624e0>] (sun6i_dma_prep_slave_sg) from [<c03ef004>] (dmaengine_prep_slave_sg.constprop.9+0x38/0x48)
[ 8564.879930] [<c03ef004>] (dmaengine_prep_slave_sg.constprop.9) from [<c03f067c>] (sunxi_spi_config_dma_rx+0x1f0/0x298)
[ 8564.891830] [<c03f067c>] (sunxi_spi_config_dma_rx) from [<c03f079c>] (sunxi_spi_dma_rx_config+0x78/0x94)
[ 8564.902376] [<c03f079c>] (sunxi_spi_dma_rx_config) from [<c03f0ff0>] (sunxi_spi_work+0x58c/0x97c)
[ 8564.912252] [<c03f0ff0>] (sunxi_spi_work) from [<c012fd74>] (process_one_work+0x16c/0x20c)
[ 8564.921448] [<c012fd74>] (process_one_work) from [<c013033c>] (worker_thread+0x1fc/0x2dc)
[ 8564.930542] [<c013033c>] (worker_thread) from [<c0134b54>] (kthread+0x114/0x128)
[ 8564.938771] [<c0134b54>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)

内核工作队列处理线程想分配一个物理页面(0阶),但是失败了,分配掩码是GFP_NOWAIT(0x800),从分配掩码看,没有设置ALLOC_CMA(slab分配,一般不会设置该标志),因此实际空闲的内存要减掉cma空闲部分,即14636kB-7700kB=6936kB,

内存分配失败堆栈分析如下图所示:

从页面分配失败流程看,在分配page时,分布使用了低水位、最低水位和支持异步回收机制来确保可以分配到页面,但在get_page_from_freelist()函数中,会调用到zone_watermark_fast()函数来判断当前zone水位是否可以分配出相应的page,如下图所示:

从水位掩码判断流程图看,除去cma空闲内存,剩下内存为14636kB-7700kB=6936kB,远超最低水位线和低水位线,但为什么还是会报出oom信息呢?

这里给出一个解析:

因为在sun6i_dma_prep_slave_sg,使用了GFP_NOWAIT(0x800),不允许直接回收内存,只能通过唤醒kswap进程进行异步回收,会存在在分配过程中,系统内存的水位线是不满足要求的,只是到分配内存失败,通过warn_alloc(gfp_mask, ac->nodemask,“page allocation failure: order:%u”, order)打印出相关内存信息时,可能kswap进程已经回收到一部分内存到空闲链表上了,因此打印出来的内存状态会相对好一些。

3. 解决方法

将kmalloc()申请内存的GFP掩码修改为GFP_KERNEL,替换原来的GFP_NOWAIT

kmalloc使用不当导致内存分配失败问题相关推荐

  1. 又一次内存分配失败(关于overcommit_memory)

    1.问题现象和分析: 测试时发现当系统中空闲内存还有很多时,就报内存分配失败了,所有进程都报内存分配失败: sshd@localhost:/var/log>free              t ...

  2. 内存分配失败错误处理

    一.C语言中的malloc/calloc/realloc/valloc/alloca/memalign函数: 这样的内存分配函数在内存分配失败时都返回空指针,因此,在调用返回时,检查返回值的方法比较简 ...

  3. python内存分配失败_关于python:如何避免[Errno 12]无法分配使用子进程模块导致的内存错误...

    完整的工作测试案例 当然,根据您在本地和远程计算机上的内存,您的阵列大小会有所不同. z1 = numpy.random.rand(300000000,2); for i in range(1000) ...

  4. 深入浅出内存管理--kmalloc支持的最大内存分配

    首先我们来看下kmalloc的实现,本文基于kernel 4.0版本: static __always_inline void *kmalloc(size_t size, gfp_t flags) { ...

  5. keilcjson内存分配失败_iOS标准库中常用数据结构和算法之内存池

    黑客技术点击右侧关注,了解黑客的世界! Java开发进阶点击右侧关注,掌握进阶之路! Linux编程点击右侧关注,免费入门到精通! 作者丨欧阳大哥2013https://www.jianshu.com ...

  6. c语言链表内存分配失败,链表的C语言实现之动态内存分配

    链表的C语言实现之动态内存分配 來源:互聯網  2008-06-01 02:05:07  評論 一.为什么用动态内存分配 但我们未学习链表的时候,假如要存储数量比较多的同类型或同结构的数据的时候,总是 ...

  7. 计算机可用内存分配失败,你们都被忽悠了! 其实可用内存大才有用

    [PConline 杂谈]随着这几年安卓手机的硬件快速升级,手机的运行内存(本文后续页面将"运行内存"简称为内存或者RAM)也越来越大,从最初的512M到1GB,再到现在主流的2G ...

  8. 计算机可用内存分配失败,安装内存和实际可用内存不一样什么原因

    通常我们安装内存条时候都有显示具体内存,但是有时出现安装内存和实际可用内存不一致?为什么会不一样呢?下面我们一起来看看其中的原因和解决方法. 一.你安装的不是64位Win7系统 Win7 32位只能识 ...

  9. C语言malloc动态分配内存分配失败怎么办?exit(OVERFLOW);(include <cstdlib>)

    如:(见<大话数据结构>147页) QueuePtr s = (QueuePtr)malloc(sizeof(QNode)); if(!s){exit(OVERFLOW); } exit为 ...

最新文章

  1. 线程池中keepAliveTime的理解
  2. 【TweenMax】实例TimelineMax
  3. [css] 如何隐藏没有静音、自动播放的音视频?
  4. ubuntu18.04下安装grafana6和简单使用
  5. Android插u盘自动执行,android tv box ---- 插入u盘直接播放指定文件夹中的视频
  6. 深入浅出理解HOG特征---梯度方向直方图
  7. Python——分布式监控项目
  8. 不要相信 errno 可靠
  9. VS2013 update4+Cocos2d-x 3.7 Win8下安装方法及配置
  10. linux 提取执行命令后的输出 shell脚本
  11. 基本遗传算法(GA)详解
  12. html5制作旋转正方体,如何制作一个旋转的正方体
  13. EN 10088 1.4006(X12Cr13)马氏体不锈钢硬度
  14. Java 中文转拼音/汉字转拼音, 中文转五笔/汉字转五笔, 下载字典!
  15. 人工智能在电力系统的典型应用有哪些
  16. 资讯汇总230207
  17. 龙光集团:“地王收割机”的近患与隐忧
  18. WinForm 子窗体 调用 父窗体 方法
  19. 线电压和相电压,线电流和相电流的关系
  20. 基于FPGA的MSK调制的仿真

热门文章

  1. 计算机三级考试中哪个更有价值?
  2. xmpp协议抓包_在MAC下基于Openfire和Spark的XMPP协议实现
  3. 使用百度API实现实时公交站点查询及列表显示
  4. 北京自贸区总体方案公布:建设法定数字货币试验区
  5. JVAV——网络编程UDP/TCP
  6. 02-Maven高级-分模块开发、依赖传递、聚合、继承(SpringBoot的部分底层原理)、多模块开发(环境切换)、Nexus私服搭建与使用
  7. die查壳工具 使用教程
  8. 智能视频抠图_‎App Store 上的“智能视频抠图: 一键去背景”
  9. 连续数值变量的离散化、哑变量
  10. 计算机网络(第三版)胡亮 课后习题一答案