Debug

共 105 篇文章。

报应来的真快……

• Development

不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!不要在放代码而且没有串口的机器上测试代码!!

阅读全文… ( 本文约 538 字,阅读大致需要 2 分钟 )

诡异的freetype2问题

• Development

今天帮同事调一个程序。

问题:服务器,FreeBSD 6.2上,某程序速度是一台配置较低的笔记本上的Ubuntu的大约1/10。

折腾许久,手工改了一堆port,发现没作用。遂祭出ktrace,发现那个程序十分不理性地mmap一个中文ttf文件;将字体改为英文的,则速度一样。另一个诡异的问题是,使用中文字体会疯狂吃内存。

然后改了freetype2,令其不使用mmap,发现不再出现不理性的内存占用了,速度提高10倍。

阅读全文… ( 本文约 356 字,阅读大致需要 1 分钟 )

PRS_NEW: Check it or not?

• Kernel

It seems that I have caught a race condition which can be triggered by renice(1), and we need to take PRS_NEW into account when we need to access several attributes of a process object.

Robert has pointed out that we may want to just initialize the attribute early to avoid the race condition. After reading some old 4.4BSD code it seems that the process object is linked into allproc list *before* everything is initialized.

阅读全文… ( 本文约 97 字,阅读大致需要 1 分钟 )

请教各位网络高手一个问题

• Networking

我有一件事情没想明白。

简单地说是这样:

有两个节点A、B。这两个节点的IP地址位于同一网段,并且,它们到目的节点D所走的网关地址相同。两台机器使用同样的作业系统,TCP/IP协议栈配置除了IP地址完全相同。

阅读全文… ( 本文约 172 字,阅读大致需要 1 分钟 )

if_ioctl的锁问题?

• Kernel

今天尝试了一下触发zonelim的方法,不过zonelim没搞出来,却发现了另一个问题——如果并发执行ifconfig配置同一块网卡,似乎有由于欠锁导致的断言失败。打算找时间研究一下。

参与评论

调试进行时

• Development

昨天深夜被李逵同学的电话叫醒,被告知新上线的一个Python应用发生了一个回归问题——一个使用了C模块的程序经常自己退出。

由于这个C模块已经几年没有改过了,加上没有coredump文件,因此调试起来非常困难。另一方面,我们的代码也是一行没改,因此很难确定到底是什么出了问题。李逵坚持认为这个问题是由于Python的编译配置不当引起的。天地良心……编译配置就是之前的配置,不过我还是想办法重编了一套,后来听这家伙说,他没有选pymalloc。

阅读全文… ( 本文约 449 字,阅读大致需要 1 分钟 )

Bug fixed in rss.js

• Development

It turns out that just doing a substring “invalid” search within the XML DOM’s responseText is silly and I have replaced it with an explicit compare. This is still imperfect, though, but fairly bullet-proof as I added an “invalid” in recent blog which caused the RSS reader to consider the feed itself is invalid :-(

参与评论