Domino6的一个严重Bug,可能造成服务器内存泄漏
昨天在做程序的时候,发现Domino6的一个Bug。
Domino6中新增了一个函数Replace,用于字符串的处理,其函数原型如下:
Replace(sourceArray as Variant, findArray as Variant, replacementArray as Variant)
其中
SourceArray是被修改的字符串列表
FindArray是要查找的字符串列表
ReplacementArray是替换成的字符串列表
这是Designer帮助中对于函数的说明。
但是在实际的使用中,参数findArray和replacementArray其中只要有一个是包含字符串数组的Variant变量,则程序在运行到Replace函数时,将弹出提示:
NSD is running.
Saving to file D:\Lotus\Notes\Data\nsd_all_W32I_FAIRY-TALE_06_10@21_39.log
This file may be used by your company’s help desk and IBM to determine the possible cause of this Notes error. Please make note of the name of this file and its location as your may be asked to provide this file as part of the problem determination effort.
文件名的后缀是随机生成的,文件太长,没法在这里提供。我也不知道该怎样才能把这份文件提给IBM,好像在他们的网站上并没有提交Bug报告的地方。
好了,言归正传,弹出该提示后,Notes的客户端将会自动关闭,包括Designer客户端。不过还好,它会关闭所有相关的进程,不用你再去手动结束进程了。
似乎这并不是什么大问题,但是,如果把这个程序做成一个代理在服务器上运行,会出现什么情况呢?
我做了一个定时代理,在服务器上运行,源码如下:
Dim sourceL(1 To 5) As String
Dim findL(1 To 2) As String
Dim replaceL(1 To 2) As String
Dim replaced_var As Variant
Dim find_var As Variant
Dim source_var As Variant
sourceL(1) = "北京"
sourceL(2) = "上海"
sourceL(3) = "天津"
sourceL(4) = "重庆"
sourceL(5) = "深圳"
findL(1) = "上海"
findL(2) = "重庆"
replaceL(1) = "昆明"
replaceL(2) = "西安"
source_var = sourceL
find_var = findL
replaced_var = Replace(source_var, find_var, replaceL)
呵呵,程序如期的出现了上述对话框,只不过是存放Bug报告文件的目录换成了D:/Lotus/Domino/Data。接下来的情况就有些不妙了。
桌面上所有的程序运行都是举步维艰,查看“Windows的任务管理器”,其内存占用由384M跳至0.99G,并一路飙升,至1.2G涨停,Windows报告“系统虚拟内存严重不足”。我的机器是512M 内存,Windows XP系统。至此,Domino服务器控制台不再响应任何输入。强行关闭Domino服务器及所有相关进程后,内存占用恢复到178M。在不关机的情况下,重启Domino服务器,服务器不能正常工作。
因为条件所限,我只测试了Windows平台,OS/2及Unix平台未做测试。并且,客户端和服务器安装在同一台机器上。如果那位有兴趣的话,也可自己做一下所有环境下的测试。
另外,我用的Domino6是正版,中文版,所有的客户端均已汉化,不用打补丁包。