Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skynet segfault #1818

Open
kaka5548 opened this issue Nov 2, 2023 · 3 comments
Open

skynet segfault #1818

kaka5548 opened this issue Nov 2, 2023 · 3 comments

Comments

@kaka5548
Copy link

kaka5548 commented Nov 2, 2023

遇到了skynet崩溃,ulimit -c是0因此没产生core 使用的skynet版本是v1.4.0
查看dmesg

[620052.716586] show_signal_msg: 24 callbacks suppressed
[620052.716588] Game[77327]: segfault at 9 ip 00005587f8c34bc8 sp 00007fad7bdf6b60 error 4 in Game[5587f8c22000+d1000]
[620052.716597] Code: 41 09 0b 49 83 c1 18 4d 39 ca 0f 86 8a 03 00 00 41 0f b6 41 09 41 0f b6 51 08 83 e0 40 f6 c2 0f 74 d8 84 c0 74 0e 49 8b 71 10 <f6> 46 09 18 0f 85 06 04 00 00 83 e2 40 74 ca 49 8b 31 f6 46 09 18

网上查的教程00005587f8c34bc8 - 5587f8c22000 得到 12bc8
使用addr2line可以获得

root@xxxx:/home/ubuntu/server_3/framework# addr2line -e Game 12bc8
/home/ubuntu/server_3/framework/skynet-src/skynet_server.c:485

查看源码skynet_server.c的485行是

static const char *
cmd_launch(struct skynet_context * context, const char * param) {
	size_t sz = strlen(param);
	char tmp[sz+1];                              //485行是这里
	strcpy(tmp,param);
	char * args = tmp;
	char * mod = strsep(&args, " \t\r\n");
	args = strsep(&args, "\r\n");
	struct skynet_context * inst = skynet_context_new(mod,args);
	if (inst == NULL) {
		return NULL;
	} else {
		id_to_hex(context->result, inst->handle);
		return context->result;
	}
}

@cloudwu
Copy link
Owner

cloudwu commented Nov 2, 2023

这里只是复制一个字符串到堆栈上,看不出什么问题。会不会是某种特殊情况下,启动新服务的参数贴别长?比如 >1M 。

@sniper00
Copy link
Contributor

sniper00 commented Nov 3, 2023

是否有特殊字符,导致strlen返回不正确的长度

@huahua132
Copy link
Contributor

是否是自己编译安装的gcc,有可能是编译器的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants