Crash bug - need assistance with GDB

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago - 2 years 1 month ago #7338 by cunning
Crash bug - need assistance with GDB was created by cunning
I have been trying to find this issue for week now. Basically when we call dg_misc.c for dg_valid_target() It corrupts the character. It does not happen right away but 12-24 hours into the game. Hoping someone with more skill in GDB can assist.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000456aec in valid_dg_target (ch=ch@entry=0x38148b0, bitvector=bitvector@entry=1) at dg_misc.c:293
293     }
(gdb) back
#0  0x0000000000456aec in valid_dg_target (ch=ch@entry=0x38148b0, bitvector=bitvector@entry=1) at dg_misc.c:293
#1  0x00000000004341a7 in get_char_by_obj (obj=obj@entry=0x3a251f0, name=name@entry=0x3b224d0 "}32387")
    at dg_scripts.c:509
#2  0x000000000041d5aa in find_replacement (go=go@entry=0x3a251f0, sc=sc@entry=0x326bdf0,
    trig=trig@entry=0x3b34f80, type=type@entry=1, var=var@entry=0x7ffd7586ffa1 "actor",
    field=field@entry=0x7ffd7586ffa7 "inventory", subfield=0x7ffd758705a0 "8461", str=0x7ffd758701a0 "", slen=512)
    at dg_variables.c:376
#3  0x0000000000422473 in var_subst (go=0x3a251f0, sc=0x326bdf0, trig=0x3b34f80, type=1, line=<optimized out>,
    buf=<optimized out>) at dg_variables.c:1709
#4  0x0000000000433730 in eval_expr (line=line@entry=0x7ffd75870a60 "%actor.inventory(8461)% ",
    result=result@entry=0x7ffd75870c60 "", go=go@entry=0x3a251f0, sc=sc@entry=0x326bdf0, trig=trig@entry=0x3b34f80,
    type=type@entry=1) at dg_scripts.c:1507
#5  0x0000000000433605 in eval_lhs_op_rhs (
    expr=expr@entry=0x228ac53 "%actor.inventory(8461)% && %actor.inventory(8462)% && %actor.inventory(8463)% && %actor.inventory(8464)% && %actor.inventory(8465)% %actor.inventory(8466)% && %actor.inventory(8467)% && %actor.invento"..., result=result@entry=0x7ffd75872300 "", go=go@entry=0x3a251f0, sc=sc@entry=0x326bdf0, trig=trig@entry=0x3b34f80,
    type=type@entry=1) at dg_scripts.c:1564
#6  0x000000000043370d in eval_expr (
    line=line@entry=0x228ac53 "%actor.inventory(8461)% && %actor.inventory(8462)% && %actor.inventory(8463)% && %actor.inventory(8464)% && %actor.inventory(8465)% %actor.inventory(8466)% && %actor.inventory(8467)% && %actor.invento"..., result=result@entry=0x7ffd75872300 "", go=go@entry=0x3a251f0, sc=sc@entry=0x326bdf0, trig=trig@entry=0x3b34f80,
    type=type@entry=1) at dg_scripts.c:1497
#7  0x00000000004337a1 in process_if (
    cond=cond@entry=0x228ac53 "%actor.inventory(8461)% && %actor.inventory(8462)% && %actor.inventory(8463)% && %actor.inventory(8464)% && %actor.inventory(8465)% %actor.inventory(8466)% && %actor.inventory(8467)% && %actor.invento"..., go=go@entry=0x3a251f0, sc=sc@entry=0x326bdf0, trig=trig@entry=0x3b34f80, type=type@entry=1) at dg_scripts.c:1580
#8  0x0000000000436ad9 in script_driver (go_adress=0x7ffd758733a8, trig=0x3b34f80, type=1, mode=<optimized out>)


(gdb) up
#1 0x00000000004341a7 in get_char_by_obj (obj=obj@entry=0x3a251f0, name=name@entry=0x3b224d0 "}32387")
at dg_scripts.c:509
509 if (ch && valid_dg_target(ch, DG_ALLOW_GODS))
(gdb) info local
ch = <optimized out>
(gdb) up
#2 0x000000000041d5aa in find_replacement (go=go@entry=0x3a251f0, sc=sc@entry=0x326bdf0,
trig=trig@entry=0x3b34f80, type=type@entry=1, var=var@entry=0x7ffd7586ffa1 "actor",
field=field@entry=0x7ffd7586ffa7 "inventory", subfield=0x7ffd758705a0 "8461", str=0x7ffd758701a0 "", slen=512)
at dg_variables.c:376
376 if ((c = get_char_by_obj(obj, name)));
(gdb) info local
vd = 0x3a1be20
ch = <optimized out>
c = 0x0
rndm = <optimized out>
obj = 0x3a251f0
o = 0x0
room = <optimized out>
r = 0x0
name = 0x3b224d0 "}32387"
count = <optimized out>
i = <optimized out>
doors = <optimized out>
send_cmd = {0x584d4f "", 0x584d56 "year", 0x584d5d "ndmob"}
echo_cmd = {0x584d64 "indobj", 0x584d6b "random", 0x584d72 "char"}
echoaround_cmd = {0x584d79 "nbeseen", 0x584d86 "ll", 0x584d93 "ower"}
door = {0x584da0 "", 0x584da7 "ached", 0x584dae "eshe"}
force = {0x584db5 "mher", 0x584dbd "her", 0x584dc5 "oll"}
load = {0x584dcd "er", 0x584dd4 "c", 0x584ddb "ller"}
purge = {0x584de2 "f", 0x584dea "ef", 0x584df2 "tp"}
teleport = {0x584dfa "na", 0x584e05 "next_in_room", 0x584e10 "m"}
xdamage = {0x584e1b "pref", 0x584e24 "tpoints", 0x584e2d "pnts"}
zoneecho = {0x584e36 "tdone", 0x584e41 "g_breath", 0x584e4c "ving_para"}
asound = {0x584e57 "aving_petri", 0x584e60 "ri", 0x584e69 "_rod"}
at = {0x584e72 "ng_spell", 0x584e77 "ell", 0x584e7c "killset"}
transform = {0x584e81 "et", 0x584e8d "d", 0x584d72 "char"}
recho = {0x584e99 "exists", 0x584ea1 "is", 0x584ea9 "per_day"}
omove = {0x584d64 "indobj", 0x584eb1 "carried_by", 0x584eb8 "_by"}
(gdb)


int valid_dg_target(struct char_data *ch, int bitvector)
{
  if (IS_NPC(ch))
    return TRUE;  /* all npcs are allowed as targets */
  else if (ch->desc && (STATE(ch->desc) != CON_PLAYING))   ====> crashes here.
    return FALSE; /* Only PC's who are playing can be targetted */

I can provide much more detail

Thanks in advance.
Last edit: 2 years 1 month ago by cunning. Reason: missing information

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7345 by thomas
Replied by thomas on topic Crash bug - need assistance with GDB
please supply output from
frame #0 print *ch
frame #1 print *obj
frame #1 print *ch

My initial assumption here is that the return value from find_char_by_uid_in_lookup_table(32387) returns something that has already been free'd. This was a major problem in the beginning when those lookup tables were introduced, but they should have been cleaned out by now.
I can tell that this happens in a trigger - would you show that trigger, too?

frame #2 print *trig

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7348 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
Thomas! Thank you so much, even before this I think i solved it. I had 3 memory leaks. I was free'ing our unique spec procs as a prototype. I fixed those 2 instances and we also do something unique in corpse creation. I had a leak there as well.

I have been testing to valgrind for a day now, and watching. So far no triggers have corrupted. If it happens again, which it has 20-30 times in past 3 weeks. I will post those values. Right now I cannot give you those since the binary file has changed and I cannot reproduce them.

Though, this gives me more in my GDB tool box to learn how to use.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7349 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
spoke too soon. The same type of crash that i get just happened. I will get you the details now.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7350 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00000000004a3bbc in valid_dg_target (ch=ch@entry=0x2806290, bitvector=bitvector@entry=1) at dg_misc.c:282
282 else if (ch->desc && (STATE(ch->desc) != CON_PLAYING))
(gdb) back
#0 0x00000000004a3bbc in valid_dg_target (ch=ch@entry=0x2806290, bitvector=bitvector@entry=1) at dg_misc.c:282
#1 0x000000000050eebe in get_char_in_room (room=<optimized out>, name=name@entry=0x2729740 "}966") at dg_scripts.c:408
#2 0x00000000005586da in find_replacement (go=go@entry=0x1d67db0, sc=sc@entry=0x1d680f0, trig=trig@entry=0x1d68130,
type=type@entry=0, var=var@entry=0x7ffeaf20adc1 "actor", field=field@entry=0x7ffeaf20adc7 "is_pc",
subfield=0x7ffeaf20b3c0 "", str=0x7ffeaf20afc0 "", slen=512) at dg_variables.c:366
#3 0x000000000055c1a3 in var_subst (go=0x1d67db0, sc=0x1d680f0, trig=0x1d68130, type=0, line=<optimized out>,
buf=<optimized out>) at dg_variables.c:1709
#4 0x000000000050e820 in eval_expr (line=line@entry=0x7ffeaf20b861 "%actor.is_pc%", result=result@entry=0x7ffeaf20bab0 "",
go=go@entry=0x1d67db0, sc=sc@entry=0x1d680f0, trig=trig@entry=0x1d68130, type=type@entry=0) at dg_scripts.c:1507
#5 0x000000000050e86d in eval_expr (line=line@entry=0xf6d893 "(%actor.is_pc%)", result=result@entry=0x7ffeaf20bab0 "",
go=go@entry=0x1d67db0, sc=sc@entry=0x1d680f0, trig=trig@entry=0x1d68130, type=type@entry=0) at dg_scripts.c:1503
#6 0x000000000050e891 in process_if (cond=cond@entry=0xf6d893 "(%actor.is_pc%)", go=go@entry=0x1d67db0, sc=sc@entry=0x1d680f0,
trig=trig@entry=0x1d68130, type=type@entry=0) at dg_scripts.c:1580
#7 0x0000000000511bc9 in script_driver (go_adress=go_adress@entry=0x7ffeaf20cb58, trig=trig@entry=0x1d68130, type=type@entry=0,
mode=mode@entry=0) at dg_scripts.c:2538
#8 0x00000000004b0965 in greet_mtrigger (actor=actor@entry=0x2194150, dir=dir@entry=-1) at dg_triggers.c:227
#9 0x00000000004ebd6c in spell_teleport (ch=0x2194150, victim=0x2194150, casttype=<optimized out>, spellnum=<optimized out>,
obj=<optimized out>, level=<optimized out>) at spells.c:294
#10 0x000000000053aafa in call_magic (caster=0x2806290, cvict=0x1, ovict=0xa, spellnum=0, level=1382321952, casttype=41064260,
ShowFlash=1 '\001') at spell_parser.c:267
#11 0x000000000053b435 in cast_spell (ch=0x2194150, tch=0x2194150, tobj=0xa, tobj@entry=0x0, spellnum=0, spellnum@entry=89,
ShowFlash=32 ' ', ShowFlash@entry=1 '\001') at spell_parser.c:541
#12 0x000000000053beb1 in do_cast (ch=0x2194150, argument=0x7ffeaf20d823 "'tele'", cmd=<optimized out>, subcmd=0)
at spell_parser.c:854
#13 0x0000000000447423 in command_interpreter (ch=0x2194150, argument=0x7ffeaf20d821 "c 'tele'",
argument@entry=0x7ffeaf20d820 " c 'tele'") at interpreter.c:741
#14 0x0000000000539693 in game_loop (local_mother_desc=3) at comm.c:932
#15 0x0000000000403674 in init_game (local_port=<optimized out>) at comm.c:568
#16 main (argc=<optimized out>, argv=<optimized out>) at comm.c:384

(gdb) frame 0 print *ch
Value can't be converted to integer.
(gdb) frame 1 print *ch
Value can't be converted to integer.
(gdb) frame 1 print *trg
No symbol "trg" in current context.

(gdb) up
#2 0x00000000005586da in find_replacement (go=go@entry=0x1d67db0, sc=sc@entry=0x1d680f0, trig=trig@entry=0x1d68130,
type=type@entry=0, var=var@entry=0x7ffeaf20adc1 "actor", field=field@entry=0x7ffeaf20adc7 "is_pc",
subfield=0x7ffeaf20b3c0 "", str=0x7ffeaf20afc0 "", slen=512) at dg_variables.c:366
366 else if (ch->in_room != NOWHERE && (c = get_char_in_room(&world[ch->in_room], name)));
(gdb) info local
vd = 0x28cb9e0
ch = 0x1d67db0
c = 0x0
rndm = <optimized out>
obj = <optimized out>
o = 0x0
room = <optimized out>
r = 0x0
name = 0x2729740 "}966"
count = <optimized out>
i = <optimized out>
doors = <optimized out>
send_cmd = {0x5e7889 "msend ", 0x57672e "osend ", 0x5ab5e4 "wsend "}
echo_cmd = {0x5e7890 "mecho ", 0x5766fb "oecho ", 0x5ab5b1 "wecho "}
echoaround_cmd = {0x5e7897 "mechoaround ", 0x576702 "oechoaround ", 0x5ab5b8 "wechoaround "}
door = {0x5e78a4 "mdoor ", 0x5766eb "odoor ", 0x5ab5aa "wdoor "}
force = {0x5e78ab "mforce ", 0x57670f "oforce ", 0x5ab5c5 "wforce "}
load = {0x5e78b3 "mload ", 0x576717 "oload ", 0x5ab5cd "wload "}
purge = {0x5e78ba "mpurge ", 0x57671e "opurge ", 0x5ab5d4 "wpurge "}
teleport = {0x5e78c2 "mteleport ", 0x57673e "oteleport ", 0x5ab5eb "wteleport "}
xdamage = {0x5e78cd "mdamage ", 0x5766f2 "odamage ", 0x5ab601 "wdamage "}
zoneecho = {0x5e78d6 "mzoneecho ", 0x57675d "ozoneecho ", 0x5ab5f6 "wzoneecho "}
asound = {0x5e78e1 "masound ", 0x5766dd "oasound ", 0x5ab5a1 "wasound "}
at = {0x5e78ea "mat ", 0x5766e6 "oat ", 0x5ab60a "wat "}
transform = {0x5e78ef "mtransform ", 0x576751 "otransform ", 0x5ab5b1 "wecho "}
recho = {0x5e78fb "mrecho ", 0x576726 "orecho ", 0x5ab5dc "wrecho "}
omove = {0x5e7890 "mecho ", 0x576768 "omove ", 0x5ab60f "wmove "}
(gdb)

(gdb) print *ch
$1 = {pfilepos = -1, nr = 233, in_room = 575, was_in_room = 65535, motion_timer = 0, wait = 0, version = 0 '\000', player = {
passwd = '\000' <repeats 30 times>, passwd2 = '\000' <repeats 30 times>, name = 0x16c2ad0 "innkeeper halfling inn keeper",
short_descr = 0x16c2b00 "the Innkeeper", long_descr = 0x16c2b20 "The Innkeeper stands here awaiting your order.\r\n",
description = 0x16c2b60 "The Innkeeper is a jolly old halfling who spends his days eavesdropping \r\non\r\nlocal gossip. In his younger days, he was quite a seasoned traveller.\r\n", title = 0x0, sex = 1 '\001', chclass = 0 '\000', race = 0 '\000',
level = 12 '\f', admlevel = 0 '\000', time = {birth = 1515897099, logon = 1515897099, played = 0}, weight = 200 '\310',
height = 198 '\306', last_age = 0}, real_abils = {str = 11 '\v', str_add = 0 '\000', intel = 11 '\v', wis = 11 '\v',
dex = 11 '\v', con = 11 '\v', cha = 11 '\v', ess = 100 'd'}, aff_abils = {str = 11 '\v', str_add = 0 '\000', intel = 11 '\v',
wis = 11 '\v', dex = 11 '\v', con = 11 '\v', cha = 11 '\v', ess = 100 'd'}, points = {mana = 10, max_mana = 10, hit = 161,
max_hit = 161, move = 50, max_move = 50, hit_regen = 0, mana_regen = 0, move_regen = 0, regen_factor = {100, 100, 100},
armor = 2, gold = 1256, bank_gold = 0, exp = 13000, hitroll = 11 '\v', damroll = 1 '\001', remort_count = 0, deaths = 0,
deaths_this_level = 0, reroll_count = 0, pc_steals = 0, xp_bonus = 0, align_bonus = 0, oldcha = 0, oldstr = 0, oldstradd = 0,
oldint = 0, oldwis = 0, oldcon = 0, olddex = 0, oldclass = 0, oldhit_regen = 0, oldmana_regen = 0, oldmove_regen = 0,
oldremort_total = 0, exploss = 0, dt_day = 0, dt_room = 0, dt_count = 0}, char_specials = {fighting = 0x0, hunting = 0x0,
position = 8 '\b', carry_weight = 12, carry_items = 3 '\003', timer = 0, numplus = 0, succesful_hunt = 0 '\000', saved = {
alignment = 200, idnum = 0, act = {75, 0, 0, 0}, affected_by = {0, 0, 0, 0}, apply_saving_throw = {18, 18, 18, 18, 18},
kills = 0, monthly_kills = 0}}, player_specials = 0x93e040 <dummy_mob>, mob_specials = {memory = 0x0,
attack_type = 0 '\000', default_pos = 8 '\b', damnodice = 2 '\002', damsizedice = 7 '\a', mob_race_special = 0,
last_direction = 0 '\000', func = 0x16c2c00}, affected = 0x0, equipment = {0x0 <repeats 21 times>}, carrying = 0x1d684c0,
desc = 0x0, id = 100366, proto_script = 0x1d680d0, script = 0x1d680f0, memory = 0x0, next_in_room = 0x0, next = 0x1d63bd0,
next_fighting = 0x0, followers = 0x0, master = 0x0, pref = 0, events = 0x0}


ISSUE: Mage teleporting around, invokes greet script. The greet script invokes %actor.is_pc% and this is what i see crashes me all the time.

Name: 'Innkeeper speech', VNum: [ 1130], RNum: [ 127]
Trigger Intended Assignment: Mobiles
Trigger Type: Greet , Numeric Arg: 100, Arg list: None
Commands:
* By AP
if (%actor.is_pc%)
wait 10 sec
say "Adventurers! Welcome!"
wait 20 sec
say "What's that, %actor.name%? Drinks are on you? Huzzah!"
end

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7353 by Parnassus
Replied by Parnassus on topic Crash bug - need assistance with GDB
Have you tried putting in an ELSE (actor is not pc) with a say or echo to see what's happening?

I think the problem is actually:
Is the actor a pc?
Yes: do this.
No: um...crash?

I'm not sure though because I think I usually close off ifs. It's been a while so I'm not sure.

I've been having some problems myself so I'd like to know what the response to an ELSE is.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7357 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
I am not sure that is it. I see tons of scripts using the same format on the stock TBA base. I think the real issue is that the script is fired, but the teleport has not happened yet. It now moves the character and the room check now can show a NOWHERE value if the teleporter immediately quits out or immediately teleports out.

This is specific to teleporting characters into a room that has the %actor.is_pc% check. I do not want speech scripts firing for mobiles entering a room. If i have to i will allow it, but I think the issue is deeper.

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7358 by Fizban
Replied by Fizban on topic Crash bug - need assistance with GDB
It should be pretty easy to test your theory.

As I understand, the crash happens when someone is teleported into the room, but not when they walk into the room?

In those instances it seems to try to check whether the actor is a pc or not before he actor is in the room and is therefore checking whether a null value is or isn't a pc.

If so, adding

wait 1

to the top of the script should probably give it enough time for the player to fully enter the room. If that isn't long enough, wait 1 s should certainly be long enough. Changing the script though isn't really an ideal fix, I think it should be fixed in the code somehow for sure, but seeing if this change solves the problem would at least pinpoint whether or not the problem is what you think it is.

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7359 by Fizban
Replied by Fizban on topic Crash bug - need assistance with GDB
I tested it on TBA.

I setup a greet script.

I walked into the room.

I then used goto to come into the room. Nothing happened in either instance.

I then decided just to be completely sure I'd setup a script in a different room that teleports me into the room with the mob that has the greet script.

It all worked with no crashing, but I do think I recall TBA having an issue with either greet or enter triggers causing crashes in the past, but I don't recall what was changed to solve the issue unfortunately.

I also tried it all without a wait being at the top, it doesn't seem to be necessary on TBA, but might be on the code you're using if TBA's code was changed specifically to make it not be needed there at some point.

However if you use a room-enter script for something similar instead of a mob-greet script, I would definitely suggest putting a wait at the top of your room-enter scripts. This is not to avoid a crash, it's just because when you don't do so it actually looks like this.
1134H 860M 96V > n
You are a pc.
[57700] Fizban's Zone Description Room [ INDOORS PRIVATE HOUSE ATRIUM ] [ Inside ][T 57714]
            Fizban is a rather peculiar old man who enjoys filling his zone  
            with strange triggers, if you were to walk through this zone and 
    [!]     explore it thoroughly with nohassle off you would likely regret  
     |      it. A sign is seen to the right.                                 
    [.]-[.]                                                                  
[ Exits: s ]
[57700] [T57714] Fizban's personal guard is here selling his wares.

1134H 860M 96V >

ie. The message was displayed before the room description was. That's a bit awkward. It is however intended, the reason being that with room-enter scripts unlike mob-greet they are intended to fire before entering the room so that players can be barred from entering the room so long as there is a return 0 on the script prior to any waits.

ie.

A mob-greet script with a return 0 also bars you from entering the room, but you actually enter the room, and then get shoved out, it looks like this.
1134H 860M 96V > n
[57700] Fizban's Zone Description Room [ INDOORS PRIVATE HOUSE ATRIUM ] [ Inside ]
            Fizban is a rather peculiar old man who enjoys filling his zone  
            with strange triggers, if you were to walk through this zone and 
    [!]     explore it thoroughly with nohassle off you would likely regret  
     |      it. A sign is seen to the right.                                 
    [.]-[.]                                                                  
[ Exits: s ]
[57700] [T57714] Fizban's personal guard is here selling his wares.
You are a pc.
We do not allow pc's in here.
[57701] Fizban's Mind [ INDOORS PRIVATE HOUSE ATRIUM ] [ Inside ][T 57737]
    [.]     Fizban's evil mind and ambitions will surely destroy all the     
     |      world over time. It's just a matter of time till you wake up to  
    [!]-[.] realize your life and the world as you know it never really      
            existed and you and your world are in fact just a fictitious     
            reality Fizban imagined... Most likely while eating shrooms.     
[ Exits: n e ]

Room-enter scripts don't even let you see the room if they bar you.
1134H 860M 96V > n
You are a pc.
We do not allow pc's in here.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago - 2 years 1 month ago #7361 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
Fizban, i have teleported around like crazy on my dev port and did not have it happen. But it definitely happens on the live port. I even generated a patch file to make sure i had no differences. It does not happen when walking into the room.

I have added the wait state and allowed teleporting to continue, now i will wait and see. Thanks for all the suggestions. I
Last edit: 2 years 1 month ago by cunning.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7367 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
Crashed again same exact scenario.

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7368 by Fizban
Replied by Fizban on topic Crash bug - need assistance with GDB
Does it ever crash when PC's enter the room, or only ever npc's?

If I remember correctly (which I may not) you ran CWG Rasputin back when the old CWG forums were alive, is that what you're currently using?
int valid_dg_target(struct char_data *ch, int bitvector)
{
  if (IS_NPC(ch))
    return TRUE;  /* all npcs are allowed as targets */
  else if (ch->desc && (STATE(ch->desc) != CON_PLAYING))
    return FALSE; /* Only PC's who are playing can be targetted */
  else if (GET_LEVEL(ch) < LVL_IMMORT)
    return TRUE;  /* as well as all mortals */
  else if (!IS_SET(bitvector, DG_ALLOW_GODS) &&
     GET_LEVEL(ch) >= LVL_GRGOD) /* LVL_GOD has the advance command. Can't allow them to be forced. */
    return FALSE; /* but not always the highest gods */
  else if (!PRF_FLAGGED(ch, PRF_NOHASSLE))
    return TRUE;  /* the ones in between as allowed as long as they have no-hassle off.   */
  else
    return FALSE;  /* The rest are gods with nohassle on... */
}

That's what valid_dg_target looks like in dg_misc.c on tbaMUD, I'm curious if that looks the same for you, or if there is something different going on there which might be causing mobs to not be considered valid dg targets under some circumstances.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7369 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
Fizban,
Exactly what i have. Except i also added a if (ch == NULL) return FALSE; I use stock TBAMUD with all the JediMUD functionality and do use races from Rasputin. (just for the record).

It always crashes on a teleporting mage into the room.

The crash again points to a NOWHERE room.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7370 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
updated all the scripts that use is_pc to now

if !%actor.is_pc%
halt
else

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7371 by Fizban
Replied by Fizban on topic Crash bug - need assistance with GDB
What exactly is a teleporting mage?

Is it casting a spell that teleports it to random locations? Does it have a script that makes it teleport randomly, or is it a spec_proc and not a DG script that causes it to teleport?

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7372 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
it is the normal spell teleport. Exactly how it is on stock TBA. The mages on my game use it to hop around all the areas. It just happens that when they land in any room that has actor.is_pc in some cases it crashes.

best i could tell is that they quit out of the game or teleport out immediately and the script crashes.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7373 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
Crashed again. Now I am getting frustrated. I am not even opposed to setting up Team Viewer to allow someone to look at this. I am no slouch at gdb, and this has me stumped!

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7374 by thomas
Replied by thomas on topic Crash bug - need assistance with GDB

(gdb) frame 0 print *ch
Value can't be converted to integer.
(gdb) frame 1 print *ch
Value can't be converted to integer.
(gdb) frame 1 print *trg
No symbol "trg" in current context.


What I meant was:
in frame #1, type "print *ch", the same in frame #2 (move betweeen frames with up and down)

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #7375 by thomas
Replied by thomas on topic Crash bug - need assistance with GDB
Also - do you know if anyone is intentionally crashing the game?

I would start out by logging somewhat more in interpreter.c:
if (!*argument)
    return;
+ log("PLAYER: %s COMMAND: %s", GET_NAME(ch), argument);
This would of course be a temporary measure.

With this logging you could tell if crashes occurred due to a specific command or a specific player.

Please Log in or Create an account to join the conversation.

  • cunning
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 1 month ago #7376 by cunning
Replied by cunning on topic Crash bug - need assistance with GDB
Oh I already know who and what. It is normal on JediMUD for the mages to teleport around. IT gives them quick entrance to a zone and they can set up a portal. They are not doing it to crash the game. I also am not opposed to doing a team viewer share.


#0 0x00000000004a3bf8 in valid_dg_target (ch=ch@entry=0x2ea59b0, bitvector=bitvector@entry=1) at dg_misc.c:289
289 else if (!WIZ_FLAGGED(ch, WIZ_NOHASSLE))
(gdb) info local
No locals.
(gdb) print *ch
$6 = {pfilepos = 0, nr = 0, in_room = 0, was_in_room = 41824, motion_timer = 0, wait = 20226944, version = 0 '\000', player = {
passwd = "\240\243\064\001\000\000\000\000У4\001", '\000' <repeats 12 times>, "\001\000\000\004\000\000",
passwd2 = "\000o\244]Z\000\000\000\000o\244]Z", '\000' <repeats 12 times>, "\310\306\000\000\000",
name = 0x640b0b0b0b0b000b <error: Cannot access memory at address 0x640b0b0b0b0b000b>,
short_descr = 0x640b0b0b0b0b000b <error: Cannot access memory at address 0x640b0b0b0b0b000b>,
long_descr = 0x350035000a000a <error: Cannot access memory at address 0x350035000a000a>,
description = 0x320032 <error: Cannot access memory at address 0x320032>, title = 0x0, sex = 100 'd', chclass = 0 '\000',
race = 0 '\000', level = 0 '\000', admlevel = 100 'd', time = {birth = 25769803876, logon = 150, played = 700},
weight = 0 '\000', height = 0 '\000', last_age = 0}, real_abils = {str = 0 '\000', str_add = 0 '\000', intel = 0 '\000',
wis = 0 '\000', dex = 0 '\000', con = 0 '\000', cha = 0 '\000', ess = 0 '\000'}, aff_abils = {str = 0 '\000',
str_add = 0 '\000', intel = 0 '\000', wis = 0 '\000', dex = 0 '\000', con = 0 '\000', cha = 0 '\000', ess = 0 '\000'}, points = {
mana = 0, max_mana = 0, hit = 0, max_hit = 0, move = 0, max_move = 0, hit_regen = 0, mana_regen = 0, move_regen = 0,
regen_factor = {0, 0, 0}, armor = 0, gold = 0, bank_gold = 0, exp = 0, hitroll = 0 '\000', damroll = 0 '\000', remort_count = 0,
deaths = 0, deaths_this_level = 0, reroll_count = 0, pc_steals = 0, xp_bonus = 0, align_bonus = 0, oldcha = 0, oldstr = 8,
oldstradd = 0, oldint = 0, oldwis = 0, oldcon = 0, olddex = 0, oldclass = 0, oldhit_regen = 0, oldmana_regen = 0,
oldmove_regen = 0, oldremort_total = 0, exploss = 4194504, dt_day = 0, dt_room = 0, dt_count = 0}, char_specials = {
fighting = 0x0, hunting = 0x1a001a001a001a, position = 26 '\032', carry_weight = 0, carry_items = 0 '\000', timer = 0,
numplus = -8128, succesful_hunt = -109 '\223', saved = {alignment = 0, idnum = 134285312, act = {2, 0, 0, 0}, affected_by = {0,
0, 0, 0}, apply_saving_throw = {0, 0, 0, 0, 0}, kills = 0, monthly_kills = 0}}, player_specials = 0x0, mob_specials = {
memory = 0x0, attack_type = 0 '\000', default_pos = 0 '\000', damnodice = 0 '\000', damsizedice = 0 '\000',
mob_race_special = 0, last_direction = 0 '\000', func = 0x0}, affected = 0x0, equipment = {0x0 <repeats 13 times>, 0x1bbe0, 0x0,
0x0, 0x0, 0x2ac2e00, 0x1d4b690, 0x0, 0x0}, carrying = 0x0, desc = 0x0, id = 0, proto_script = 0x0, script = 0x31,
memory = 0x100020004003b, next_in_room = 0x0, next = 0x0, next_fighting = 0x4d05cf <list_char_to_char+1855>,
followers = 0x2f345a0, master = 0x21, pref = 31093567915781717, events = 0x2e676d0}
(gdb) print ch
$7 = (struct char_data *) 0x2ea59b0
(gdb)


#1 0x000000000050eebe in get_char_in_room (room=<optimized out>, name=name@entry=0x2e55b30 "}1365") at dg_scripts.c:408
408 if (ch && valid_dg_target(ch, DG_ALLOW_GODS))

(gdb) print *ch
value has been optimized out
(gdb) info local
room = <optimized out>
name = 0x2e55b30 "}1365"
ch = <optimized out>

#2 0x00000000005586da in find_replacement (go=go@entry=0x196f7d0, sc=sc@entry=0x196fb10, trig=trig@entry=0x196fb50,
type=type@entry=0, var=var@entry=0x7ffdd9422911 "actor", field=field@entry=0x7ffdd9422917 "is_pc", subfield=0x7ffdd9422f10 "",
str=0x7ffdd9422b10 "", slen=512) at dg_variables.c:366
366 else if (ch->in_room != NOWHERE && (c = get_char_in_room(&world[ch->in_room], name)));
(gdb) print *ch
$2 = {pfilepos = -1, nr = 504, in_room = 1132, was_in_room = 65535, motion_timer = 0, wait = 0, version = 0 '\000', player = {
passwd = '\000' <repeats 30 times>, passwd2 = '\000' <repeats 30 times>, name = 0x125a2c0 "Patrick paladin guild shopkeeper",
short_descr = 0x125a2f0 "Patrick the paladin guild shopkeeper", long_descr = 0x125a320 "Patrick the paladin of Skara Brae\r\n",
description = 0x125a350 "Patrick the paladin of Skara Brae was badly wounded while\r\ndefending the city. He is here trying to serv as best he\r\ncan with his ruined knees. He is still a powerful\r\nswordsman but simply can not g"..., title = 0x0,
sex = 1 '\001', chclass = 0 '\000', race = 0 '\000', level = 20 '\024', admlevel = 0 '\000', time = {birth = 1516034773,
logon = 1516034773, played = 0}, weight = 200 '\310', height = 198 '\306', last_age = 0}, real_abils = {str = 11 '\v',
str_add = 0 '\000', intel = 11 '\v', wis = 11 '\v', dex = 11 '\v', con = 11 '\v', cha = 11 '\v', ess = 100 'd'}, aff_abils = {
str = 11 '\v', str_add = 0 '\000', intel = 11 '\v', wis = 11 '\v', dex = 11 '\v', con = 11 '\v', cha = 11 '\v', ess = 100 'd'},
points = {mana = 10, max_mana = 10, hit = 174, max_hit = 174, move = 50, max_move = 50, hit_regen = 0, mana_regen = 0,
move_regen = 0, regen_factor = {100, 100, 100}, armor = -5, gold = 20000, bank_gold = 0, exp = 8000, hitroll = 0 '\000',
damroll = 20 '\024', remort_count = 0, deaths = 0, deaths_this_level = 0, reroll_count = 0, pc_steals = 0, xp_bonus = 0,
align_bonus = 0, oldcha = 0, oldstr = 0, oldstradd = 0, oldint = 0, oldwis = 0, oldcon = 0, olddex = 0, oldclass = 0,
oldhit_regen = 0, oldmana_regen = 0, oldmove_regen = 0, oldremort_total = 0, exploss = 0, dt_day = 0, dt_room = 0,
dt_count = 0}, char_specials = {fighting = 0x0, hunting = 0x0, position = 8 '\b', carry_weight = 31, carry_items = 5 '\005',
timer = 0, numplus = 0, succesful_hunt = 0 '\000', saved = {alignment = 1000, idnum = 0, act = {11083, 0, 0, 0}, affected_by = {
272, 0, 0, 0}, apply_saving_throw = {10, 10, 10, 10, 10}, kills = 0, monthly_kills = 0}},
player_specials = 0x93e040 <dummy_mob>, mob_specials = {memory = 0x0, attack_type = 0 '\000', default_pos = 8 '\b',
damnodice = 8 '\b', damsizedice = 3 '\003', mob_race_special = 0, last_direction = 0 '\000', func = 0x125a520}, affected = 0x0,
equipment = {0x0 <repeats 21 times>}, carrying = 0x19701e0, desc = 0x0, id = 101024, proto_script = 0x196faf0, script = 0x196fb10,
memory = 0x0, next_in_room = 0x0, next = 0x196e2b0, next_fighting = 0x0, followers = 0x0, master = 0x0, pref = 0, events = 0x0}
(gdb) print ch->in_room
$3 = 1132
(gdb) print world[ch->in_room]
$4 = {number = 2113, zone = 18, sector_type = 0, name = 0xc13930 "The Full Armor of God",
description = 0xc13950 "You enter a holy shop, dedicated to equipping a paladin to stand against \r\nevil. Along the west wall you see a counter and window, behind which \r\nthey are selling some equipment to help paladins in th"..., ex_description = 0xc13d80,
dir_option = {0x0, 0x0, 0x0, 0x0, 0x0, 0xc13b60, 0x0, 0x0, 0x0, 0x0}, motion_info = 0x0, room_flags = {1053708, 0, 0, 0},
light = 0 '\000', func = 0xc13fe0, proto_script = 0x0, script = 0x0, contents = 0x0, people = 0x1dc2b50, timed = -1, events = 0x0}
(gdb) print name
$5 = 0x2e55b30 "}1365"
(gdb) info local
vd = 0x2a22dc0
ch = 0x196f7d0
c = 0x0
rndm = <optimized out>
obj = <optimized out>
o = 0x0
room = <optimized out>
r = 0x0
name = 0x2e55b30 "}1365"
count = <optimized out>
i = <optimized out>
doors = <optimized out>
send_cmd = {0x5e7889 "msend ", 0x57672e "osend ", 0x5ab5e4 "wsend "}
echo_cmd = {0x5e7890 "mecho ", 0x5766fb "oecho ", 0x5ab5b1 "wecho "}
echoaround_cmd = {0x5e7897 "mechoaround ", 0x576702 "oechoaround ", 0x5ab5b8 "wechoaround "}
door = {0x5e78a4 "mdoor ", 0x5766eb "odoor ", 0x5ab5aa "wdoor "}
force = {0x5e78ab "mforce ", 0x57670f "oforce ", 0x5ab5c5 "wforce "}
load = {0x5e78b3 "mload ", 0x576717 "oload ", 0x5ab5cd "wload "}
purge = {0x5e78ba "mpurge ", 0x57671e "opurge ", 0x5ab5d4 "wpurge "}
teleport = {0x5e78c2 "mteleport ", 0x57673e "oteleport ", 0x5ab5eb "wteleport "}
xdamage = {0x5e78cd "mdamage ", 0x5766f2 "odamage ", 0x5ab601 "wdamage "}
zoneecho = {0x5e78d6 "mzoneecho ", 0x57675d "ozoneecho ", 0x5ab5f6 "wzoneecho "}
asound = {0x5e78e1 "masound ", 0x5766dd "oasound ", 0x5ab5a1 "wasound "}
at = {0x5e78ea "mat ", 0x5766e6 "oat ", 0x5ab60a "wat "}
transform = {0x5e78ef "mtransform ", 0x576751 "otransform ", 0x5ab5b1 "wecho "}
recho = {0x5e78fb "mrecho ", 0x576726 "orecho ", 0x5ab5dc "wrecho "}
omove = {0x5e7890 "mecho ", 0x576768 "omove ", 0x5ab60f "wmove "}

Please Log in or Create an account to join the conversation.

Time to create page: 0.404 seconds