ArcEmu: Porting To Arm - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Porting To Arm

#1 User is offline   Artox 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 01-November 08

Posted 17 March 2014 - 04:21 PM

Hello everyone,

I have been quite inactive in the past but now I started to port ArcEmu to arm processors, specifically the beaglebone black as my testing platform.
So far I have got it to compile and logon is working as it should, I verified by logging in using the WoW client.

To reach this state I had to patch mainly g3d, and a cosmetic change to arcemu, all of which can be found in my pullrequest here.

jackpoz already linked a page on MSDN talking about possible undefined behaviour when porting C++ code to ARM, and indeed that is what I got with the worldserver:

world, if started, will just print its Usage message and then terminate. Apparently something is going wrong parsing the commandline arguments.
By commenting lines 133-156 in Master.cpp I skipped parsing commandline arguments since they are not really important.

This allows the worldserver to continue its startup and crash later.

As I mentioned before, the worldserver just crashes later. Here follows detailed information on the crash:
[03-17-2014][00:24][Arcemu][2014-03-17 00:24:54] 
[03-17-2014][00:24][Arcemu]ArcEmu 4.0-TRUNK 21f6a8a/Release-Linux-ARM :: World Server
The key combination <Ctrl-C> will safely shut down the server at any time.
[03-17-2014][00:24][Arcemu]Config: Loading Config Files...
[03-17-2014][00:24][Arcemu]Database: Database successfully validated.
[03-17-2014][00:24][Arcemu] [BSC] /home/josua/Artox_arcemu/src/arcemu-world/World.cpp:1667 AnnounceColorChooser Announce colors initialized.
[03-17-2014][00:24][Arcemu]World: Loading DBC files...
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/WorldMapOverlay.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/Achievement_Category.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/Achievement_Criteria.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/Achievement.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/CharTitles.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/CurrencyTypes.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/BarberShopStyle.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/ItemSet.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/Lock.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/EmotesText.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/SkillLineAbility.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/SpellItemEnchantment.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/GemProperties.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/GlyphProperties.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/GlyphSlot.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/SkillLine.dbc.
[03-17-2014][00:24][Arcemu]DBC: Loading DBC/Spell.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ItemExtendedCost.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/Talent.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/TalentTab.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SpellCastTimes.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SpellDifficulty.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SpellRadius.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SpellRange.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SpellRuneCost.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SpellDuration.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SpellShapeshiftForm.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ItemRandomProperties.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/AreaGroup.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/AreaTable.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/FactionTemplate.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/Faction.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/TaxiNodes.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/TaxiPath.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/TaxiPathNode.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/CreatureSpellData.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/CreatureFamily.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ChrRaces.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ChrClasses.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/Map.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/AuctionHouse.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ItemRandomSuffix.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtCombatRatings.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ChatChannels.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/DurabilityQuality.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/DurabilityCosts.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/BankBagSlotPrices.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/StableSlotPrices.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtBarberShopCostBase.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtChanceToMeleeCrit.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtChanceToMeleeCritBase.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtChanceToSpellCrit.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtChanceToSpellCritBase.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtRegenMPPerSpt.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtOCTRegenMP.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtRegenHPPerSpt.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/gtOCTRegenHP.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/AreaTrigger.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ScalingStatDistribution.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ScalingStatValues.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/ItemLimitCategory.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/QuestXP.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/MailTemplate.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/WMOAreaTable.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/SummonProperties.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/NameGen.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/LFGDungeons.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/Vehicle.dbc.
[03-17-2014][00:25][Arcemu]DBC: Loading DBC/VehicleSeat.dbc.
[03-17-2014][00:25][Arcemu]World: Processing 49839 spells...
[03-17-2014][00:25][Arcemu]World: Beginning progressive server startup with 1 threads.
[03-17-2014][00:25][Arcemu]ThreadPool: Thread 5 left the thread pool.
[03-17-2014][00:25][Arcemu]ThreadPool: Thread 5 is now executing task at 0x18e1780.
[03-17-2014][00:25][Arcemu]Storage: 37299 entries loaded from table items.
[03-17-2014][00:25][Arcemu]Storage: 630 entries loaded from table itemnames.
[03-17-2014][00:25][Arcemu]Storage: 30739 entries loaded from table creature_names.
[03-17-2014][00:25][Arcemu]Storage: 19374 entries loaded from table gameobject_names.
[03-17-2014][00:25][Arcemu]Storage: 30739 entries loaded from table creature_proto.
[03-17-2014][00:25][Arcemu]Storage: 24254 entries loaded from table display_bounding_boxes.
[03-17-2014][00:25][Arcemu]Storage: 10 entries loaded from table vendor_restrictions.
Bus-Zugriffsfehler (Speicherabzug geschrieben)

The last message might have just read Segmentation-Fault in english, but the "Bus-" is a new thing I have never seen before. Kinda interesting.
Following is a backtrace from the coredump:
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 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 "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/secret/Artox_arcemu_arm/world...done.
[New LWP 26372]
[New LWP 26373]
[New LWP 26374]
[New LWP 26375]
[New LWP 26376]
[New LWP 26377]
[New LWP 26368]
[New LWP 26369]
[New LWP 26370]
[New LWP 26371]
[New LWP 26367]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `./world'.
Program terminated with signal 7, Bus error.
#0  SQLStorage<AreaTrigger, HashMapStorageContainer<AreaTrigger> >::LoadBlock (this=0x14fdcc0, fields=0x18a6860, Allocated=0x3633fb8, reload=false)
	at /home/secret/Artox_arcemu/src/arcemu-world/../arcemu-shared/Storage.h:628
628                                             		offset += sizeof(float);
(gdb) bt
#0  SQLStorage<AreaTrigger, HashMapStorageContainer<AreaTrigger> >::LoadBlock (this=0x14fdcc0, fields=0x18a6860, Allocated=0x3633fb8, reload=false)
	at /home/secret/Artox_arcemu/src/arcemu-world/../arcemu-shared/Storage.h:628
#1  0x0041b25e in SQLStorage<AreaTrigger, HashMapStorageContainer<AreaTrigger> >::Load (this=0x14fdcc0, IndexName=0x7a82bc "areatriggers", FormatString=0x7a7fc8 "ucuusffffuu")
	at /home/secret/Artox_arcemu/src/arcemu-world/../arcemu-shared/Storage.h:707
#2  0x00448044 in CallbackP2<SQLStorage<AreaTrigger, HashMapStorageContainer<AreaTrigger> >, char const*, char const*>::operator() (this=0x18a68a0)
	at /home/secret/Artox_arcemu/cmake/../src/arcemu-shared/Database/../CallBack.h:153
#3  0x004453a2 in CallbackP2<SQLStorage<AreaTrigger, HashMapStorageContainer<AreaTrigger> >, char const*, char const*>::execute (this=0x18a68a0)
	at /home/secret/Artox_arcemu/cmake/../src/arcemu-shared/Database/../CallBack.h:154
#4  0x006da774 in Task::execute (this=0x18e1528) at /home/secret/Artox_arcemu/src/arcemu-world/World.cpp:1169
#5  0x006da7a0 in TaskExecutor::run (this=0x18e1780) at /home/secret/Artox_arcemu/src/arcemu-world/World.cpp:1183
#6  0x0071a468 in thread_proc (param=0x1510268) at /home/secret/Artox_arcemu/src/arcemu-shared/Threading/ThreadPool.cpp:331
#7  0xb6ee1ebc in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
#8  0xb6904318 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#9  0xb6904318 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) info locals
p = 0x18e1505 "ffffuu"
structpointer = 0x3633fb8 "-"
offset = 17
f = 0x18a6874


Maybe someone wants to have a lot of fun?

I have been debugging this a bit, and explained what I think is happening in IRC. I dont want to turn it into a proper text now, but posting it here for interested people:
[22:15] <Artox> well, someone thought to optimize database storage
[22:15] <Artox> like
[22:15] <Artox> use 8 bits for uint8
[22:15] <Artox> 16 for uint16, short, whatever ist called
[22:15] <Artox> and store them in one piece of memory
[22:15] <Artox> oen after another without gaps
[22:15] <Artox> one*
[22:16] <Artox> now the compiler generates store instructions
[22:16] <Artox> to write the data to memory
[22:16] <Artox> everytime teh array is accessed by the code
[22:16] <Artox> wether its uint8, uint16 or uint32
[22:16] <Artox> a store instruction is created
[22:16] <Artox> and executed with the first free address in the memory area
[22:17] <Artox> addresses can point to single bytes in the system memory
[22:17] <Artox> but store instructions may only be done for full 32bit words
[22:17] <Artox> AND
[22:17] <Artox> only at word boundaries
[22:17] <Artox> a arm word is 4 byte long
[22:17] <Artox> so 0only addresses 0x00, 0x04, 0x08, ... are allowed for storing or reading
[22:17] <Artox> loading*
[22:18] <Artox> but the one who optimizes our memory usage
[22:18] <Artox> thinks storing stuff at 0x3 is fine
[22:18] <Artox> which it kinda is, processors have a storebyte instruction
[22:18] <Artox> but gcc does not automatically use it
[22:18] <Artox> and even if it does
[22:18] <Artox> it doesnt when writing a word, aka uint32
[22:19] <Artox> but teh address may already be 0x03 because of a previous writeByte
[22:19] <Artox> and the processor throws an exception

Posted Image
0

#2 User is offline   Nivirx 

  • Newbie
  • Group: Members
  • Posts: 8
  • Joined: 28-July 08
  • Gender:Male
  • Location:Florida
  • Interests:Programing, Networking, Photography.
  • Server OS:BSD

Posted 18 March 2014 - 09:19 AM

I see the joke I made in IRC actually became something :) . I will see if I can do some debugging and help out on IRC but I don't get off work till 22:00 EST tonight, but I am free tomorrow.
0

#3 User is offline   Artox 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 01-November 08

Posted 18 March 2014 - 09:41 AM

And the crash is fixed!
[12:03] <dfighter_> [2014-03-17][22:40:15] <dfighter> I remember some macro that changed struct packing rules
[12:03] <dfighter_> :P
That's exactly what I used then, told the compiler to pack members at word boundaries(4 byte), and hardcoded the padding values in the load and cleanup code of the Storage class.

and here is a shortened console log with all the highlights
[03-18-2014][15:34][Arcemu][2014-03-18 15:34:53] 
[03-18-2014][15:34][Arcemu]ArcEmu 4.0-TRUNK 703c832/Release-Linux-ARM :: World Server
[03-18-2014][15:35][Arcemu]World: Database loaded in 50200ms.
[03-18-2014][15:37][Arcemu]Server: Ready for connections. Startup time: 164253ms
[03-18-2014][15:37][Arcemu]LogonCommClient: Attempting to connect to logon server...
[03-18-2014][15:37][Arcemu]LogonCommClient: Authenticating...
[03-18-2014][15:37][Arcemu]LogonCommClient: Authentication OK.
[03-18-2014][15:37][Arcemu]LogonCommClient: Registering Realms...
[03-18-2014][15:37][Arcemu]LogonCommClient: Realm `Arcemu` registered as realm 1.
[03-18-2014][15:37][Arcemu]LogonCommClient: Logonserver latency is 7ms.
Posted Image
Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users