EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   Any C++ guru for help, or .. is it the wrong board ? (https://www.eqemulator.org/forums/showthread.php?t=11744)

smogo 02-06-2004 03:24 AM

Any C++ guru for help, or .. is it the wrong board ?
 
Duno if it is the place to post this, but playing around with the code, i get stuck by a crash in zone :

in NPC::Process() line 521 there is a call to AI_Process(). This refers to the parent's class Mob::AI_Process(). During the call, "this" changes to a wrong value.

Below is a gbd output, where frame 1 refers to AI_Process, and frame 2 to the caller's Process(). i read that "this" turns from 0x86885e0 (correct) to 0xbffff870 (incorrect, and obviously somewhere on the stack, where it does not belong IMHO)

am i just dumb at C++ ? is it a thread related ?
Code:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 27800)]
0x08715848 in ?? ()
Current language:  auto; currently c
(gdb) bt
#0  0x08715848 in ?? ()
#1  0x080e9833 in Mob::AI_Process() (this=0xbffff870) at MobAI.cpp:942
#2  0x080c496d in NPC::Process() (this=0x86885e0) at npc.cpp:521
#3  0x08092710 in EntityList::MobProcess() (this=0x82730a0)
    at linked_list.h:174
#4  0x080c6f9a in main (argc=5, argv=0x5f) at net.cpp:343
#5  0x4018dd06 in __libc_start_main () from /lib/libc.so.6
(gdb) frame 1
#1  0x080e9833 in Mob::AI_Process() (this=0xbffff870) at MobAI.cpp:942
942                            Mob* tmptar = entity_list.AICheckCloseArrgo(this, argo, assist);
Current language:  auto; currently c++
(gdb) print this->name
$1 = "\0\0\0\0\0\0i586\0/repository/vol313/bld/eqemu/bin/zone\0qeynos\0192.168."
(gdb) up
#2  0x080c496d in NPC::Process() (this=0x86885e0) at npc.cpp:521
521            AI_Process();
(gdb) print this->name
$2 = "Kinloc_Flamepaw's_pet00", '\0' <repeats 40 times>
(gdb) l
516                            safe_delete(hp_app);
517                    }
518            }
519
520            adverrorinfo = 3;
521            AI_Process();
522            adverrorinfo = 0;
523        return true;
524

Thanks for any help. Sry if this is not the correct forum.


All times are GMT -4. The time now is 11:49 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.