请教gdb调试问题

时间:2021-06-23 15:32:48
使用gdb调试,出现"utils.c:1058: internal-error: virtual memory exhausted: can't allocate 20003770
bytes.",请教这是什么问题引起的?

GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix5.1.0.0"...
Core was generated by `gamesrv'.
Program terminated with signal 11, Segmentation fault.
utils.c:1058: internal-error: virtual memory exhausted: can't allocate 20003770
bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
......

13 个解决方案

#1


虚拟内存用光了,不能再分配内存了,有内存泄露?

#2


可能有一些内存泄露,但应该不多,不至于把虚拟内存用光吧

#3


要么就是你一下分配的内存块太大了,没有这么大的空闲内存块了

#4


3ky,有可能,我再检查下程序

#5


内存泄露  应该是

#6


core的原因是定义了一个较大的字符数组,后来改用动态分配char *p = (char *)malloc( num * sizeof(char));
发现也会core,请问如何动态分配较大的内存?多谢

#7


gdb自己的问题。升级版本。

#8


gdb要升级到哪个版本?
不过程序也有问题,定义了过大字符数组导致core

#9


系统有问题了,磁盘空间或者内存用完了,也可能是gdb没有装好,重装一下试试

#10


引用楼主 yyhabc698 的帖子:
使用gdb调试,出现"utils.c:1058: internal-error: virtual memory exhausted: can't allocate 20003770 bytes.",

20M,不算太大
这个参考一下:
http://topic.csdn.net/t/20050223/10/3799850.html

#11


mark

#12


引用 8 楼 yyhabc698 的回复:
gdb要升级到哪个版本?
不过程序也有问题,定义了过大字符数组导致core

程序没问题就不需要gdb了:)

试试升级到gdb6.8?

#13


同学习!

#1


虚拟内存用光了,不能再分配内存了,有内存泄露?

#2


可能有一些内存泄露,但应该不多,不至于把虚拟内存用光吧

#3


要么就是你一下分配的内存块太大了,没有这么大的空闲内存块了

#4


3ky,有可能,我再检查下程序

#5


内存泄露  应该是

#6


core的原因是定义了一个较大的字符数组,后来改用动态分配char *p = (char *)malloc( num * sizeof(char));
发现也会core,请问如何动态分配较大的内存?多谢

#7


gdb自己的问题。升级版本。

#8


gdb要升级到哪个版本?
不过程序也有问题,定义了过大字符数组导致core

#9


系统有问题了,磁盘空间或者内存用完了,也可能是gdb没有装好,重装一下试试

#10


引用楼主 yyhabc698 的帖子:
使用gdb调试,出现"utils.c:1058: internal-error: virtual memory exhausted: can't allocate 20003770 bytes.",

20M,不算太大
这个参考一下:
http://topic.csdn.net/t/20050223/10/3799850.html

#11


mark

#12


引用 8 楼 yyhabc698 的回复:
gdb要升级到哪个版本?
不过程序也有问题,定义了过大字符数组导致core

程序没问题就不需要gdb了:)

试试升级到gdb6.8?

#13


同学习!