由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - $5000 reward to find a bug
相关主题
Re: Lehman Brothers C++ programmer interviewC++里面把数转成字符串的命令是啥啊?
发现ramdisk不错,多个进程通信用文件就可以了,简单what's wrong with this scripts?variable passing?
when should use multiprocess not multithread: embedded mult (转载)how to print 2 exponential digits in windows by using Perl
The WhatsApp Architecture关于文件命名
问一个思路:如何创建并监听虚拟网卡[合集] 如何只用putchar来实现itoa?
inline functions in C++Mysterious PgSQL 8.3 crash
科普贴,fusion IOvi一问 (转载)
怎样中断一个正在等待的Java线程比较好?C语言一个passing variable的问题
相关话题的讨论汇总
话题: bug话题: find话题: 5000话题: 代码话题: reward
进入Programming版参与讨论
1 (共1页)
s*********1
发帖数: 103
1
小弟有一用c 写的代码,100 多行, very similar to the active mq or rabbit mq.
运行几天都没问题, 但种是自动断掉,找不到原因。求高手help to debug.
If you could find where the problem is, i will reward $5000 to you through
paypal.
Please private message me.
S*A
发帖数: 7142
2
你的 C 代码有大概多少行?
s*********1
发帖数: 103
3
总共两个文件,一个发送,一个接收,各一百多行。

【在 S*A 的大作中提到】
: 你的 C 代码有大概多少行?
S*A
发帖数: 7142
4
两个文件 100 多行你真的愿意出 5000 USD 来调个 bug?

【在 s*********1 的大作中提到】
: 总共两个文件,一个发送,一个接收,各一百多行。
r*a
发帖数: 1503
5
贴到stackoverflow上去吧!
w***g
发帖数: 5958
6
别逗了。100多行的话直接贴上来免费给你看。
自动断掉这种事情可能不是bug。如果是长时间保持TCP连接的话断掉很正常,断了重连
就是。

【在 s*********1 的大作中提到】
: 小弟有一用c 写的代码,100 多行, very similar to the active mq or rabbit mq.
: 运行几天都没问题, 但种是自动断掉,找不到原因。求高手help to debug.
: If you could find where the problem is, i will reward $5000 to you through
: paypal.
: Please private message me.

m********s
发帖数: 55301
7
你把钱打进壹基金先。
3天之内解决不了,就退给你。

【在 s*********1 的大作中提到】
: 小弟有一用c 写的代码,100 多行, very similar to the active mq or rabbit mq.
: 运行几天都没问题, 但种是自动断掉,找不到原因。求高手help to debug.
: If you could find where the problem is, i will reward $5000 to you through
: paypal.
: Please private message me.

m********t
发帖数: 13072
8
明显是富二代,这个是期末project,lz恐怕要过不去这个关了,所以花多少钱都干了。
学校肯定是3流以下的, 我记得这个mini-ftp,做socket server和socket client的
,是我当年第一堂课的作业,
我骄傲的拿了满分。。。period

【在 m********s 的大作中提到】
: 你把钱打进壹基金先。
: 3天之内解决不了,就退给你。

s*********1
发帖数: 103
9
这代码不是我写的,是我公司一个有7年工作经验的engineer写的。
He currently can not find the bug, but the code is for production, every
minute interruption would potentially cause big loss of the company though
it's not happened yet. 5000 USD actually would save a lot of money instead
of hiring a good engineer specifically working on this every day. Our HR
already start looking for an engineer regarding this matter from today.

【在 S*A 的大作中提到】
: 两个文件 100 多行你真的愿意出 5000 USD 来调个 bug?
s*********1
发帖数: 103
10
Just tried, due to that's the first time to use, the question box only allow
60,000 characters for one question, the total code has 63,000 characters,
looks like there are too much trouble to post a long code.

【在 r*a 的大作中提到】
: 贴到stackoverflow上去吧!
相关主题
inline functions in C++C++里面把数转成字符串的命令是啥啊?
科普贴,fusion IOwhat's wrong with this scripts?variable passing?
怎样中断一个正在等待的Java线程比较好?how to print 2 exponential digits in windows by using Perl
进入Programming版参与讨论
s*********1
发帖数: 103
11
I just added the code in my original post.
"断了重连就是。"----- it only take one minute to reconnect, but one minute
interruption could cause significant damage at the business side.

【在 w***g 的大作中提到】
: 别逗了。100多行的话直接贴上来免费给你看。
: 自动断掉这种事情可能不是bug。如果是长时间保持TCP连接的话断掉很正常,断了重连
: 就是。

s*********1
发帖数: 103
12
"我骄傲的拿了满分"----hope you could help.

了。

【在 m********t 的大作中提到】
: 明显是富二代,这个是期末project,lz恐怕要过不去这个关了,所以花多少钱都干了。
: 学校肯定是3流以下的, 我记得这个mini-ftp,做socket server和socket client的
: ,是我当年第一堂课的作业,
: 我骄傲的拿了满分。。。period

N******K
发帖数: 10202
13
你用的是 long lived TCP connection 吗?

with

【在 s*********1 的大作中提到】
: 小弟有一用c 写的代码,100 多行, very similar to the active mq or rabbit mq.
: 运行几天都没问题, 但种是自动断掉,找不到原因。求高手help to debug.
: If you could find where the problem is, i will reward $5000 to you through
: paypal.
: Please private message me.

o**o
发帖数: 3964
14
我上学的时候写过个TFTP server和client
卖给你算了。不过不是科班哦

with

【在 s*********1 的大作中提到】
: 小弟有一用c 写的代码,100 多行, very similar to the active mq or rabbit mq.
: 运行几天都没问题, 但种是自动断掉,找不到原因。求高手help to debug.
: If you could find where the problem is, i will reward $5000 to you through
: paypal.
: Please private message me.

A*********l
发帖数: 2005
15
简单瞄了一眼。
这个很难就说是这个文件里的bug。这个文件里还引用了其他的文件/库,没法保证不是
其他文件/库的问题。
这个code有些地方让人看着挺害怕的。比方说,用了catch(...),在C++里,这个本身就
是需要极力避免的。
单纯就这个程序来看,catch了所有的异常,然后让程序回到循环的开始重新运行,这
个也很不靠谱。都不知道异常是什么,是否是recoverable的异常,就这么就回去开始
再循环一次。
string fund_account_string 不知道到底有多长(可能程序员知道不会超过多少个字
符,但是code里看不到对长度的检查。然后后面就这样用这个string:
char szParam[128];
sprintf(szParam, "issue_type:%d,acc_info:%s", 12, fund_account_string.c_
str());
这都是很危险的做法。
还有比如在一个循环里面做 strcat(ansData, xxxx); 一次循环做4遍,做iCol次,也
不查字符串会不会越界。
基本上见不到defensive programming的痕迹。直接造成你想修复的问题的根源也许在
这些问题里,也许不在,但是这样的程序很难稳定。

【在 s*********1 的大作中提到】
: 这代码不是我写的,是我公司一个有7年工作经验的engineer写的。
: He currently can not find the bug, but the code is for production, every
: minute interruption would potentially cause big loss of the company though
: it's not happened yet. 5000 USD actually would save a lot of money instead
: of hiring a good engineer specifically working on this every day. Our HR
: already start looking for an engineer regarding this matter from today.

n*****t
发帖数: 22014
16
init, connect 什么的都是用其他库,说是 100 行,其实估计几千行都有

【在 A*********l 的大作中提到】
: 简单瞄了一眼。
: 这个很难就说是这个文件里的bug。这个文件里还引用了其他的文件/库,没法保证不是
: 其他文件/库的问题。
: 这个code有些地方让人看着挺害怕的。比方说,用了catch(...),在C++里,这个本身就
: 是需要极力避免的。
: 单纯就这个程序来看,catch了所有的异常,然后让程序回到循环的开始重新运行,这
: 个也很不靠谱。都不知道异常是什么,是否是recoverable的异常,就这么就回去开始
: 再循环一次。
: string fund_account_string 不知道到底有多长(可能程序员知道不会超过多少个字
: 符,但是code里看不到对长度的检查。然后后面就这样用这个string:

S*A
发帖数: 7142
17
这个调用了很多其他的代码,所以看上去不止100行。
代码多也不是问题。就我粗略看了一下。
你很多 memcpy 和 strcpy, strcat 都没有string size 保护的。
这个人家传个大点的 string 你就被人家 buffer overflow 了。
搞不好被人远程黑进去了都有可能的。
szValue 读入的函数都没有参数指定 szValue 可以有多长。
说明你的其他调用的函数设计也不是很仔细。问题很可能不仅
仅是这个文件里有。
h*h
发帖数: 27852
18
这个100多行,是怎么数的?
D***n
发帖数: 6804
19
这种bug 在科学计算中经常遇到,成千上万的结果中有一个和其他的不一样。你这个算
比较简单的,因为不一样后就结束了。
光看通常是猜不出来的,如果看程序就能看出来就不会运行好几天没事了。
这个说白了就是你需要知道如何在哪里插入printf的技巧,并不困难。

with

【在 s*********1 的大作中提到】
: 小弟有一用c 写的代码,100 多行, very similar to the active mq or rabbit mq.
: 运行几天都没问题, 但种是自动断掉,找不到原因。求高手help to debug.
: If you could find where the problem is, i will reward $5000 to you through
: paypal.
: Please private message me.

s*********1
发帖数: 103
20
Thanks for the valuable comment, sounds like you do have some experience and
good programming principal. would you like to help more on this matter?
please PM me if you would.

【在 A*********l 的大作中提到】
: 简单瞄了一眼。
: 这个很难就说是这个文件里的bug。这个文件里还引用了其他的文件/库,没法保证不是
: 其他文件/库的问题。
: 这个code有些地方让人看着挺害怕的。比方说,用了catch(...),在C++里,这个本身就
: 是需要极力避免的。
: 单纯就这个程序来看,catch了所有的异常,然后让程序回到循环的开始重新运行,这
: 个也很不靠谱。都不知道异常是什么,是否是recoverable的异常,就这么就回去开始
: 再循环一次。
: string fund_account_string 不知道到底有多长(可能程序员知道不会超过多少个字
: 符,但是code里看不到对长度的检查。然后后面就这样用这个string:

相关主题
关于文件命名vi一问 (转载)
[合集] 如何只用putchar来实现itoa?C语言一个passing variable的问题
Mysterious PgSQL 8.3 crasheasy problem coconut
进入Programming版参与讨论
D*****r
发帖数: 6791
21
首先,这是cpp程序,不是c程序。
其次,你贴这些就300行了,不是100多行吧。
最主要的,这里面用了6个头文件,还不算zmq.h这个不知道是不是开源的。似乎没有办
法debug调试。
只能靠肉眼看和编写模拟程序来调试。
最最关键的,你还不贴全。太气人了。

with
730;
123"
.1
;&
SendSubscribe error!\n");
LEN);
get Response message,%s\n",
send Response message,%s\n",
get platform return!\n");
Received reply : [%s],entrust_no
]\
730;Ϣ
error!\n");
;[
&#
..
c_

【在 s*********1 的大作中提到】
: 小弟有一用c 写的代码,100 多行, very similar to the active mq or rabbit mq.
: 运行几天都没问题, 但种是自动断掉,找不到原因。求高手help to debug.
: If you could find where the problem is, i will reward $5000 to you through
: paypal.
: Please private message me.

s*********1
发帖数: 103
22
那对不起,我估计行数错了。已改了。

【在 D*****r 的大作中提到】
: 首先,这是cpp程序,不是c程序。
: 其次,你贴这些就300行了,不是100多行吧。
: 最主要的,这里面用了6个头文件,还不算zmq.h这个不知道是不是开源的。似乎没有办
: 法debug调试。
: 只能靠肉眼看和编写模拟程序来调试。
: 最最关键的,你还不贴全。太气人了。
:
: with
: 730;
: 123"

p**2
发帖数: 613
23
我个人感觉你还是把整个package丢online storage然后share吧,
这样看太累了。
btw,那个月光妹妹是个纯傻逼,
她说任何话你就当放屁没看见就好了。
s*********6
发帖数: 20
24
可以在freelancer里开个contest, 我猜会很多人bit。
s*********6
发帖数: 20
25
:while (SendSubscribe(HlpHandle, FUNC_SUBSCIBE) != 0)
:{
: printf("SendSubscribe error!");
: WRITE_LOG(LogName,LOG_LEVEL_MAIN, "SendSubscribe error!\n");
: sleep(1);
:}
这个地方应该检查具体的返回值,有些情况下是要求重新连接服务器的。
简单的sleep(1)可能会陷入死循环。
b*d
发帖数: 75
26
tell your HR this guy need to find another job now.
lol.and i am serious.

【在 s*********1 的大作中提到】
: 这代码不是我写的,是我公司一个有7年工作经验的engineer写的。
: He currently can not find the bug, but the code is for production, every
: minute interruption would potentially cause big loss of the company though
: it's not happened yet. 5000 USD actually would save a lot of money instead
: of hiring a good engineer specifically working on this every day. Our HR
: already start looking for an engineer regarding this matter from today.

j******o
发帖数: 4219
27
很难想象有7年工作经验的engineer会写出这样的烂代码。基本上网络协议都是不可靠
的,可能你的线路本身有问题。如果你要维持稳定的连接的话,改用一般的IPC吧。
S*A
发帖数: 7142
28
没有用的,公司现在还靠这个人维护这些代码。
人都没有了,连能明白点烂代码的人都没有,
跑起来摊掉谁负责。现在只是重启服务而已,
好歹比摊掉强。
至少要找到接盘的下家能维护这个代码再说。

【在 b*d 的大作中提到】
: tell your HR this guy need to find another job now.
: lol.and i am serious.

1 (共1页)
进入Programming版参与讨论
相关主题
C语言一个passing variable的问题问一个思路:如何创建并监听虚拟网卡
easy problem coconutinline functions in C++
请教Matlab和IDL的处理数据能力差异科普贴,fusion IO
two general C++ question怎样中断一个正在等待的Java线程比较好?
Re: Lehman Brothers C++ programmer interviewC++里面把数转成字符串的命令是啥啊?
发现ramdisk不错,多个进程通信用文件就可以了,简单what's wrong with this scripts?variable passing?
when should use multiprocess not multithread: embedded mult (转载)how to print 2 exponential digits in windows by using Perl
The WhatsApp Architecture关于文件命名
相关话题的讨论汇总
话题: bug话题: find话题: 5000话题: 代码话题: reward