Ten Years

十年一剑!
-------------------------------------------------
Operating System Research / Technique

Thursday, September 28, 2006

启动VNC服务

前一段时间在搭建VNC的环境,使用方面有点问题,今天查了一下,在FC2上搞定了。特此记录。

FC2安装时选上vncserver,然后启动vncserver服务:
$ service vncserver start
Starting VNC server: [ OK ]
然后设置密码:
$ vncpasswd
Password:
Verify:
运行vncserver,可以加上参数“:2”之类指定桌面号:
$ vncserver
……
这样就搞定了。就可以使用vncviewer连接vnc桌面了。

缺省的,vncserver启动的窗口管理器是twm,在~/.vnc/xstartup中修改一下就可以用GNOME或KDE了。用GNOME就将twm替换成gnome-session,用KDE就替换成startkde。
  • At 3:25 PM, Blogger Andy Yang said…

    可能和X server的权限要求有关吧。也许可以配置吧。
     

  • At 4:07 AM, Anonymous Anonymous said…

    Hello !.
    You may , perhaps very interested to know how one can collect a huge starting capital .
    There is no need to invest much at first. You may start to get income with as small sum of money as 20-100 dollars.

    AimTrust is what you haven`t ever dreamt of such a chance to become rich
    The firm represents an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

    It is based in Panama with affiliates around the world.
    Do you want to become an affluent person?
    That`s your choice That`s what you really need!

    I`m happy and lucky, I began to take up income with the help of this company,
    and I invite you to do the same. If it gets down to select a correct partner who uses your money in a right way - that`s AimTrust!.
    I make 2G daily, and my first investment was 500 dollars only!
    It`s easy to join , just click this link http://eredojuwa.fcpages.com/jycaqy.html
    and lucky you`re! Let`s take this option together to become rich
     

  • At 4:18 AM, Anonymous Anonymous said…

    Good day, sun shines!
    There have were times of troubles when I felt unhappy missing knowledge about opportunities of getting high yields on investments. I was a dump and downright stupid person.
    I have never imagined that there weren't any need in large initial investment.
    Nowadays, I feel good, I started take up real money.
    It's all about how to select a proper companion who utilizes your funds in a right way - that is incorporate it in real deals, and shares the profit with me.

    You may ask, if there are such firms? I'm obliged to tell the truth, YES, there are. Please be informed of one of them:
    http://theblogmoney.com
     

  • At 8:47 AM, Anonymous Anonymous said…

    Hi!
    You may probably be very interested to know how one can make real money on investments.
    There is no initial capital needed.
    You may begin earning with a money that usually goes
    for daily food, that's 20-100 dollars.
    I have been participating in one project for several years,
    and I'm ready to let you know my secrets at my blog.

    Please visit blog and send me private message to get the info.

    P.S. I make 1000-2000 per daily now.

    [url=http://theinvestblog.com] Online investment blog[/url]
     

  • At 11:35 AM, Anonymous Anonymous said…

    Hi!
    You may probably be very curious to know how one can manage to receive high yields on investments.
    There is no need to invest much at first.
    You may commense to get income with a sum that usually is spent
    for daily food, that's 20-100 dollars.
    I have been participating in one company's work for several years,
    and I'll be glad to let you know my secrets at my blog.

    Please visit blog and send me private message to get the info.

    P.S. I make 1000-2000 per daily now.

    http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]
     

  • At 1:05 PM, Anonymous Anonymous said…

    Glad to greet you, ladies and gentlemen!

    We are not acquainted yet? It’s easy to fix,
    friends call me Peter.
    Generally I’m a venturesome analyst. for a long time I’m keen on online-casino and poker.
    Not long time ago I started my own blog, where I describe my virtual adventures.
    Probably, it will be interesting for you to find out how to win not loose.
    Please visit my diary. http://allbestcasino.com I’ll be glad would you find time to leave your comments.
     

  • At 8:04 PM, Anonymous Anonymous said…

    Hello,

    When ever I surf on web I never forget to visit this website[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url]Plenty of useful information on 10nian.blogspot.com. Do you pay attention towards your health?. Here is a fact for you. Recent Scientific Research displays that closely 70% of all USA grownups are either obese or weighty[url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips].[/url] Hence if you're one of these people, you're not alone. Infact many among us need to lose 10 to 20 lbs once in a while to get sexy and perfect six pack abs. Now the question is how you are planning to have quick weight loss? Quick weight loss can be achived with little effort. You need to improve some of you daily habbits to achive weight loss in short span of time.

    About me: I am writer of [url=http://www.weightrapidloss.com/lose-10-pounds-in-2-weeks-quick-weight-loss-tips]Quick weight loss tips[/url]. I am also health trainer who can help you lose weight quickly. If you do not want to go under difficult training program than you may also try [url=http://www.weightrapidloss.com/acai-berry-for-quick-weight-loss]Acai Berry[/url] or [url=http://www.weightrapidloss.com/colon-cleanse-for-weight-loss]Colon Cleansing[/url] for fast weight loss.
     

  • At 4:26 PM, Anonymous diaper with spanking stories said…

    Ifound him facing away, curled up on his bunk bed, an obsolete symbolof optimism for our familys future growth. ``Because we want to help them.
    my first time having sex stories
    interracial wives stories
    first time beastiality stories
    first time blowjob stories
    bdsm scat mistress stories
    Ifound him facing away, curled up on his bunk bed, an obsolete symbolof optimism for our familys future growth. ``Because we want to help them.
     

Post a Comment

Why frames are dropped even with low cpu utilization ?

网上看到一篇文章,讨论Multimedia和Kernel的调度的问题。
作者发现在2.4.17的内核上播放很流畅,在2.4.18上却有问题,CPU并不忙,但却丢帧。奇怪的是使用O(1)调度器的新内核似乎都会丢帧。

其实CPU调度只是媒体播放中的一个影响因素,媒体文件的解码、渲染等都有不同的软件组件参与,性能与各方面都有关系。

作者对于Kernel的影响尝试做了一些分享,写了一个simulator。具体内容参看:http://cambuca.ldhs.cetuc.puc-rio.br/~miguel/multimedia_sim/

depth和bpp的差别


今天在看xine代码时解开了一个困扰我许久的谜团,就是depth和bpp到底有什么差别?


xine的video output中的fb output中有一段注释解释了这个问题。就X的术语而言,depth指实际的颜色深度,如15位、16位、24位等,bpp指用于实际用于像素表示的位数,应当是8的倍数,不会小于depth,但可能和depth不同。例如对于R5G5B5即15位的depth,bpp应该为16,24位depth,bpp可能为24,也可能为32。

Wednesday, September 27, 2006

(OSDI'02 Note)Defensive Programming: Using an Annotation Toolkit to Build DoS-Resistant Software


Xiaohu Qie et al

防御性编程一般有以下几种方法:

* 异常监测:以正常为基准,根据system-call的调用顺序来判断程序的行为是否正常。但是这种方法无法判断出资源被耗尽的情况。
* 性能监控:一般用profiling-based detection,本文的方法是在源程序中插入代码,不但能进行监控工作,而且可以进行预先保护。
* 静态分析:meta-level compilation,基于一些规则对代码进行分析,如"kernel code cannot call blocking functions with interrupts disabled"等。
* 新的OS机制:如用Resource Container取代了Process,将资源与执行域分离。

BTW:本文第三作者Larry Peterson,普林斯顿大学的大牛,写过《计算机网络》。

Post a Comment

Tuesday, September 26, 2006

VLC、FFmpeg相关的一些资料

VLC media player (From Wikipedia)

是仅有的两款同时支持Window、GNU/Linux、BSD Unix、Mac OS X、Solaris的播放器之一(还有一款是MPlayer,xine不支持Windows)。它支持多种codec和多种file formats。对codec的支持大部分来自FFmpeg项目提供的libavcodec库,同时还用了libdvdcss库来解码播放DVD。

VLC有不同的前端:
* RC, Remote Control, to control VLC media player from a distant computer.
* HTTP, to control VLC media player from a web page. It uses AJAX.
* telnet, using the telnet protocol.
* GUI, which is written in Cocoa under MacOSX, and wxwidgets under Linux/Windows.
* skins2, a higly personnalisable skinable interface.


FFmpeg (From Wikipedia)
是一个工具集合,用来录制、转换、流化音视频。包括以下部分:

ffmpeg is a command line tool to convert one video file format to another. It also supports grabbing and encoding in real time from a TV card.

ffserver is an HTTP (RTSP is being developed) multimedia streaming server for live broadcasts. Time shifting of live broadcast is also supported. Note that this is very buggy and unlikely to work.

ffplay is a simple media player based on SDL and on the FFmpeg libraries.

libavcodec is a library containing all the ffmpeg audio/video encoders and decoders. Most codecs were developed from scratch to ensure best performance and high code reusability.

libavformat
is a library containing demuxers and muxers for audio/video container formats.

libavutil
is a helper library containing routines common to different parts of FFmpeg.


顺便附上来自wikipedia的各种Media Player的比较,几乎涵盖了所有能见到的类型,太赞了!
Comparison of media players

  • At 3:31 AM, Blogger water said…

    建议建个lebel。paul(yingbo.blogspot.com)的使用了,比较清晰,谁来研究一把吧。
     

Post a Comment

(OSDI'04 Note)Program-Counter-Based Classification in Buffer Caching




Chris Gniady et al

本文将一种技术(基于PC的预测)应用到另一个领域(OS中的Buffer Caching)。

基于PC的预测,在体系结构中应用非常广泛,包括
* Branch prediction
* Optimize energy
* Cache management
* Memory prefetching
* I/O activities prediction
但是在OS中,没有被利用到。

Buffer Caching的一个重要问题是block replacement,目前常用的就是LRU。但LRU无法识别出哪些访问属于sequential,哪些属于loop。所以有了Pattern-based buffer replacement scheme,将cache分块,每个子块对应一种pattern。对每一个子块,采取不同的replacement算法,并动态调整大小。

对于子块的划分方法,即Buffer Caching Classification,目前有Per-application、Per-file、Per-PC的方法,本文讨论的就是第三种方法。

核心思想:There is a strong correlation between the program context from which I/O operations are invoked and the access pattern among the accessed blocks, and the call instruction that leads to the I/O operations provides an effective means of recording the program context.



  • At 10:36 PM, Blogger Andy Yang said…

    基于PC的运行模式分析应该是很有效的,不知道在应用层是否可以用?问题是应用层怎么去找感兴趣的PC呢?
     

Post a Comment

开博工具总结


"十年"开张也有一段时间了,对相关的工具也有了一些摸索,总结一下。


Blogger,用起来还是不错的,毕竟google的东东嘛。页面很干净。缺点就是现在还不支持分类、标签什么的,感觉像是大杂烩:-( 另外有时需要定制模版的HTML,比较麻烦,当然也比较彻底。


Google AdSense,很不错,关键字有时候抓的还是很准的,比如有IBM Linux、RDP等方面的广告。当然最关键还是能不能把Money汇给我,呵呵~~~~


SiteMeter,计数器,我还比较满意,会发具体的报告给我。其实,我是对目前的访问量比较满意,^_^


Google SpreadSheet,用来share表格,还比较好用,自动保存功能很实用。目前基本把其它几个个人的表格也放上去,和好友们分享一下。


Blogger for Word,一个Word插件,可以直接提交到blog上可以用,但格式要注意,不能用表格等复杂格式,最好就是光写字。字最好选小四号,否则太小(可能也和blog模版有关)。有的时候关闭Word时会崩溃。


Zoundry Blog Writer,相当不错,就是要占50MB内存!可以方便的下载blog文章,并另存为HTML文件,很赞。当然在本地编辑还是很方便的。注意:我发现一个bug,就是如果blog用的编码是UTF-8,而Zoundry用中文的界面,则上传时会报告无法转换成Unicode,无法上传。使用英文界面就可以了。现在我只用Zoundry,推荐一下!


AMD Streamload,网络硬盘,免费的是25GB,每月可下载1GB(我记不清了)。有一个客户端,还比较好用,缺点就是.Net 2.0的,需要download一个几十MB的包……

(HotOS'03 Note)Towards a Semantic-Aware File Store


Towards a Semantic-Aware File Store
Zhichen Xu et al.
HotOS 2003


作者是HP Lab的,做了一个叫做pStore的semantic-aware file store。基本思想就是在file system之上建立一套可以管理文件属性语义的存储系统。和之前一篇文章(Why can't I Find My Files?)不同,本文主要讨论语义的保存及应用的架构,对于语义如何获得没有太多描述。这可能与其研究动机有关吧,作者介绍了数字电影制作的情境,大量的素材,大量的版本,大量的文件……也许这种情形之下用户很愿意自己输入文件属性?毕竟像《怪物史莱克》之类的影片都是大制作嘛。


作者列举了一些常用的语义:文件版本、基于应用程序的相关性、基于属性的语义、基于内容的语义、基于上下文的信息。


作者讨论了语义表示(使用RDF)、schema演化、整体framework等问题。

(HotOS'03 Note)Flexible OS Support and Applications for Trusted Computing


Flexible OS Support and Applications for Trusted Computing
Tal Garfinkel et al.
HotOS 2003


讨论可信计算的问题,使用VMM支持。一种Open-box,一种Close-box。好像前者主要用于支持现有的OS?总之close-box可以提供更好的可信控制。



可信技术方面的文章我也看了好几篇,还是没有太多兴趣。其主要问题集中在trusted platform,tamper,attestation等方面,数字签名等密码学工具是必备的。


粗粗的浏览了一遍,没有什么好说的了……

(HotOS'03 Note)Hardware Works, Software Doesn't: Enforcing Modularity with Mondriaan Memory Protection


Hardware Works, Software Doesn't: Enforcing Modularity with Mondriaan Memory Protection
Emmett Witchel et al.
HotOS 2003



本文讨论(内核)模块边内存界保护的问题,基于称为Mondriaan Memory Protection(MMP)的细粒度内存保护硬件机制进行研究。MMP是作者发表在ASPLOS 2002中的Mondriaan Memory Protection一文中提出的。


MMP支持32-bit字的许可粒度,可以为内存保护提供很精确的控制。类似与TLB,MMP硬件包含称为protection lookaside buffer (PLB)的高速缓存,以提高速度。


在内核中使用MMP,需要解决几个主要的问题:
1. Memory supervisor,关于bootloader及保护域创建问题;
2. Stacks and threads,关于栈的分配和权限问题;
3. Cross-domain calls,关于跨保护边界的调用,call gate、return gate等。熟悉x86保护模式应该很容易接受这些概念。


对于硬件支持OS内存保护机制的问题,我向来兴趣不大。我认为在今天CPU arch和OS的发展现状下,同时修改任何两者难度很大,很多时候保证兼容性是压倒一切的。(当然,我也知道这样有些偏颇,更准确的应该说是我自己的研究思路是这样。)


文章中对于相关工作的总结不错。提到了各种保护机制:
1. Nooks:使用已有硬件支持驱动程序安全(我印象中是用分页);
2. Palladium:综合使用x86的分页和分段,但是share libraries很难使用分段实现,Palladium用分页实现,论文:SOSP 1999,Integrating segmentation and paging protection for safe, efficient and transparent software extensions.;
3. Capabilities:比较早,1966年,用在IBM AS400之类的系统上;
4. Lightweight remote procedure call (LRPC):类似于RPC,需要进行data marshaling and copying,在跨越保护边界时比较费;
5. Safe language:语言级别的保护,如类型安全语言(我觉得Cyclone应该算这一类),缺点是单一语言较难利用软件遗产,还有就是编译器的可信赖等问题;
6. Modern static analysis and model checking:对OS进行静态分析和模型检查(OSDI 2004上有几篇相关文章)。

Monday, September 25, 2006

推荐使用本地Blog编辑器:Zoundry




很不错的一个本地Blog编辑器,可以下载所有的Blog,并单独保存为HTML页面。而且可以支持撤销操作,比Browser中编辑要方便一些。




下载地址: Zoundry

Sunday, September 24, 2006

(HotOS'03 Note)Why cant I Find My File?

Why can’t I Find My Files? New methods for automating attribute assignment
Craig A.N. Soules
HotOS 2003

本文讨论基于属性的文件管理检索系统中的属性赋值问题。对于Attribute-based naming系统,the key challenge is assigning useful, meaningful attributes to files.通常的有用户输入和内容分析两种方法。用户输入很麻烦,而内容分析太复杂,还有专有文件格式、数据类型问题。作者在文章讨论了context analysis方法。具体包括:access-based context analysisinter-file context analysis。作者借鉴了Web搜索引擎的思路:Web search engines, however, have found greater success obtaining attributes by combining content analysis with context analysis.

Access-based context analysis
a) Application assistance,如邮件的标题对附件的说明
b) Existing user input,如文件路径对文件内容的说明

Inter-file context analysis
a) User access pattern,如用户连续打开的文件往往相关
b) Inter-file content analysis,如类似有些文件利用hash函数去除块的重复存储,可以对文件内容进行分析。(还记得compare-by-hash吗?)这对于文件的多个版本很有作用。

PS:读的时候反而是对Google的搜索技术更感兴趣一些,感觉自己在向铁杆GFans前进,呵呵

谁能告诉我x86emu的主页在哪里?

想去了解一下x86emu项目,搜索了一下,竟然没有搜到项目主页,也许是太老了吧。
搜出来的主要都是IDA-x86emu(IDA的x86emu插件)和X中的x86emu(用于支持第二块显卡的初始化等)。

XFree86中为了支持显卡ROM中提供的代码(显卡BIOS等)采用了x86emu项目,这个在FreeVGA那篇文章也提到了。

Post a Comment

关于二进制翻译(Binary Translation)

目前比较活跃的有:

Walkabout
前身是UQBT,开始时静态的二进制翻译架构,后来演化成动态的。现在有Sun维护,改名为Walkabout。

DAISY: Dynamically Architected Instruction Set from Yorktown
开源项目,目前由IBM维护。

下面这几个网页对Binary Translation有一个较为详细的介绍:https://secure.wikimedia.org/wikipedia/en/wiki/Binary_translation
http://personals.ac.upc.edu/vmoya/translation.html
http://www.ifi.unizh.ch/richter/people/pilz/oct/index.html
  • At 2:40 AM, Blogger water said…

    好久没来了,真不好意思!
    不错的连接,得学习学习。
     

Post a Comment

(HotOS'03 Note)Cosy: Develop in User-Land, Run in Kernel-Mode

Cosy: Develop in User-Land, Run in Kernel-Mode
Amit Purohit et al.
HotOS 2003

这篇文章的动机就不用说了,还是kernel crossing问题。只不过更加激进一些,将system call和相关代码一起打包,送到内核态下去了。Cosy exploits zero-copy techniques and code aggregation to achieve better performance without reducing the security.注意code aggregation,我觉得这是和multi-call等方法的差别,是其特点。

内核做了一些扩展,包括cosy_init, cosy_run, cosy_uninit
编译器做了一些扩展,Cosy-GCC,支持各种控制结构。
做了一个库,Cosy-Libbuffer management是一个重要问题。

安全方面,主要通过内核抢占防止死循环,用x86 segmentation来进行内存保护。

一个例子。原始代码:
-----------------------------------------------------------
cosy_init();

COSY_START();
ifd = open(ifile, O_RDONLY);
ofd = open(ofile, O_WRONLY);
do {
  rlen = read(ifd, buf, 4096);
  wlen = write(ofd, buf, rlen);
} while (wlen == 4096);
COSY_END();

cosy_unit();
-----------------------------------------------------------
经过编译,变成:
-----------------------------------------------------------
cosy_init();

cosy_start();
cosy_open(&ifd, ifile, O_RDONLY);
cosy_open(&ofd, ofile, O_WRONLY);
cosy_do();
  cosy_read(&rlen, ifd, buf, 4096);
  cosy_write(&wlen, ofd, buf, 4096);     /*文中是这样,我认为应该是rlen*/
cosy_while(wlen, “==”, 4096);
cosy_run();
cosy_uninit();

(HotOS'03 Note)An Analysis of Compare-by-hash

An Analysis of Compare-by-hash
Val Henson
HotOS 2003

作者就研究中越来越广泛的使用hash函数作为快速比较方法的倾向进行了分析。很多的研究工作,都使用SHA-1Hash函数作为比较的唯一标准,例如一些网络文件系统的块cache命中算法。有人认为密码学hash函数的冲突概率要比硬件出错的概率还要低,所以支持直接使用hash函数作为比较标准,而不再对hash冲突进行检查。

作者对这种将密码学hash函数应用推广到通用应用倾向提出了质疑,认为compare-by-hash方法有以下一些问题需要认真分析。
1.输入的随机性。实际使用compare-by-hash的应用的输入并不像期望的那样真正具有随即性。
2.密码学hash函数有一些特点:short-lived(一般只有有限的时间窗口);Obsolescence can occur overnight(一旦攻破,立即过时);Obsolescence is inevitableUpgrade strategy required。而通用的软件可能会使用10年以上的时间。
3Hash冲突可能导致silentdeterministichard-to-fix errors。这种错误可能是相当危险的。
4Comparing probabilities。可以构造出一些例子证明会改变hash函数本身的冲突概率。
5Software and reliability。作者认为软件不应对硬件错误概率听之任之,而应该增加软件手段去改进。所以,hash冲突概率低于硬件错误概率的论据是站不住脚的。

作者也提出其它可选的方案,总结其特点就是keep some state。另外,结合具体应用的特点进行评估也很重要。作者反对的是不加区分的使用compare-by-hash,实际上hash方法确实有很多好处,有巨大的吸引力。

作者文中提到fingerprints(指纹)方法作为一种替代方法,让我想起了B. O. Christiansen的博士论文Data Compression for Thin Client ComputingFast block motion detection的核心思想之一就是利用图像元素的“指纹”(特征)。

关于Compare-by-hash,对于thin client研究中也许有一些启发……

(OSDI'04 Note)Enhancing Server Availability and Security Through Failure-Oblivious Computing


Martin Rinard et al

这篇文章提出了一个很有意思的想法:
如果一个函数发生了非法内存访问,那么一般情况下会有两种结果:1、抛出一个Exception,如果程序没有接到,或者压根就没法接(比如C),那么退出。2、非法操作成功,继续执行下去,整个程序处于不稳定状态。

那么能否有第三种方法:忽略它。更详细一点,就是说没有Exception,也不会有什么操作,简单的进行函数返回,只不过返回一个杜撰出来的值,这个值可能是错的,也可能没有意义,不过总比让整个程序崩溃了要好一些,而且很可能逻辑中对函数的返回值会做检查,从而能将预料外的非法变成预料中的非法。对于某些程序来说,这样做是可以接受的。这,就是作者所谓的Failure-Oblivious Computing。

本文主要是对内存访问的错误操作提出了方案,改写了一个编译器,在一些地方插入了内存访问的检查指令,如果不合法,则返回一个杜撰值。

对于具体的实现细节,并没有看的很细,觉得有这样一个想法就已经很不容易了(或者很容易?)。同样是为了提高服务的Availability,有人想出了Isolation(虚拟机):死了不要影响别人;有人想出了Fail-Stop:要死赶快死;有人想出了Oblivious的方法:好死不如赖活。呵呵,真的很好玩。

  • At 4:49 PM, Blogger Andy Yang said…

    你太有幽默了,哈哈……

    看来需要你做个报告了,题目就叫《关于软件的N种死法》,呵呵
     

Post a Comment

(OSDI'04 Note)CP-Miner: A Tool for Finding Copy-paste and Related Bugs in Operating System Code

Zhenmin Li et al

本文核心内容:使用数据挖掘技术来分析大型程序中可能存在的因为Copy-Paste产生的Bug。

Copy-Paster可能引起很多Bug,往往是因为没有修改Paste过去的代码中应该修改的地方。对这个问题,目前有一定的研究,但是存在几个问题:
1、分析的效率:对于大型程序,如Linux、数据库等,分析速度非常慢。
2、分析的智能性:目前的一些分析工具,只做到检验出哪里存在Copy-Paste的代码,而无法判断是否存在bug,需要人工分析。

本文为这两个问题作出了贡献:
1、使用数据挖掘技术,使得效率大大增加
2、使用了一定的算法,自动监测可能存在Bug的Pattern
另外,还有一点:
3、统计功能:分析出哪些模块使用Copy-Paste方法较多等等统计信息

实现的技术难点有两点:
1、如何判断代码属于Copy-Paste
2、如何判断Bug

对于第一点,目前大致有三种方法:
1) string-based: divided into strings (typically lines)
2) parse-tree-based: pattern matching on parse-tree and sub-tree
3) token-based: duplicate token sequences are identified
本文采用第三种方法,认为这是最精确的。

对于第二点,文章的思路比较简单:
对于两段被认为是Copy-Paste的代码中,分别找到不同的token的个数,然后看个数是否匹配。一般来说,如果第一段中token1出现了4次,而第二段中token2出现了3次,token1出现了1次,那么很有可能第二段中那个token1应该改成token2。
当然,也不能这么绝对,作者还有一个很简单的算法,即测量修改的和没有修改的比率,如上面的例子中就是0.25。然后对这个比率采用一个阀值,低于一定的阀值,就很有可能是Bug。

个人感觉:
这篇论文的思路很清晰,一个限制条件——针对大规模程序,一个创新点——自动分析Bug。呵呵,这也许是比较典型的论文吧。