cube-1.3's People
Forkers
pengfcb chuxiaoxia jienaever heiheigao 1226768464 knightlf twoconk zyq634455388 functfan walter180 dempsey1983 zhousimple lijinyang-paxl mine-brz yanrbts chuandou2021cube-1.3's Issues
hello运行不成功!
这是我的目录:
root@ggc:/home/ggc/cube-1.3/proc/main# ls
base_define cube_exec.c envset_proc.c lib_tool main_proc.c read_config.c
cube_audit.log envset_func.c instance.def lib_tool.c main_proc_func.h read_config.o
cube_err.log envset_func.o lib main_config.cfg Makefile
cube_exec envset_proc lib_rw.c main_proc message.log
这是我在我创建的hello目录下运行的结果,为什会这样?
root@ggc:/home/ggc/hello# ls
main_config.cfg plugin_config.cfg
root@ggc:/home/ggc/hello# ./home/ggc/cube-1.3/proc/main/main_proc
bash: ./home/ggc/cube-1.3/proc/main/main_proc: No such file or directory
root@ggc:/home/ggc/hello#
coredump好多,凌乱了,第三章基于cube的密码算法演示系统总是跑不成功
Missing separate debuginfos, use: debuginfo-install glibc-2.17-307.el7.1.x86_64
(gdb) bt
#0 0x00007ffff657fb4e in Memcpy (dest=0x7fffb5cc6020, src=0x7fffec0dc3f4, count=775130017) at memfunc.c:34
#1 0x00007ffff6d9f617 in _elem_set_bin_value (addr=0x7fffec0dc640, data=0x7fffec0dc3f4, elem=0x696570) at struct_init.c:780
#2 0x00007ffff6d9bbda in proc_blob_2_struct (addr=0x7fffec0dc640, data=0x7fffec0dc3c0, elem=0x696570, para=0x7ffff6fa3b8c <my_para.2655>)
at struct_deal.c:873
#3 0x00007ffff6d9a3d8 in _convert_frame_func (addr=0x7fffec0dc640, data=0x7fffec0dc3c0, struct_template=0x6963a0, funcs=0x7ffff557cb40,
para=0x7ffff6fa3b8c <my_para.2655>) at struct_deal.c:151
#4 0x00007ffff6d9bc63 in blob_2_struct (blob=0x7fffec0dc3c0, addr=0x7fffec0dc640, struct_template=0x6963a0) at struct_deal.c:889
#5 0x00007ffff73bde2f in message_get_record (message=0x7fffec0dc2a0, msg_record=0x7ffff557cc08, record_no=0) at message.c:1798
#6 0x00007ffff73bc8b8 in message_load_record (message=0x7fffec0dc2a0) at message.c:966
#7 0x00007ffff598a131 in message_read_from_conn (message=0x7ffff557de48, conn=0x7fffec0008d0) at connector_process_func.c:122
#8 0x00007ffff598ae66 in proc_conn_start (sub_proc=0x6a2570, para=0x0) at connector_process_func.c:560
#9 0x00007ffff79d209d in _ex_module_passpara (pointer=0x6a5f20) at ex_module.c:488
#10 0x00007ffff6167ea5 in start_thread () from /usr/lib64/libpthread.so.0
#11 0x00007ffff5c8c8dd in clone () from /usr/lib64/libc.so.6
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff557e700 (LWP 17538)]
0x00007ffff637d4f3 in Free (pointer=0x0) at alloc.c:221
221 switch(mem_head->type)
Missing separate debuginfos, use: debuginfo-install glibc-2.17-307.el7.1.x86_64
(gdb) bt
#0 0x00007ffff637d4f3 in Free (pointer=0x0) at alloc.c:221
#1 0x00007ffff6d9b712 in proc_struct_free (addr=0x7fffec153080, data=0x0, elem=0x696570, para=0x0) at struct_deal.c:715
#2 0x00007ffff6d9a3d8 in _convert_frame_func (addr=0x7fffec153080, data=0x0, struct_template=0x6963a0, funcs=0x7ffff557cb40, para=0x0)
at struct_deal.c:151
#3 0x00007ffff6d9b780 in struct_free (addr=0x7fffec153080, struct_template=0x6963a0) at struct_deal.c:729
#4 0x00007ffff73bde69 in message_get_record (message=0x7fffec152ce0, msg_record=0x7ffff557cc08, record_no=0) at message.c:1801
#5 0x00007ffff73bc8b8 in message_load_record (message=0x7fffec152ce0) at message.c:966
#6 0x00007ffff598a131 in message_read_from_conn (message=0x7ffff557de48, conn=0x7fffec0008d0) at connector_process_func.c:122
#7 0x00007ffff598ae66 in proc_conn_start (sub_proc=0x6a2570, para=0x0) at connector_process_func.c:560
#8 0x00007ffff79d209d in _ex_module_passpara (pointer=0x6a5f20) at ex_module.c:488
#9 0x00007ffff6167ea5 in start_thread () from /usr/lib64/libpthread.so.0
#10 0x00007ffff5c8c8dd in clone () from /usr/lib64/libc.so.6
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff557e700 (LWP 21765)]
0x00007ffff6fa81dd in connector_get_type (connector=0x0) at connector.c:157
157 return this_conn->conn_type;
(gdb) bt
#0 0x00007ffff6fa81dd in connector_get_type (connector=0x0) at connector.c:157
#1 0x00007ffff598b38d in proc_conn_start (sub_proc=0x6a2570, para=0x0) at connector_process_func.c:740
#2 0x00007ffff79d209d in _ex_module_passpara (pointer=0x6a5f30) at ex_module.c:488
#3 0x00007ffff6167ea5 in start_thread () from /usr/lib64/libpthread.so.0
#4 0x00007ffff5c8c8dd in clone () from /usr/lib64/libc.so.6
(gdb) p this_conn
$1 = (struct tcloud_connector *) 0x0
(gdb)
Program received signal SIGTERM, Terminated.
0x00007ffff6169017 in pthread_join () from /usr/lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install glibc-2.17-307.el7.1.x86_64
(gdb) bt
#0 0x00007ffff6169017 in pthread_join () from /usr/lib64/libpthread.so.0
#1 0x00007ffff79d2225 in ex_module_join (ex_mod=0x6a56c0, retval=0x6a6650) at ex_module.c:559
#2 0x00000000004020e7 in main (argc=1, argv=0x7fffffffe058) at main_proc.c:334
Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7ffff537b700 (LWP 23211)]
0x00007ffff616e6fd in write () from /usr/lib64/libpthread.so.0
(gdb) bt
#0 0x00007ffff616e6fd in write () from /usr/lib64/libpthread.so.0
#1 0x00007ffff6fa9bec in connector_af_inet_write (connector=0x6a3850, buf=0x7fffec1ba600, count=1005) at connector_inet.c:888
#2 0x00007ffff598a1c4 in message_send (message=0x7fffdc0a1800, conn=0x6a3850) at connector_process_func.c:143
#3 0x00007ffff598b43a in proc_conn_start (sub_proc=0x6a2570, para=0x0) at connector_process_func.c:764
#4 0x00007ffff79d209d in _ex_module_passpara (pointer=0x6ab660) at ex_module.c:488
#5 0x00007ffff6167ea5 in start_thread () from /usr/lib64/libpthread.so.0
#6 0x00007ffff5c8c8dd in clone () from /usr/lib64/libc.so.6
(gdb)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff537b700 (LWP 24726)]
0x00007ffff73ba8f0 in message_get_flag (message=0x0) at message.c:84
84 return msg_box->head.flag;
Missing separate debuginfos, use: debuginfo-install glibc-2.17-307.el7.1.x86_64
(gdb) bt
#0 0x00007ffff73ba8f0 in message_get_flag (message=0x0) at message.c:84
#1 0x00007ffff598a115 in message_read_from_conn (message=0x7ffff537ae48, conn=0x6a3850) at connector_process_func.c:119
#2 0x00007ffff598ad2b in proc_conn_start (sub_proc=0x6a2570, para=0x0) at connector_process_func.c:525
#3 0x00007ffff79d209d in _ex_module_passpara (pointer=0x6ab660) at ex_module.c:488
#4 0x00007ffff6167ea5 in start_thread () from /usr/lib64/libpthread.so.0
#5 0x00007ffff5c8c8dd in clone () from /usr/lib64/libc.so.6
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff537b700 (LWP 25468)]
0x00007ffff71b2db4 in memdb_get_template (type=1, subtype=1) at memdb_init.c:711
711 return db_list->struct_template;
(gdb) bt
#0 0x00007ffff71b2db4 in memdb_get_template (type=1, subtype=1) at memdb_init.c:711
#1 0x00007ffff73bca30 in message_load_expand (message=0x7fffec2c0980) at message.c:1026
#2 0x00007ffff598a161 in message_read_from_conn (message=0x7ffff537ae48, conn=0x6a3850) at connector_process_func.c:129
#3 0x00007ffff598ad32 in proc_conn_start (sub_proc=0x6a2570, para=0x0) at connector_process_func.c:525
#4 0x00007ffff79d209d in _ex_module_passpara (pointer=0x6ab660) at ex_module.c:488
#5 0x00007ffff6167ea5 in start_thread () from /usr/lib64/libpthread.so.0
#6 0x00007ffff5c8c8dd in clone () from /usr/lib64/libc.so.6
(gdb) p db_list
$1 = (struct memdb_desc *) 0x0
(gdb)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff537b700 (LWP 26204)]
0x00007ffff5ccdb70 in __strncmp_sse42 () from /usr/lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-307.el7.1.x86_64
(gdb) bt
#0 0x00007ffff5ccdb70 in __strncmp_sse42 () from /usr/lib64/libc.so.6
#1 0x00007ffff6faae65 in hub_get_connector_byreceiver (hub=0x6a26b0, uuid=0x0, name=0x7fffdc000c48 "sender_crypthub", service=0x0)
at connect_message.c:59
#2 0x00007ffff598b3dd in proc_conn_start (sub_proc=0x6a2570, para=0x0) at connector_process_func.c:746
#3 0x00007ffff79d209d in _ex_module_passpara (pointer=0x6ab660) at ex_module.c:488
#4 0x00007ffff6167ea5 in start_thread () from /usr/lib64/libpthread.so.0
#5 0x00007ffff5c8c8dd in clone () from /usr/lib64/libc.so.6
(gdb)
ubuntu16.04.6, gcc 5.4.0 编译报错
make -C string; make -C alloc; make -C basefunc; make -C json; make -C crypto; make -C struct_mod; make -C memdb; make -C message; make -C dispatch; make -C ex_module; make -C connector; make -C channel; make -C sys_func;
make[1]: Entering directory '/home/shareData/Yu/cube-1.3/cubelib/string'
gcc -g -c -fPIC -Wall -DUSER_MODE memfunc.c
memfunc.c: In function ‘Memcpy’:
memfunc.c:31:20: warning: pointer targets in initialization differ in signedness [-Wpointer-sign]
unsigned char * d=(char *)dest;
^
memfunc.c:32:20: warning: pointer targets in initialization differ in signedness [-Wpointer-sign]
unsigned char * s=(char *)src;
^
我截了部分错误。错误原因是我的gcc版本问题么?
read error: Resource temporarily unavailable 和 Segmentation fault (core dumped)
/Cube/cube-tcm-master/vtcm_emulator# ./main_proc
mkdir: cannot create directory ‘lib’: File exists
vtcm init !
test server listen,return value is 0!
vtcm_key_init :
tcm_permanent_data->revMajor abc
vtcm_store_init :
vtcm_auth_init :
vtcm_switch_init :
vtcm_pcr module start!
vtcm_store module start!
vtcm_nv module start!
vtcm_switch module start!
vtcm_auth module start!
vtcm_state module start!
vtcm_key module start!
create a new channel 0x7fd5f40008d0!
build channel to 127.0.0.1:56486 !
peer close
error: server connector accept error (nil)!
create a new channel 0x7fd5f4000a90!
build channel to 127.0.0.1:17576 !
read error: Resource temporarily unavailable
/Cube/cube-tcm-master/vtcm_utils# ./main_proc
mkdir: cannot create directory ‘lib’: File exists
begin vtcm_input start!
Wait for the tcm command input!
readpubek
Begin readpubek:
00 c1 00 00 00 2a 00 00
80 7c c7 2c dc ff 60 5c
77 aa 8d 62 f9 66 bd ec
a7 eb c2 8a 06 cf 6d 18
88 65 fc 89 1d 33 e6 e9
c1 ee
Segmentation fault (core dumped)
请问这是什么问题?
ex_module_tryjoin可能会导致core dump
函数中有一处代码是这样写的:
ret=pthread_tryjoin_np(ex_module->proc_thread,&thread_return);
ex_module->retval=*thread_return;
*retval=*thread_return;
这里pthread_tryjoin_np是不阻塞的,所以返回时thread_return可能没有赋值,应该改成下面这种:
ret=pthread_tryjoin_np(ex_module->proc_thread,&thread_return);
if(ret == 0){
ex_module->retval=*thread_return;
*retval=*thread_return;
}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.