error running server

Added by packpro almost 8 years ago

Hi,

I run server and client in one PC.

After 10 minitutes I play game, i have follow error message in "ryzom_entities_game_service.exe".
error message:
Access Violation exception generated at 0xCE33F0, thread attempts to read at 0x2.
The thread attempted to read from or write to a virtual address for which it does not have the appropriate access.

Regard!

err_2.png (48.8 kB)


Replies (17)

RE: error running server - Added by packpro almost 8 years ago

When quit client, i have follow error in "ryzom_entities_game_service.exe".

Access Violation exception generated at 0xCE33F0, thread attempts to read at 0x2.
The thread attempted to read from or write to a virtual address for which it does not have the appropriate access.

Regard!

err_3.png (21.5 kB)

RE: error running server - Added by kervala almost 8 years ago

Sorry, but your screenshots are not enough to help us :(

You should run EGS in Debug mode from Visual C++ and you'll get a lot more details.

RE: error running server - Added by packpro almost 8 years ago

I run EGS in Debug mode from Visual C++.

in "\code\ryzom\server\src\entities_game_service\player_manager\player_manager.cpp"

void CPlayerManager::savePlayerCharRecurs( uint32 userId, sint32 idx, std::set<CCharacter*> &charAlreadySaved, const std::string *filename) {
... ... ...

// perform a 'serial' save
CMemStream f;
try { {
H_AUTO(SavePlayerSerialBS);
(*itPlayer).second.Player->saveCharacter(f,idx); // here , occur error
}
CBackupMsgSaveFile msg( serialFileName, CBackupMsgSaveFile::SaveFile, BsiGlobal ); {
H_AUTO(SavePlayerMakeMsgBS);
msg.DataMsg.serialBuffer((uint8*)f.buffer(), f.length());
} {
H_AUTO(SavePlayerSendMessageBS);
BsiGlobal.sendFile( msg );
}
}
catch( Exception& ) {
nlwarning("(EGS)&lt;CPlayerManager::savePlayer&gt; : Can't serial file %s (connection with BS service down ?)",serialFileName.c_str());
return;
}
... ... ...

Regard!

RE: error running server - Added by packpro almost 8 years ago

sorry, i mistake.

occur error follow:
in "\code\ryzom\server\src\entities_game_service\player_manager\player_manager.cpp"
-----------------------------------
void CPlayerManager::savePlayerCharRecurs( uint32 userId, sint32 idx, std::set<CCharacter*> &charAlreadySaved, const std::string *filename) {

if (PDRSave)
{
// perform a 'pdr' save
CMemStream f;
static CPersistentDataRecordRyzomStore pdr;
pdr.clear();
try
{
    {
H_AUTO(SavePlayerPDRStore);
(*itPlayer).second.Player->storeCharacter(pdr,idx); // here , occur error
}
CBackupMsgSaveFile msg( pdrFileName, CBackupMsgSaveFile::SaveFile, BsiGlobal ); {
if (XMLSave) {
H_AUTO(SavePlayerPDRMakeTxtMsgBS);
std::string s;
pdr.toString(s);
msg.DataMsg.serialBuffer((uint8*)&s[0], (uint)s.size());
}
else {
H_AUTO(SavePlayerPDRMakeBinMsgBS);
uint32 bufSize= pdr.totalDataSize();
vector&lt;char&gt; buffer;
buffer.resize(bufSize);
pdr.toBuffer(&buffer[0],bufSize);
msg.DataMsg.serialBuffer((uint8*)&buffer[0], bufSize);
}
} {
H_AUTO(SavePlayerSendMessageBS);
BsiGlobal.sendFile( msg );
}
}
catch( Exception& ) {
nlwarning("(EGS)&lt;CPlayerManager::savePlayer&gt; : Can't serial file %s (connection with BS service down ?)",pdrFileName.c_str());
return;
}
}

Regard!

RE: error running server - Added by packpro almost 8 years ago

i debug step-in,

in "D:\work\r_game\code\ryzom\common\src\game_share\persistent_data_template.h"

// store()
void PERSISTENT_CLASS::store(CPersistentDataRecord &pdr _PERSISTENT_STORE_ARGS) const {
...
// Add user-defined code
#ifdef PERSISTENT_PRE_STORE
PERSISTENT_PRE_STORE // here, occur error
#endif
...
}

Regard!

RE: error running server - Added by packpro almost 8 years ago

Hi,
I debugged more deeply.

in "\code\ryzom\server\src\entities_game_service\fame_pd.cpp"

void CFameContainerEntryPD::setLastFameChangeTrend(CFameTrend::TFameTrend __v, bool forceWrite) {
nlassert(v<CFameTrend::_TFameTrend_useSize);
if ((_LastFameChangeTrend != __v) || forceWrite) {
PDSLib.set(0, _BaseRow, (RY_PDS::TColumnIndex)(3), (uint32)_v); // here occur error
}
_LastFameChangeTrend = __v;
}

template&lt;typename T&gt;
void set(TTableIndex table, TRowIndex row, TColumnIndex column, const T& value, const NLMISC::CEntityId& objectId) {
if (PDVerbose)
nlinfo("CPDSLib: %12s index=%u:%u, column=%u, value='%s' %s", "set", table, row, column, pdsToString(value).c_str(), objectId.toString().c_str());
CDbMessage&    msg = nextMessage((uint8)table, row);
msg.updateValue(column, value, objectId);// here occur error
}

Regard!

RE: error running server - Added by ragnar-gd over 7 years ago

Hi, packpro,

did you get or find a solution? I just want to run a server on windows as well...

RE: error running server - Added by packpro over 7 years ago

Hi, ragnar-rd,

Update in "code\ryzom\server\src\pd_lib\pd_messages.h"
/// \name setup message methods
// @{
/// update value
template&lt;typename T&gt;
void updateValue(TColumnIndex column, const T& value) {
setHeader(UpdateValue);
uint    sz = 0;
//union                    // 64 bits
//{
// uint8 _Value0[8];
// uint16 _Value1[4];
// uint32 _Value2[2];
// uint64 _Value3[1];
//};
// update 20101119 by packpro
if (sizeof(value) == 1) {
sz = 0;
memcpy(&(_Value0[0]), &value, sizeof(value));
}
else if (sizeof(value) == 2) {
sz = 1;
memcpy(&(_Value1[0]), &value, sizeof(value));
}
else if (sizeof(value) == 4) {
sz = 2;
memcpy(&(_Value2[0]), &value, sizeof(value));
}
else if (sizeof(value) == 8) {
sz = 3;
memcpy(&(_Value3[0]), &value, sizeof(value));
}
//if (sizeof(value) == 1)            { sz = 0; _Value0[0] = (uint8)(&value); }
//else if (sizeof(value) == 2) { sz = 1; _Value1[0] = (uint16)(&value); }
//else if (sizeof(value) == 4) { sz = 2; _Value2[0] = (uint32)(&value); }
//else if (sizeof(value) == 8) { sz = 3; _Value3[0] = (uint64)(&value); }
_ColumnAndSize = (uint16)(column | (sz << 14));
}
/// update value
template&lt;typename T&gt;
void updateValue(TColumnIndex column, const T& value, const NLMISC::CEntityId& objectId) {
setHeader(UpdateValue);
uint    sz;
// update 20101119 by packpro
if (sizeof(value) == 1) {
sz = 0;
memcpy(&(_Value0[0]), &value, sizeof(value));
}
else if (sizeof(value) == 2) {
sz = 1;
memcpy(&(_Value1[0]), &value, sizeof(value));
}
else if (sizeof(value) == 4) {
sz = 2;
memcpy(&(_Value2[0]), &value, sizeof(value));
}
else if (sizeof(value) == 8) {
sz = 3;
memcpy(&(_Value3[0]), &value, sizeof(value));
}
//if (sizeof(value) == 1)            { sz = 0; _Value0[0] = (uint8)(&value); }
//else if (sizeof(value) == 2) { sz = 1; _Value1[0] = (uint16)(&value); }
//else if (sizeof(value) == 4) { sz = 2; _Value2[0] = (uint32)(&value); }
//else if (sizeof(value) == 8) { sz = 3; _Value3[0] = (uint64)(&value); }
_ColumnAndSize = (uint16)(column | (sz << 14));
//_MapTableRow |= MESSAGE_REMAP_ENTITYID_PRESENT;
_ObjectIdPresent = true;
_ObjectId = objectId;
}

Regard!

RE: error running server - Added by ragnar-gd over 7 years ago

Thank you!

P.S.: ... is there an "open" issue? And did you commit that code to the project?

RE: error running server - Added by ragnar-gd over 7 years ago

I see what you did there.

It fixes the problem on 32bit systems for sure, and i wouldn't have been able to come up with anything comparable (in code written by me you'll never find any pointer-magic... :)

But i have no experience with 64bit coding - doesn't this have a side-effect on the 64bit linux version? Sorry if my grasp on this problem is rather slippery... Were you able to test it with 64bit linux, just before i open a new issue here?

Does anyone else here have an opinion on this?

I'd really like to see a fix here, as my server keeps crashing (rather hanging) on windows every minute even with only one client connected... :(

RE: error running server - Added by packpro over 7 years ago

I tested only on windows 7 32bit.
Regard!

RE: error running server - Added by ragnar-gd over 7 years ago

Thank you for your feedback!
I'll apply that fix now.
I've already set up a VM with Debian 64 bit, and i hope i'll have a result within the next few weeks.

RE: error running server - Added by ragnar-gd over 7 years ago

packpro,

like this, it doesn't work as desired, compiling failes.
Most probably i'm doing something wrong.
Can you upload the complete file as an attachement, please? *<:)

RE: error running server - Added by packpro over 7 years ago

ragnar-gd,

I compiled with vs 2008 in win 7.
Regard!

pd_messages.h (32.4 kB) Magnifier

RE: error running server - Added by Naush over 7 years ago

Humm sorry but for me this patch is a non sens

You are doing what memcpy is doing plus an extra call to memcpy. Also you can achieve the same using union/struct removing extra call + stack management.

Are you using cmake ?
can you give me assssembly code from the original code ?

Once again sorry, but I've never seen this problem using legacy build system either in 32bit nor 64bit windows/linux :)

RE: error running server - Added by ragnar-gd over 7 years ago

Naush,

the solution is here:

http://dev.ryzom.com/boards/17/topics/4155

Look for the download-link of

pd_messages.h

...and try out that file.

Regards,

Ragnar G.D.

RE: error running server - Added by xingbarking over 7 years ago

hi ,i try it!

(1-17/17)