Jump to content
Eternal Lands Official Forums
Sign in to follow this  
squiz

Crash after re-connect

Recommended Posts

I have the harvesting effect enabled.

After a network disconnect while harvesting and then a re-connect, I sometimes notice that the harvesting effect keeps on going, although I am no longer harvesting.

When I then start harvesting, the harvesting effect stopped.

When I then stopped harvesting, the client crashed.

 

This, or something similar, has happened twice so far.

Share this post


Link to post
Share on other sites

Great :)

Please run el in gdb, the gnu debugger.

 

"gdb <el-binary>"

and then at the gdb prompt "run main" or "run test" for main or test server.

When el crashes, type "bt full" in the gdb console.

Thanks.

Edited by Florian

Share this post


Link to post
Share on other sites

I can reliably reproduce this on both Mac and XP.

1) start harvesting

2) cause a resync or disconnect+reconnect or otherwise find a way to lose your actor

3) cause one of the stop harvesting messages

crash in eye_candy_wrapper.cpp:580

cast_reference->effect->recall = true;

 

Here's what I believe is going on. You start harvesting, and harvesting_effect_reference gets set up with the pretties. When you resync, or reconnect after a disconnect, destroy_all_actors() is called, and I *think* ec_actor_delete() washes the ongoing harv effect away with all the other actor associated effects. Since this isn't the normal way for the harv effect to stop, harvesting_effect_reference doesn't get cleared. When we finally do get a stop harv message, ec_recall_effect(harvesting_effect_reference); is erroneously called. Since the effect is already gone, it crashes.

 

Possible fixes:

1) Bring harvesting_effect_reference into scope for actor_scripts.c and set it to NULL somewhere in destroy_all_actors(). This won't help us if we ever destroy just yourself, but I can't think of when that would happen off the top of my head. Since this crash is related to lag, it shouldn't happen that often anyway, so a perfect solution probably isn't necessary.

2) Make every effect check if it is the harv effect when it dies, and if so, clear harvesting_effect_reference. I think this is a waste of time, and it would probably make the client slow.

3) Have ec_actor_delete() do the check. probably still a waste of time.

4) Get rid of harvesting_effect_reference and have filter_or_ignore_text() look through all the eye candy stuff for og harv when we get a stop message. I can't wrap my mind around the ec stuff, but I'm willing to bet that would be needlessly complicated.

I'm sure there are more ways to handle this, but I like option 1 because it's only a two line fix. Fixing this will also take care of not seeing the effect after resuming harvesting.

 

There's another lag related crash that happens if we don't have our actors when we start harvesting. This one is a little harder to reproduce. At least the fix is easy. Check if get_actor_ptr_from_id(yourself) returns NULL before passing it to ec_create_ongoing_harvesting2().

Share this post


Link to post
Share on other sites
1) Bring harvesting_effect_reference into scope for actor_scripts.c and set it to NULL somewhere in destroy_all_actors(). This won't help us if we ever destroy just yourself, but I can't think of when that would happen off the top of my head. Since this crash is related to lag, it shouldn't happen that often anyway, so a perfect solution probably isn't necessary.

Thanks for the report, I implemented your idea, it's in CVS.

A brief reconnect check looks like this solves the problem, thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×