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.pswp.cn/news/534389.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/534389.shtml
英文地址,請注明出處:http://en.pswp.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)數據庫。特征: 數據間沒有必然的聯系內部…