Debug

共 105 篇文章。

bsd.port.mk: critical issue for RELENG_6

• Development

Today I have submitted a PR which I have marked “critical”. bsd.port.mk does not do the right thing on RELENG_6 after the rcorder change, which will cause all ports installed rc.d scripts stop to function at system startup.

The PR can be accessed here: https://www.freebsd.org/cgi/query-pr.cgi?pr=93536

UPDATE(20060219): It seems that the problem is not related to this. I am still investigating what was happening.

UPDATE(20060220): Doug Barton has kindly provided information about the issue. It was because some nojail and mountcritlocal conflict. The issue can only appear when you are using jail(8).

参与评论

FreeBSD的uuid处理小问题

• Development

似乎在处理>和<时,和 DCE 不太一样,改天写个test case看看。


Archived: trackbacks

生成UUID from 2006 Penguin, smashing time! on February 4, 2006 11:36 PM

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#include <stdio.h>
#include <uuid.h>
main() {
  uuid_t *uuid;
  char *s;
  uuid = (uuid_t*)malloc(sizeof(uuid_t));
  uuidgen(uuid,1);
  uuid_to_string(uuid,&s,NULL);
  printf("%s\\n",s);
}

一个很简单的生成UUID的例子。… Read More

参与评论

Bug in Python re implementation?

• Development

Python includes a Regular Expression implementation, called re. However, I thought that I have hit a bug.

The following regular expression is apparantly wrong, but Python spend much CPU time to give a mismatch:

_mailcheck = re.compile("^(\w|.){3,25}$")
_mailcheck.match(“foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo”)

I think the “.” would override anything (including “\w”), but this does not happen…

参与评论

BerkeleyDB使用中的cache同步问题

• Development

今天被一个程序折腾了很久。大致的流程是这样:

事件处理:

  • 打开db文件,如果已经打开,直接使用该handle
  • 获得排他锁,并读某一key对应的value
  • 根据value和一些环境信息以及事件所附带的输入计算新的value
  • 更新value,并同步文件、释放排他锁

锁的机制没有大毛病,可是数据死活不对。

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

Lazy blog updates

• Life

In the last month we were busy working to repair the current system at corporation to make sure it would not get worse. Work range from in-depth code review, kernel debugging, to fix data hard disk driver by hand, etc. I am pleased to say that the situation was greatly improved.

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

Linux threading bug

• Kernel

A collegue of mine has reported a FreeBSD “bug” that, when the main thread exits, the whole process is terminated. He complained that pthread_detach() would not cause the thread to run without the main thread, while Linux did.

With some experiments we have figured out that this is actually a Linux bug, which violates POSIX. Interestingly, Solaris has the same behavior that FreeBSD have.

The POSIX pthread_create() said:

Note that the thread in which main() was originally invokeddiffers from this. When it returns from main(), the effectshall be as if there was an implicit call to exit() usingthe return value of main() as the exit status."

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

Signal in init(8)?!

• Kernel

Strange thing happen.

  1. Start your FreeBSD single-user.
  2. Run /etc/netstart so your network is up.
  3. Run /etc/rc.d/sshd start so you have sshd
  4. Use ssh to login localhost, then su(1) to root
  5. Type “init q”

Then init(8) would crash with signal 11. Yes, it was killed. As soon as kernel found this, it would panic with “Going nowhere without my init!”.

参与评论

李逵 vs 盘阵

• Hardware

快被盘阵折腾得精疲力尽的delphij和quakelee总算看到了一点曙光——quakelee同学总算在周五晚上把盘阵搞死了。

今天他说盘阵终于进入了调试界面。不管怎么说,困扰我们许久的盘阵的问题,总算是有了一点眉目。不知道台北普安科技(InfoTrend)的工程师是否能看出些端倪并修正firmware。但愿如此,我已经把我的MSN头像换成关公了。

参与评论