Jump to content

Derex

Members
  • Posts

    76
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Derex

  1. Hello, I suggest you run your patch with valgrind --tool=helgrind, I think it will show you the possible race conditions.
  2. Unfortunatelly, the solution will be to make almost entire mangos thread safe. Since all the code called in your new thread needs to be safe. And in your new thread you call ::Update which accesses players, sends mails etc.
  3. It is not stabile and will not be stabile soon, atm I am just adding map servers to the cluster, aka hacking mangos to work as a map server.
  4. The problem is that AuctionHouseMgr::Update which you call from the new thread calls code which is accessing shared memory ( Players, Mails etc ). If 2 threads access/modify the same piece of memory without synchornization, it can cause race condition. You can read wikipedia what is race condition, what can cause it and how to avoid it.
  5. Nice idea, but unfortunatelly its not that simple to implement such thing, you open some thread synchronization issues.
  6. The project is in progress, we have implemented realm, proxy and database servers. AKA the cluster works upto level characters screen. At this point we start implementing Maps. If somebody is interested in the project: #multimangos @ irc.freenode.net http://www.assembla.com/spaces/dashboard/index/multimangos
  7. Hey, it was mine code !!! I used luabind which was based on Boost.Python and I think it was working pritey fine. My idea was beyond lua, I wanted to implement FSM and messaging for the AI. Yet I had to stop development of this because of real life.
  8. This looks to be caused by corrupting the heap, possibly by access to already freed() memory. It can be caused by anything that writes to deleted memory. Recently there was no change in netcode, except the bigger buffer, which I don't see how can be related to the heap. I recommend running valgrind if possible.
  9. I will try to be online tomorow meeting, since me and Neo2003 were the bad guys when trinity was created. I can explain some things.
  10. freghar - as usually with the best idea that matches the philosophy of git
  11. There is problem with ACE because you need to build the ace/config.h file ( which is what autoheader does, ACE offers also a way to build without automake, just using GNU make, infact automake support is experimental and not complete ). Anyway if using cmake you need a way to generate some headers that normally autoheader and configure generate, like ./dep/ACE_wrappers/ace/config.h ./config.h ./src/shared/SystemConfig.h.
  12. Hello, You are correct, this is bug, however it is fixed in previous commits. The problem is missing check in iSendPacket for m_PacketQueue.is_empty(), in git netcode, this packet queue no longer exists. I am glad that somebody else is looking around this code, If you find another bug please send me a pm, or post it in the bug section. If you want to find bugs or examine how mangos works just send me a pm, I have several ideas on what you can do.
  13. Hello, at looking at this: http://amki.kicks-ass.org/doxygens/mangos/classWorldSocket.html The inheritance and collaboration diagrams are wrong, they represent stuff from the old netcode, while the rest of the page seems correct ( except some english spell errors I made ). I think the project can benefit a lot from having that doxygen documentation.
  14. You will need to go through the source alone
  15. AFIK no-body is working on it.
  16. Infact ... looking at the new code it offers the option to go step further and do Player::Update also in paralel. This will give more performance, but will potentially cause more crashes. After having paralel Player::Update, its possible to differ process some WorldSession opcodes, like movement. So should I do this or do the old stuff ?
  17. The multiprocessing idea would mean this model: http://www.bigworldtech.com/technology/server.php (the second picture). With TAO it will be possible to tie all the servers in single executable, which will result in multithreading version ( with the same performance ). Login Server - realmd Base Server - to this players will connect (call it proxy server ). Cell Server - this handles one or several maps ( call it map server ). World Server - handles chat, guilds, etc.
  18. man, the -ex is not for filename it specifies command to execute --eval-command=COMMAND, -ex Execute a single GDB command. May be used multiple times and in conjunction I will try to make a script that can be used to directly debug mangos, if I have free time this weekend.
  19. Maybe these gdb commands may be usefull: set logging file /some/file set logging on Together with gdb arg '-ex'
  20. I tryed to do multiprocessing before several mounths, and I used raw sockets for this, and from the expiriance there I can clearly say its inpossible to do it without sacrificing a lot lot of maintainability in the code ( and it will be slow if you use all-in-one server ). The thing I did got totally not-maintainable, I ended in receiving a given client packet ,then modifing it in proxy server and resending it to world server and from there modifing it again and sending it to map server which was totally not-maintainable, everything I change required me to change code in 3 different servers. Moreover IF I used sockets then I COULD never bunch all the servers in one executable and take performance benefits of this , I WOULD ever use SOCKETS to connect, IN CORBA you can use collocated servants, I dont know if you know whats this if you dont better don't discuss wheather corba is good or not for IPC. There shouldn't be any point of single failure. I supose you mean that this supervisor will be actually many supervisors called proxy servers in my terms. In my idea for multiprocessing will be something like this: PROXY servers - to these servers players will connect, one realm will consist of one or many proxy servers, and there will be load balancing of their load from realmd ( aka realmd will give different addresses to different players ). Proxy servers will do the communication with the other internal servers. MAP servers - this will handle one or several maps, it will be SINGLETHREADED !!!! WORLD server - This will handle stuff like channel chat, guilds, groups, friends and other stuff. If this server crashes, players will most likely stop receiving channel chat or guild stuff for a bit. Its possible to make this server reliable by adding backup server that will maintain the same state as the master WORLD server, but this is too much efford I think. Now the good part of using CORBA for IPC with all this design is that you can tie up all the stuff in one executable and use colocated CORBA servants, this means that CORBA will do direct calls between the servers ( it wont use TCP, it wont use UDP , it wont use shared memory ... it will do it directly ). This gives a very very powerfull weapon and explains why I wont do multithreaded maps, several map servers tied in one executable will do the same work.
  21. GDB: The GNU Project Debugger Hi, this is a simple/dirty tutorial of what is GDB and how to use it. This tutorial asumes that you can start your mangos-worldd by typing: mangos-worldd in the console. 1. Before you start debugging mangos you need to have ensured that it is compiled with debug information. To build mangos with debug info just add --with-debug-info to your options when running ../configure. Then compile and install mangos as usual. 2. Now you can start mangos with gdb by typing this. gdb mangos-worldd Then you will most likely see something like this: derex@*:~/workspace/mangos/build$ gdb mangos-worldd GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu"... (gdb) (gdb) - is the GDB command prompt , here you can type some commands, almost like in normal shell. Now after you have gdb running, you may instruct it to start mangos ( by having gdb start mangos you can debug it ), here is the command: run Just type it and if you are lucky you will have mangos loading. Ok ... you made it, now mangos runs. Take a break until it crash ,then you can come back 3. When mangos crashes you will most likely see this message, or any similar. Program received signal SIGSEGV, Segmentation fault. [switching to Thread 0x42c5c950 (LWP 9283)] Player (this=0x42c598e0, session=0x0) at ../../../src/game/Player.cpp:265 265 ../../../src/game/Player.cpp: No such file or directory. in ../../../src/game/Player.cpp (gdb) Now you can type some comands to get information about the crash, and possibly give it to some dev to fix the problem. Here are the commands that are best to be typed ( or at least I find the most usefull for crash report ) shell echo -e "\\nCRASH ON" `date` info program shell echo -e "\\nBACKTRACE\\n" bt shell echo -e "\\nBACKTRACE FULL\\n" bt full shell echo -e "\\nTHREADS\\n" info threads shell echo -e "\\nTHREADS BACKTRACE\\n" thread apply all bt full Just type them one after another and give the output in your bug report ... OK. Thats it, now we can think of some way to automate all this process. GDB has 2 very good switches: --batch Exit after processing options. --command=FILE, -x Execute GDB commands from FILE. 4. So you can put all the commands in one file and have GDB execute it, and when it finishes to exit. Lets say we put this in one file called gdb-commands. run shell echo -e "\\nCRASH ON" `date` info program shell echo -e "\\nBACKTRACE\\n" bt shell echo -e "\\nBACKTRACE FULL\\n" bt full shell echo -e "\\nTHREADS\\n" info threads thread apply all bt full Now you can start the whole monster with: gdb mangos-worldd --batch -x /path/to/gdb-commands TIPS 1.You can also redirect stdout to some log file. I mean this: gdb mangos-worldd --batch -x /path/to/gdb-commands > /some/log/file 2.You can add a tail command to gdb-commands file to get the latest lines from your server.log file: shell echo -e "\\nSERVER.LOG\\n" shell tail -n 50 /path/to/your/server.log 50 means how much lanes to take from server.log 3. You can add -ggdb3 -g3 flags to your CXXFLAGS in order to get more debug output. If you add them there is no need to add --with-debug-info switch in order to get meaningfull backtrace. 4. You can pass arguments to mangos-worldd by passing them to the run gdb command ( run -c /path/to/mangosd.conf ). 5. With recent mangos versions you can also add this line to your gdb-commands shell echo -e "\\nMANGOS VERSION" shell mangos-worldd --version To get correct version information about mangos ( so no need to specify it in the bug report ... its already there and its correct, and you can't forget it ).
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use