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

[讨论]: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 4203 (Thread-32) #3

Open
waruqi opened this issue Jun 9, 2017 · 1 comment

Comments

@waruqi
Copy link
Member

waruqi commented Jun 9, 2017

你好,ruki:

我想在android里面使用tbox的http功能,目前发现一个问题,操作步骤是这样的:

第一步:关闭wifi开关,并关机
第二步:开机,并打开wifi,接着会自动出发我的程序
第三步:我的程序里面通过tb_http_open发起一个http请求

这是,tb_dns_server_get函数的tb_assertf(ok, "no server!"); 地方会报段错误:

04-28 08:51:24.886: E/tbox(2288): [f36ff930]: [tbox]: [http_option]: option: version: HTTP/1.1
04-28 08:51:24.888: E/tbox(2288): [f36ff930]: [tbox]: [http_option]: option: method: POST
04-28 08:51:24.888: E/tbox(2288): [f36ff930]: [tbox]: [http_option]: option: redirect: 10
04-28 08:51:24.889: E/tbox(2288): [f36ff930]: [tbox]: [http_option]: option: range: 0-0
04-28 08:51:24.889: E/tbox(2288): [f36ff930]: [tbox]: [http_option]: option: bunzip: false
04-28 08:51:24.889: E/tbox(2288): [f36ff930]: [tbox]: [http_option]: 
04-28 08:51:24.889: E/tbox(2288): [f36ff930]: [tbox]: [http]: connect: ..
04-28 08:51:24.889: E/tbox(2288): [f36ff930]: [tbox]: [dns_server]: [warning]: no faster server at tb_dns_server_sort(): 458, src/tbox/network/dns/server.c
04-28 08:51:24.892: E/tbox(2288): [f36ff930]: [tbox]: [dns_server]: [assert]: expr[ok]: no server! at tb_dns_server_get(): 508, src/tbox/network/dns/server.c
04-28 08:51:24.892: E/tbox(2288): [f36ff930]: [tbox]: [dns_server]: [error]: abort at tb_dns_server_get(): 508, src/tbox/network/dns/server.c
04-28 08:51:24.892: E/tbox(2288): --------- beginning of crash
04-28 08:51:24.892: A/libc(2288): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 4203 (Thread-32)
04-28 08:51:25.002: A/AEE/DEBUG(4208): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

注:此贴来自老论坛。。

@waruqi
Copy link
Member Author

waruqi commented Jun 9, 2017

应该是 android 获取 dns server 失败了。。debug下触发了assert,被tbox主动abort了

你可以初始化的地方 调用 tb_dns_server_add("8.8.8.8");

手动添加几个 dns server 的 ip试试,后续有时间我会完善对android下的dns server获取

谢谢 😄

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

No branches or pull requests

1 participant