Issue information

Issue ID
#5460
Status
Invalid
Severity
None
Started
Hercules Elf Bot
Mar 17, 2012 23:15
Last Post
Hercules Elf Bot
Apr 19, 2012 18:54
Confirmation
N/A

Hercules Elf Bot - Mar 17, 2012 23:15

Originally posted by [b]Vali[/b]
Hi,

This is happening when the server is running under Debian 6 (64 bit). The last week all was working fine. Today if a monster is killed the map server crashes.

I downloaded the source to windows 7 and compiled it, here is working fine. I don't know if this happens to in another linux versions.

Vali~

Hercules Elf Bot - Mar 18, 2012 0:07

Originally posted by [b]Vali[/b]
I forgot to say that is 64 bit. I used the command ./configure --enable-64bit before compile.

Hercules Elf Bot - Mar 18, 2012 0:58

Originally posted by [b]Ind[/b]
what revision is this?

Hercules Elf Bot - Mar 18, 2012 1:14

Originally posted by [b]Vali[/b]
Im using the last revision now 15705 and still happens.

Hercules Elf Bot - Mar 18, 2012 1:33

Originally posted by [b]Epoque[/b]
Can you provide a core dump/GDB trace? Enable GDB logging under linux and wait for it to happen again and retrieve the trace :) thanks.

Hercules Elf Bot - Mar 18, 2012 3:37

Originally posted by [b]sizenine[/b]
It's not happening for me anymore, also on r15705.

This post has been edited by sizenine on Mar 18, 2012 3:38

Hercules Elf Bot - Mar 18, 2012 9:12

Originally posted by [b]Vali[/b]
[quote name='Epoque' timestamp='1332034423' post='7671']
Can you provide a core dump/GDB trace? Enable GDB logging under linux and wait for it to happen again and retrieve the trace :) thanks.
[/quote]

How to do that?

Hercules Elf Bot - Mar 18, 2012 10:13

Originally posted by [b]Vali[/b]
I tried but i don't know if I did it correctly.... I attach a screenshot.

This post has been edited by Vali on Mar 18, 2012 10:14

Hercules Elf Bot - Mar 18, 2012 10:45

Originally posted by [b]Vali[/b]
Ok, I found the problem. It comet from a custom source, I do not know why works in windows and not in linux but... well anyway i leave it here to know if its possible to do something.

[CODE]
/*==========================================
* Update mob achievements
* Updates for everyone in share of sd's party who is in range
*------------------------------------------*/
void achievement_update_mob( struct map_session_data *sd, struct mob_data *md )
{
struct party_data *pd;
if( sd == NULL || md == NULL )
return;
pd = party_search( sd->status.party_id );
if( pd && pd->party.exp )
map_foreachinrange( achievement_update_mob_sub, &md->bl, AREA_SIZE, BL_PC, sd->status.party_id, md );
else
achievementDB->foreach( achievementDB, achievement_update_sub, sd, ( int ) A_MOB, md ); // <<<<<<<<<<<<<<<<<<<<<from here
}
[/CODE]

[CODE]
/*==========================================
* Checks whether any achievement is effected by
* parameters in va_list
*------------------------------------------*/
static int achievement_update_sub( DBKey key, DBData *data, va_list ap )
{
struct achievement_data *ad = ( struct achievement_data *) data;
struct map_session_data *sd = va_arg( ap, struct map_session_data *);
enum AchievementType type = (enum AchievementType) va_arg( ap, int );
if( sd == NULL || ad == NULL || type <= A_INVALID || type >= A_MAX || type != ad->type )
return 0;
switch( type )
{
case A_MOB:
{
struct mob_data *md = va_arg( ap, struct mob_data *);
struct achievement_mob *ma = ( struct achievement_mob *) ad->achievement;
int index = achievement_searchTrackerIndex( sd, ad->achievement_id );
if( index < 0 )
return 0;
if( sd->at[index].finished == true )
return 1;
switch( ma->type ) ///<<<<<<<<<<<<<<<<<<<<<<<<<<<<Here crashes
{
case AM_ID:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( md->class_ == ma->value[i] && sd->at[index].amount[i] < ma->amount[i] )
{
sd->at[index].amount[i]++;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AM_SIZE:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( md->db->status.size == ma->value[i] && sd->at[index].amount[i] < ma->amount[i] )
{
sd->at[index].amount[i]++;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AM_RACE:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( md->db->status.race == ma->value[i] && sd->at[index].amount[i] < ma->amount[i] )
{
sd->at[index].amount[i]++;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AM_ELEMENT:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( md->db->status.def_ele == ma->value[i] && sd->at[index].amount[i] < ma->amount[i] )
{
sd->at[index].amount[i]++;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AM_MVP:
if( md->db->mexp > 0 && sd->at[index].amount[0] < ma->amount[0] )
{
sd->at[index].amount[0]++;
achievement_check4Finished( sd, ad );
}
break;
default:
return 0;
} // switch(ma->type)
} // A_MOB
break;
case A_ITEMFIND:
{
struct item_data *it = va_arg( ap, struct item_data *);
int amount = va_arg( ap, int );
struct achievement_item *ai = ( struct achievement_item *) ad->achievement;
int index = achievement_searchTrackerIndex( sd, ad->achievement_id );
if( index < 0 || it == NULL )
return 0;
if( sd->at[index].finished == true )
return 1;
switch( ai->type )
{
case AI_ID:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( it->nameid == ai->value[i] && sd->at[index].amount[i] < ai->amount[i] )
{
sd->at[index].amount[i] += amount;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AI_EQUIP:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( it->equip & ai->value[i] && sd->at[index].amount[i] < ai->amount[i] )
{
sd->at[index].amount[i] += amount;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AI_TYPE:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( it->type == ai->value[i] && sd->at[index].amount[i] < ai->amount[i] )
{
sd->at[index].amount[i] += amount;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
default:
return 0;
} // switch(ai->type)
} // A_ITEMFIND
break;
case A_ITEMUSE:
{
struct item_data *it = va_arg( ap, struct item_data *);
struct achievement_itemuse *ai = ( struct achievement_itemuse *) ad->achievement;
int index = achievement_searchTrackerIndex( sd, ad->achievement_id );
if( index < 0 || it == NULL )
return 0;
if( sd->at[index].finished == true )
return 1;
switch( ai->type )
{
case AI_ID:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( it->nameid == ai->value[i] && sd->at[index].amount[i] < ai->amount[i] )
{
sd->at[index].amount[i]++;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AI_EQUIP:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( it->equip & ai->value[i] && sd->at[index].amount[i] < ai->amount[i] )
{
sd->at[index].amount[i]++;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
case AI_TYPE:
{
int i;
bool changed = false;
for( i = 0; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( it->type == ai->value[i] && sd->at[index].amount[i] < ai->amount[i] )
{
sd->at[index].amount[i]++;
changed = true;
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
}
break;
default:
return 0;
} // switch(ai->type)
break;
} // A_ITEMUSE
case A_EXPLORE:
{
int mapid = va_arg( ap, int );
struct achievement_explore *ae = ( struct achievement_explore *) ad->achievement;
int index = achievement_searchTrackerIndex( sd, ad->achievement_id );
int i;
bool changed;
if( index < 0 )
return 0;
if( sd->at[index].finished == true )
return 1;
for( i = 0, changed = false; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( mapid == ae->mapid[i] && sd->at[index].amount[i] < 1 )
{
sd->at[index].amount[i] = 1;
changed = true;
break; // since nobody would enter the same map twice
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
} // A_EXPLORE
break;
case A_QUEST:
{
int quest_id = va_arg( ap, int );
struct achievement_quest *aq = ( struct achievement_quest *) ad->achievement;
int index = achievement_searchTrackerIndex( sd, ad->achievement_id );
int i;
bool changed;
if( index < 0 )
return 0;
if( sd->at[index].finished == true )
return 1;
for( i = 0, changed = false; i < MAX_ACHIEVEMENT_OBJECTIVE; i++ )
{
if( quest_id == aq->questid[i] && sd->at[index].amount[i] < 1 )
{
sd->at[index].amount[i] = 1;
changed = true;
break; // since nobody would enter the same quest twice
}
}
if( changed == true )
{
achievement_check4Finished( sd, ad );
}
} // A_QUSET
break;
default:
return 0;
} // switch( ad->type )
return 1;
}
[/CODE]

I know that this is not support forum. I only leaves this here because maybe there is something that you can do with this to fix it.

Thank you.

Vali~

Hercules Elf Bot - Mar 18, 2012 11:48

Originally posted by [b]Gepard[/b]
That custom addon uses DBMap, and need to be updated to work correctly in [rev=15682]+. This is however wrong place to ask for support for source modifications. Please use appropriate section in forums.