oftc注册服务器占用,golang服务器程序运行过程中崩溃,报错:fatal error: runtime: out of memory...

用golang编写的游戏服务器程序,在接受来自客户端的链接请求时有一定概率崩溃,崩溃时的打印如下:

fatal error: runtime: out of memory

runtime stack:

runtime.throw(0x81b890, 0x16)

/usr/local/go/src/runtime/panic.go:527 +0x90

runtime.sysMap(0xc8530d0000, 0x72730000, 0x9b8f00, 0x9d7b58)

/usr/local/go/src/runtime/mem_linux.go:203 +0x9b

runtime.mHeap_SysAlloc(0x9b8f00, 0x72730000, 0xc820000a80)

/usr/local/go/src/runtime/malloc.go:426 +0x160

runtime.mHeap_Grow(0x9b8f00, 0x39398, 0x0)

/usr/local/go/src/runtime/mheap.go:628 +0x63

runtime.mHeap_AllocSpanLocked(0x9b8f00, 0x39394, 0xc82009edc0)

/usr/local/go/src/runtime/mheap.go:532 +0x5f1

runtime.mHeap_Alloc_m(0x9b8f00, 0x39394, 0xffffff0100000000, 0xc820037ec8)

/usr/local/go/src/runtime/mheap.go:425 +0x1ac

runtime.mHeap_Alloc.func1()

/usr/local/go/src/runtime/mheap.go:484 +0x41

runtime.systemstack(0xc820037ee0)

/usr/local/go/src/runtime/asm_amd64.s:278 +0xab

runtime.mHeap_Alloc(0x9b8f00, 0x39394, 0x10100000000, 0xc82009e000)

/usr/local/go/src/runtime/mheap.go:485 +0x63

runtime.largeAlloc(0x72726f4c, 0xc800000001, 0x44fcc0)

/usr/local/go/src/runtime/malloc.go:748 +0xb3

runtime.mallocgc.func3()

/usr/local/go/src/runtime/malloc.go:637 +0x33

runtime.systemstack(0xc82001e000)

/usr/local/go/src/runtime/asm_amd64.s:262 +0x79

runtime.mstart()

/usr/local/go/src/runtime/proc1.go:668

goroutine 211 [running]:

runtime.systemstack_switch()

/usr/local/go/src/runtime/asm_amd64.s:216 fp=0xc820040890 sp=0xc820040888

runtime.mallocgc(0x72726f4c, 0x6ef040, 0x1, 0xc852bbe630)

/usr/local/go/src/runtime/malloc.go:638 +0x9c4 fp=0xc820040960 sp=0xc820040890

runtime.newarray(0x6ef040, 0x72726f4c, 0x40d5e6)

/usr/local/go/src/runtime/malloc.go:780 +0xc9 fp=0xc8200409a0 sp=0xc820040960

runtime.makeslice(0x6e1a80, 0x72726f4c, 0x72726f4c, 0x0, 0x0, 0x0)

/usr/local/go/src/runtime/slice.go:32 +0x165 fp=0xc8200409f0 sp=0xc8200409a0

github.com/chronicaww/gomsg.SingleRead(0xc84daaa798, 0x0, 0x0, 0x0, 0x0)

/Users/chronicaww/gopath/src/github.com/chronicaww/gomsg/msg.go:197 +0x69d fp=0xc820040cc0 sp=0xc8200409f0

_/Users/chronicaww/gitspace/moeMobileServer/player.readMsg(0xc84daaa798, 0xc850756cc0)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:91 +0x189 fp=0xc820040db0 sp=0xc820040cc0

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start(0xc8200e0ea0, 0xc84daaa798, 0xc82001c1e0, 0xc82001c240, 0xc8200a4150, 0x10, 0x10, 0x4e2b, 0x0, 0x0, ...)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:55 +0x371 fp=0xc820040f48 sp=0xc820040db0

main.acceptNewConn(0xc84daaa798)

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:133 +0xab fp=0xc820040fa8 sp=0xc820040f48

runtime.goexit()

/usr/local/go/src/runtime/asm_amd64.s:1721 +0x1 fp=0xc820040fb0 sp=0xc820040fa8

created by main.main

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:103 +0x6d5

goroutine 1 [IO wait]:

net.runtime_pollWait(0x7f31ebaae0d0, 0x72, 0xc8200101c0)

/usr/local/go/src/runtime/netpoll.go:157 +0x60

net.(*pollDesc).Wait(0xc820047a30, 0x72, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a

net.(*pollDesc).WaitRead(0xc820047a30, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:78 +0x36

net.(*netFD).accept(0xc8200479d0, 0x0, 0x7f31ebaae5a0, 0xc852bb2400)

/usr/local/go/src/net/fd_unix.go:408 +0x27c

net.(*TCPListener).AcceptTCP(0xc82002a058, 0x873b08, 0x0, 0x0)

/usr/local/go/src/net/tcpsock_posix.go:254 +0x4d

main.main()

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:102 +0x6b3

goroutine 17 [IO wait, 414 minutes]:

net.runtime_pollWait(0x7f31ebaae010, 0x72, 0xc8200101c0)

/usr/local/go/src/runtime/netpoll.go:157 +0x60

net.(*pollDesc).Wait(0xc8200a6300, 0x72, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a

net.(*pollDesc).WaitRead(0xc8200a6300, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:78 +0x36

net.(*netFD).accept(0xc8200a62a0, 0x0, 0x7f31ebaae5a0, 0xc8200b01c0)

/usr/local/go/src/net/fd_unix.go:408 +0x27c

net.(*TCPListener).AcceptTCP(0xc8200b2010, 0xa, 0x0, 0x0)

/usr/local/go/src/net/tcpsock_posix.go:254 +0x4d

main.manage(0x7531)

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:118 +0x159

created by main.main

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:68 +0x1ec

goroutine 5 [select]:

_/Users/chronicaww/gitspace/moeMobileServer/glog.(*Log).processMsg(0xc8200ce000)

/Users/chronicaww/gitspace/moeMobileServer/glog/player.go:136 +0x310

created by _/Users/chronicaww/gitspace/moeMobileServer/glog.GetLogInstance

/Users/chronicaww/gitspace/moeMobileServer/glog/player.go:85 +0x428

goroutine 6 [select]:

_/Users/chronicaww/gitspace/moeMobileServer/playerlist.(*PlayerList).processMsg(0x9b11c0)

/Users/chronicaww/gitspace/moeMobileServer/playerlist/playerlist.go:48 +0x2c7

created by _/Users/chronicaww/gitspace/moeMobileServer/playerlist.(*PlayerList).Start

/Users/chronicaww/gitspace/moeMobileServer/playerlist/playerlist.go:33 +0x128

goroutine 201 [select]:

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).process(0xc8205b85b0)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:112 +0x338

created by _/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:52 +0x317

goroutine 200 [IO wait]:

net.runtime_pollWait(0x7f31ebaadb90, 0x72, 0xc8200101c0)

/usr/local/go/src/runtime/netpoll.go:157 +0x60

net.(*pollDesc).Wait(0xc84ddb7fe0, 0x72, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a

net.(*pollDesc).WaitRead(0xc84ddb7fe0, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:78 +0x36

net.(*netFD).Read(0xc84ddb7f80, 0xc852bbe600, 0x8, 0x8, 0x0, 0x7f31ebaa8050, 0xc8200101c0)

/usr/local/go/src/net/fd_unix.go:232 +0x23a

net.(*conn).Read(0xc82002afb0, 0xc852bbe600, 0x8, 0x8, 0x8, 0x0, 0x0)

/usr/local/go/src/net/net.go:172 +0xe4

github.com/chronicaww/gomsg.SingleRead(0xc82002afb0, 0x0, 0x0, 0x0, 0x0)

/Users/chronicaww/gopath/src/github.com/chronicaww/gomsg/msg.go:168 +0x106

_/Users/chronicaww/gitspace/moeMobileServer/player.readMsg(0xc82002afb0, 0xc8502b4ae0)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:91 +0x189

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start(0xc8205b85b0, 0xc82002afb0, 0xc82001c1e0, 0xc82001c240, 0xc8200a4150, 0x10, 0x10, 0x4e2b, 0x0, 0x0, ...)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:55 +0x371

main.acceptNewConn(0xc82002afb0)

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:133 +0xab

created by main.main

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:103 +0x6d5

goroutine 196 [IO wait, 3 minutes]:

net.runtime_pollWait(0x7f31ebaadf50, 0x72, 0xc8200101c0)

/usr/local/go/src/runtime/netpoll.go:157 +0x60

net.(*pollDesc).Wait(0xc82049b8e0, 0x72, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a

net.(*pollDesc).WaitRead(0xc82049b8e0, 0x0, 0x0)

/usr/local/go/src/net/fd_poll_runtime.go:78 +0x36

net.(*netFD).Read(0xc82049b880, 0xc820353dc0, 0x8, 0x8, 0x0, 0x7f31ebaa8050, 0xc8200101c0)

/usr/local/go/src/net/fd_unix.go:232 +0x23a

net.(*conn).Read(0xc82002a0a8, 0xc820353dc0, 0x8, 0x8, 0x8, 0x0, 0x0)

/usr/local/go/src/net/net.go:172 +0xe4

github.com/chronicaww/gomsg.SingleRead(0xc82002a0a8, 0x0, 0x0, 0x0, 0x0)

/Users/chronicaww/gopath/src/github.com/chronicaww/gomsg/msg.go:168 +0x106

_/Users/chronicaww/gitspace/moeMobileServer/player.readMsg(0xc82002a0a8, 0xc8203942a0)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:91 +0x189

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start(0xc8200e0340, 0xc82002a0a8, 0xc82001c1e0, 0xc82001c240, 0xc8200a4150, 0x10, 0x10, 0x4e2b, 0x0, 0x0, ...)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:55 +0x371

main.acceptNewConn(0xc82002a0a8)

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:133 +0xab

created by main.main

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:103 +0x6d5

goroutine 197 [select]:

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).process(0xc8200e0340)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:112 +0x338

created by _/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:52 +0x317

goroutine 198 [runnable]:

time.Sleep(0xc350)

/usr/local/go/src/runtime/time.go:59 +0xf9

github.com/chronicaww/gomsg.SingleRead(0xc82002af70, 0x0, 0x0, 0x0, 0x0)

/Users/chronicaww/gopath/src/github.com/chronicaww/gomsg/msg.go:177 +0xb9b

_/Users/chronicaww/gitspace/moeMobileServer/player.readMsg(0xc82002af70, 0xc84dd3df80)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:91 +0x189

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start(0xc8200afee0, 0xc82002af70, 0xc82001c1e0, 0xc82001c240, 0xc8200a4150, 0x10, 0x10, 0x4e2b, 0x0, 0x0, ...)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:55 +0x371

main.acceptNewConn(0xc82002af70)

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:133 +0xab

created by main.main

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:103 +0x6d5

goroutine 199 [select]:

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).process(0xc8200afee0)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:112 +0x338

created by _/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:52 +0x317

goroutine 209 [running]:

goroutine running on other thread; stack unavailable

created by main.main

/Users/chronicaww/gitspace/moeMobileServer/moeMobile.go:103 +0x6d5

goroutine 210 [select]:

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).process(0xc8200ae000)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:112 +0x338

created by _/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:52 +0x317

goroutine 212 [select]:

_/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).process(0xc8200e0ea0)

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:112 +0x338

created by _/Users/chronicaww/gitspace/moeMobileServer/player.(*Player).Start

/Users/chronicaww/gitspace/moeMobileServer/player/player.go:52 +0x317

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/534389.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

联想服务器重装2008,联想ThinkSystem机器安装2008R2详细教程

联想ThinkSystem机器安装2008R2详细教程猫先生 • 2019 年 04 月 13 日自联想发布新品服务器以来,关于新品机器能否安装2008的声音此起彼伏尤其是阵列卡的驱动让众多尝试安装的人折了腰,现在我将整个安装过程做个详细的教程,希望能帮到各位工…

win7制作ntp服务器,如何将Win7作为NTP服务器

1. 修改注册表项HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServerEnabled 设定为 1(默认0)HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags 设定为 5 (默认 10)ValueMeaning0linuxTimeserv_Announc…

华为服务器部署项目,服务器部署项目

弹性云服务器 ECS弹性云服务器(Elastic Cloud Server)是一种可随时自助获取、可弹性伸缩的云服务器,帮助用户打造可靠、安全、灵活、高效的应用环境,确保服务持久稳定运行,提升运维效率三年低至5折,多种配置可选了解详情用户数据注…

VM安装虚拟机及其破解密码

学习散记 一,简单的了解一下操作系统 1、操作系统是什么? 操作系统(Operating System,简称OS)是管理和控制计算机硬件与软件资源的计算机程序,是配置在计算机硬件上的第一层软件,任何其它软件都…

RHCSA第一天

1,VMware Workstation Pro 界面(老铁们,下面就看图吧 1,2题如下 3,4题如下 5,6题如下 破解root密码精简版: 1、重启虚拟机 2、在linux16末尾加上 rd.break,ctrlx执行 3、mount -o remount,…

RHCSA第二天

第二次作业 1、使用思维导图工具画出linux的文件系统层级结构图(其中要指出不同文件的文件类型且简要说明不同文件的作用) 2、总结出vim的三个模式中你认为实用的命令 这款挺好用! 第一题 第二题 Linux vi/vim 所有的 Unix Like 系统都会…

RHCSA第三天

1、在根下创建一个目录ceshi,在测试目录下创建一个user目录,将/etc/passwd和/etc/shadow文件复制到/ceshi/user目录中,给/ceshi//user/passwd文件创建一个硬链接文件为passwd.bak,给/ceshi/user/shadow文件创建一个软链接为sh.lin…

RHCSA第四天

废话不说,直接上! 第一题 保存退出。 第二题 密码简单,需要输入两次方可成功。 第三题 第四题 第五题

MySQL学习(1)

简述MySQL体系结构 Mysql是由SQL接口,解析器,优化器,缓存,存储引擎组成的 Connectors指的是不同语言中与SQL的交互 Management Serveices & Utilities: 系统管理和控制工具 Connection Pool: 连接池。管理缓冲用户…

MySQL学习(2)

1、使用源码安装MySQL 5.7 1、安装开发工具和开发包 yum install makegcc gcc-c cmake bison-devel ncurses-devel -y yum install libaio libaio-devel openssl-devel -y yum install perl-Data-Dumper -y yum install net-tools -y 2、编译安装MySQL 1)解压 [r…

MySQL学习(3)单表查询

素材如下: DROP TABLE IF EXISTS course; CREATE TABLE course ( cs_id int(11) NOT NULL COMMENT 课程编号, cs_name varchar(50) NOT NULL COMMENT 课程名称, cs_credit tinyint(255) unsigned DEFAULT NULL COMMENT 课程学分, cs_type char(12) DEFAULT NULL C…

MySQL学习(4)多表查询

1.创建student和score表 CREATE TABLE student ( id INT(10) NOT NULL UNIQUE PRIMARY KEY , name VARCHAR(20) NOT NULL , sex VARCHAR(4) , birth YEAR, department VARCHAR(20) , address VARCHAR(50) ); 创建score表。SQL代码如下: CRE…

MySQL学习(5)数据库备份

数据库备份,数据库为school,素材如下 1.创建student和score表 CREATE TABLE student ( id INT(10) NOT NULL UNIQUE PRIMARY KEY , name VARCHAR(20) NOT NULL , sex VARCHAR(4) , birth YEAR, department VARCHAR(20) , address …

MySQL(查看数据文件目录)

show global variables like %datadir%;

mysql在rpm安装方式下查看随机生成密码命令

mysql安装成功后创建的超级用户rootlocalhost的密码会被存储在/var/log/mysqld.log grep temporary password /var/log/mysqld.log

MySQL(6)视图

步骤1:创建学生表stu,插入3条记录。 CREATE TABLE stu ( s_id INT PRIMARY KEY, s_name VARCHAR(20), addr VARCHAR(50), tel VARCHAR(50) ); INSERT INTO stu VALUES(1,XiaoWang,Henan,0371-12345678), (2,XiaoLi,Hebei,13889072345), (3…

MySQL(7)索引

表结构如下: writers表结构 字段名 数据类型 主键 外键 非空 唯一 自增 w_id SMALLINT(11) 是 否 是 是 是 w_name VARCHAR(255) 否 否 是 否 否 w_address VARCHAR(255) 否 否 否 否 否 w_age CHAR(2) 否 否 是 否 否 w_note VARCHAR(255) 否 否 否 否 否 …

MySQL(8)存储过程和函数

字段名 数据类型 主键 外键 非空 唯一 自增 id INT 是 否 是 是 否 name VARCHAR(50) 否 否 是 否 否 glass VARCHAR(50) 否 否 是 否 否 mysql> create table sch (-> id int primary key not null unique,-> name varchar(5…

MySQL(9)主从复制和读写分离

1.理解MySQL主从复制原理。 复制是MySQL提供的一直高可用、高性能的解决方案,一般用来建立大型的应用,总体来说,分为以下三步: (1)master将改变记录到二进制日志(binary log)中(这些记录叫做二进制日志事件&#x…

NoSQL(1)

1、简述redis应用场景。 Redis 概念:Redis(Remote Dictionary Server),即远程字典服务,是用C语言开发的一个开源的高性能键值对(key-value)数据库。特征: 数据间没有必然的联系内部…