[wizs] debug.log

作者: laechan (揮淚斬馬雲)   2014-03-17 14:25:41
量太多因此獨立一篇。
執行時段錯誤: *result of array addition is greater than maximum array size.
程式: /adm/simul_efun/prop_logic.c(/adm/obj/simul_efun.c):84
物件: /adm/obj/simul_efun
/std/user#537156 "cmd_hook" /std/user.c:140
/cmds/std/_wear "cmd_wear" /cmds/std/_wear.c:64
/cmds/std/_wear "try_wield_one" /cmds/std/_wear.c:424
/cmds/std/_wear "wear_it" /cmds/std/_wear.c:89
/d/ppl/quest/memory/wp/moonsword#537423 "add" /std/ob/object.c:37
/adm/obj/simul_efun "_add"
/adm/simul_efun/prop_logic.c(/adm/obj/simul_efun.c):84
_wear.c 的 89 行大概是
if(ob->query("type"))
ob->add("id",({ob->query("type")}));
而 result of array addition is greater than maximum array size.
我猜它的意思是線上有物件的 id 欄位 size 數超過。
這很容易理解,如果玩家一直穿脫 id 自然一直肥大。
wear 那兩行我暫時 abort 掉。調查的 running code 如下
obs=objects();
foreach(ob in obs)
if(!undefinedp(ob->query("id")))
if(sizeof(ob->query("id"))>10)
environment(ob) ? write(identify(ob)+" "+identify(environment(ob))+
" "+sizeof(ob->query("id"))+"\n")
: write(identify(ob)+" "+sizeof(ob->query("id"))+"\n");
========== 程式執行區 ==========
武器(幻月劍 /d/ppl/quest/memory/wp/moonsword) 玩家(konrad /std/user) 50000
防具(/std/new_ob/arm) 玩家(ick /std/user) 38
防具(/std/new_ob/arm) 玩家(cococd /std/user) 16
.
.
大概是像這樣。之前就稍微有發現未鑑定防具的 id 有奇怪的不尋常
增長現象,然後理論上 id 有可能是儲存資料,所以最近會做一下線
上 id 的修正。
=============================================================================
Expected: object Got: 0.
程式: /std/mob/g_attack.c:19
物件: /d/ppl/quest/memory/mob/novice#837674
生物名: novice
/std/user#8555 "heart_beat" /std/user.c:617
/std/user#8555 "continue_attack" /std/user.c:253
/adm/daemons/user_d "continue_attack" /adm/daemons/user_d.c:886
/adm/daemons/user_d "execute_attack" /adm/daemons/user_d.c:1014
/adm/daemons/user_d "normal_attack" /adm/daemons/user_d.c:1230
/adm/obj/simul_efun "show"
/adm/simul_efun/show.c(/adm/obj/simul_efun.c):248
/d/ppl/quest/memory/mob/novice#837674 "receive_damage"
/std/mob/g_attack.c:19
user_d.c 第 1230 行大概是
if(!me->query("record_data/no_enable_msg")) // Norr@Sanc in 2011/08/06
{
if(uu>0)
show(me,tar,(k>1 ? "["+k+" 連擊] " : "")+tmp+"("+(t2/15)+")",t2);
else
show(me,tar,(k>1 ? "["+k+" 連擊] " : "")+tmp+"("+t2+")",t2,
(int)tar->query("member"));
會出現 object got 0 就是說 me 或 tar 不見,照判斷是 me 不見
,因此加一個 if(me) 的判斷即可。
=============================================================================
執行時段錯誤: *Bad argument 2 to <=
Expected: string Got: 7.
程式: /adm/daemons/shut_d.c:81
物件: /adm/daemons/shut_d
/d/ppl/justinj/kemi/mob/clid#1066468 "heart_beat" /std/monster.c:103
/adm/daemons/mob_d "continue_attack" /adm/daemons/mob_d.c:392
/adm/daemons/mob_d "execute_attack" /adm/daemons/mob_d.c:430
/d/ppl/justinj/kemi/mob/clid#1066468 "special_fun"
/d/ppl/justinj/kemi/mob/clid.c:47
/d/ppl/justinj/kemi/mob/clid#1066468 "shut" /std/mob/living.c:145
/adm/daemons/mob_d "shut" /adm/daemons/mob_d.c:522
/adm/daemons/shut_d "shut_tar" /adm/daemons/shut_d.c:81
第 81 行的內容是
ss>2 ? c=(int)kinds[2] : c=1;
if(c>7) c=7;
通常這行會有問題代表 c 有問題,也就代表 kinds[2] 有問題。
case 1..5:
frog->shut(HIG"$N舉起大刀劈向$O,讓$O感到無處可逃\n"NOR,78788,7777,
({"dam","physics","4"}),ppl,7);
break;
我在 shut 有做了防錯判斷,但基本上 kinds[2] 還是要使用整數
,這個再請 justin 修正。
=============================================================================
/u/l/laechan/skycastle/room/street/alley_shop1.c
暫改為不生蟲。我猜蟲沒問題,有問題的片段還要再找找。
=============================================================================
執行時段錯誤: *Bad argument 3 to message()
Expected: string or array or object Got: 0.
程式: /adm/simul_efun/tell_room.c(/adm/obj/simul_efun.c):4
物件: /adm/obj/simul_efun
/std/user#8555 "heart_beat" /std/user.c:617
/std/user#8555 "continue_attack" /std/user.c:253
/adm/daemons/user_d "continue_attack" /adm/daemons/user_d.c:886
/adm/daemons/user_d "execute_attack" /adm/daemons/user_d.c:1003
/adm/daemons/user_d "normal_attack" /adm/daemons/user_d.c:1186
/adm/obj/simul_efun "new_defance"
/adm/simul_efun/new_defance.c(/adm/obj/simul_efun.c):325
/u/l/laechan/special/mob/fingerwind1#1837939 "shield"
/u/l/laechan/special/mob/fingerwind1.c:27
/d/ppl/quest/evil/mob/ghost#1837768 "shield"
/d/ppl/quest/evil/mob/ghost.c:117
/adm/obj/simul_efun "tell_room"
/adm/simul_efun/tell_room.c(/adm/obj/simul_efun.c):4
fingerwind 的 shield 函數
mixed shield(object frog,object ppl,int dam,string type)
ghost 的 shield 函數
mixed shield(object me,object tar,int dam,int dam2,string type)
但是 ghost 的 dam2 並沒有被使用,所以應該是函數宣告錯誤,
grep 的結果
[/d/ppl/quest/evil/mob/devil.c]
97:mixed shield(object me,object tar,int dam,int dam2,string type)
[/d/ppl/quest/evil/mob/ghost.c]
99:mixed shield(object me,object tar,int dam,int dam2,string type)
只有這兩隻這樣寫,均已更正。
=============================================================================
執行時段錯誤: *Bad argument 1 to call_other()
Expected: string or array or object Got: 0.
程式: /d/ppl/ina/dinah/blood/mob/king.c:202
物件: /d/ppl/ina/dinah/blood/mob/king#1737891
生物名: Master Of Hell
/d/ppl/ina/dinah/blood/mob/king#1737891 "heart_beat"
/std/bmonster.c:129
/adm/daemons/mob_d "continue_attack"
/adm/daemons/mob_d.c:375
/d/ppl/ina/dinah/blood/mob/king#1737891 "die"
/d/ppl/ina/dinah/blood/mob/king.c:202
八卦府君的 bug。
void die()
{
object frog=this_object(),ppl=this_player(),ob;
write_file("/open/blade/ina_king",
ppl->query("short")+"打死"+ob->query("chi_name")+time()+"。\n");
202 行就是 write_file 那行,如上所述,有宣告 object ob
但是沒有指配內容,則後面的 ob->query("chi_name") 自然會
出錯。
同目錄下並沒有 bak 檔,查更早之前的 king 它是這樣寫的
void die()
{
object frog=this_object(),ppl=this_player(),ob;
write_file("/open/blade/ina_king",this_player()->query("name")+
"打死"+this_object()->query("chi_name")+time()+".\n");
所以才說備份檔很重要。
按照上面的寫法把 ob 改成 frog 即可。這 bug 應該已存在
很長的時間,至少之前換 mudos 時就已存在。
=============================================================================

Links booklink

Contact Us: admin [ a t ] ucptt.com