通过set substitute-path
(优先使用)
set substitute-path from to
路径替换,适用于debug中的路径是绝对路径
通过directory
命令
directory dirname ...
适用于debug中的路径是相对路径
set substitute-path
(优先使用)set substitute-path from to
路径替换,适用于debug中的路径是绝对路径
directory
命令directory dirname ...
适用于debug中的路径是相对路径
1 | // Author: QianChenglong <qian_cheng_long@163.com> |
1 | gcc main.cpp -ggdb3 |
1 | [I] wallace@centos:/m/s/W/p/B/p/B/t/m/lib64_debug-true (dev)> nm --debug-syms libmysqlclient.so|grep "\.debug_info" |
file
not stripped
=> Debugstripped
=> Release
1 | [I] wallace@centos:/m/s/W/p/B/p/B/t/m/lib64_debug (dev)> file libmysqlclient.so |
1 | [I] wallace@centos:/m/s/W/p/B/p/B/t/m/lib64_debug (dev)> ar t libmysqlclient.a client.c.o |
如何使用合数的的话?产生冲突的概率更大!如10=2*5(合数本身的性质)
ALGOL 60
首届图灵奖
快排
哲学家进餐
ALGOL
世界上第一台存储程序式电子计算机EDSAC(第一台冯诺依曼体系结构计算机)
变址,宏指令,微程序,子例程,高速缓冲存储器
该连接超过空闲等待时间(wait_timeout
,默认8小时),服务端主动关闭该连接,此时客户端再执行query,则mysql client返回该错误。
设置mysql wait_timeout
为5s,方便复现
set global wait_timeout=5;
客户端首先建立好连接
18:07:19.831124 IP localhost.46740 > localhost.mysql: Flags [S], seq 424450064, win 43690, options [mss 65495,sackOK,TS val 357860862 ecr 0,nop,wscale 7], length 0
18:07:19.831158 IP localhost.mysql > localhost.46740: Flags [S.], seq 2970334829, ack 424450065, win 43690, options [mss 65495,sackOK,TS val 357860862 ecr 357860862,nop,wscale 7], length 0
18:07:19.831179 IP localhost.46740 > localhost.mysql: Flags [.], ack 1, win 342, options [nop,nop,TS val 357860862 ecr 357860862], length 0
...
5s后,发现服务端主动断开连接(关闭了),服务端关闭了写通道
18:07:24.902120 IP localhost.mysql > localhost.46740: Flags [F.], seq 233, ack 704, win 350, options [nop,nop,TS val 357865933 ecr 357860968], length 0
18:07:24.943661 IP localhost.46740 > localhost.mysql: Flags [.], ack 234, win 342, options [nop,nop,TS val 357865974 ecr 357865933], length 0
[I] wallace@centos:/m/s/W/p/B/p/b/B/judge_server> ss -aon|grep 3306
tcp CLOSE-WAIT 1 0 127.0.0.1:46739 127.0.0.1:3306 timer:(keepalive,120min,0)
tcp LISTEN 0 80 :::3306 :::*
tcp FIN-WAIT-2 0 0 ::ffff:127.0.0.1:3306 ::ffff:127.0.0.1:46739 timer:(timewait,56sec,0)
观看连接状态,发现服务端socket状态已变为`FIN-WAIT-2`,60s后超时关闭,服务端socket关闭连接后;
此后客户端进入了半连接状态,若客户端继续发送数据,则会收到`RST`,客户端读返回-1,errno=ECONNRESET,
`mysql connector c`会将该错误作为`CR_SERVER_LOST`
客户端发送数据
18:13:23.289923 IP localhost.46740 > localhost.mysql: Flags [P.], seq 704:737, ack 234, win 342, options [nop,nop,TS val 358224321 ecr 357865933], length 33
18:13:23.289935 IP localhost.mysql > localhost.46740: Flags [R], seq 2970335063, win 0, length 0
gdb源码跟踪(mysql-connector-c-6.1.5-src
)
sql-common/client.c:957
1 | ulong |
Breakpoint 3, cli_safe_read_with_ok (mysql=0xb99e80, read_ok=0 '\000') at /media/sf_E_DRIVE/Soft/mysql-connector/mysql-connector-c-6.1.5-src/sql-common/client.c:976
976 set_mysql_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ?
(gdb) bt
#0 cli_safe_read_with_ok (mysql=0xb99e80, read_ok=0 '\000') at /media/sf_E_DRIVE/Soft/mysql-connector/mysql-connector-c-6.1.5-src/sql-common/client.c:976
#1 0x00000000004183da in cli_safe_read (mysql=0xb99e80) at /media/sf_E_DRIVE/Soft/mysql-connector/mysql-connector-c-6.1.5-src/sql-common/client.c:1047
#2 0x0000000000421f0b in cli_read_query_result (mysql=0xb99e80) at /media/sf_E_DRIVE/Soft/mysql-connector/mysql-connector-c-6.1.5-src/sql-common/client.c:4711
#3 0x000000000042275c in mysql_real_query (mysql=0xb99e80, query=0x59c2db "SELECT age, name FROM test.a", length=28)
at /media/sf_E_DRIVE/Soft/mysql-connector/mysql-connector-c-6.1.5-src/sql-common/client.c:4802
#4 0x000000000040ad7b in mysql::Connection::Query (this=0xba01d0, sql=...) at Beme4wdServer/lily/mysql/connection.cpp:89
2016-08-26 stdarg.h
在封装redisCommand
中,传递va_list
后,执行后,重试逻辑,再次传递va_list
,内存崩溃。
从一个现有仓储建立纯仓库
git clone --bare ssh://git@github.com:22/QianChenglong/home.git home.git
从.git目录复制https://git.wiki.kernel.org/index.php/GitFaq#How_do_I_make_existing_non-bare_repository_bare.3F
scp -rv .git dev2:~/git/Beme4wdServer.git
cd Beme4wdServer.git/
git config --bool core.bare true
从本地目录
git clone file:///path/to/repo.git/
修改远程URL
git remote set-url origin ssh://wallace@dev2:36000/~/git/home.git
查看远程信息
git remote -v
git remote show origin
从远程仓库取数据,不合并分支
git fetch [remote-name]
push所有分支和tag,并跟踪
git push --all origin -u
添加可执行权限
git update-index --chmod=+x config_server
标识已纳入版本的文件不必跟踪变化
git update-index --assume-unchanged <files>
git update-index --no-assume-unchanged <files>(撤销)
git ls-files -v(小写字母说明设置了该标志位)
查看所有分支
git branch
查看分支详情,最后一次commit
git branch -v
查看当前已经合并的分支
git branch --merged
查看当前没有合并的分支
git branch --no-merged
新建分支
git branch testing
切换分支
git checkout testing
新建分支并切换
git checkout -b issue53
删除分支
git branch -d hotfix
设置跟踪分支
git branch --set-upstream-to=origin/master master
添加模块
git submodule add ssh://wallace@dev2.beme.com:36000/~/git/ssh.git .ssh
修改url
vim .gitmodule
git submodule sync
初始化
git submodule init
更新
git submodule update
取消未暂存的修改
git checkout -- <file>...
功能:
从HEAD拷贝到INDEX(重置暂存区),若指定PATH(文件名),则只操作指定文件(这种情况下,最好使用git checkout -- <paths>
)
git reset
将HEAD指定到COMMIT
git reset [<mode>] <commit>
–mixed [默认] INDEX同HEAD一起更新到<commit>
,WORK不变
–soft INDEX,WORK保持不变,HEAD更新到<commit>
–hard INDEX,WORK同HEAD一起更新到<commit>
恢复到指定commit,是复制指定commit并使HEAD指向它
重做上次提交,并使用上次提交信息
git commit --amend --no-edit
从INDEX删除,但保留工作目录里面的
git rm --cached <paths>
强制删除已修改已暂存的文件(当前暂存区与上次提交的不一样)
git rm -f <paths>
从INDEX,WORK中删除
git rm <paths>
查看当前版本与上一版本的差异
git diff HEAD~1 HEAD functions/fish_prompt.fish
查看暂存版本与工作目录中的差异
git diff
查看暂存与上一次提交的差异
git diff --cached
查看commit之间的差异
git diff <commit1> <commit2> <path>
配置解包内存
git config --global pack.windowMemory 256m
查看配置
git config --list
同步home
git init
git remote add origin ssh://wallace@112.74.81.30:36000/~/git/home.git
git fetch
git reset --hard origin/master
初始化并递归更新submodule
git submodule update --init --recursive
停止防火墙
systemctl stop firewalld.service
禁用防火墙
systemctl disable firewalld.service
放行端口
firewall-cmd –permanent –add-port=80/tcp
firewall-cmd –reload