Hollow
Joined: 30th Sep 2010
Posts: 3451
Logic Error: basic_string::substr
I've been messing with eoserv r487 lately, surely I probably caused this myself some how but is anyone familiar with this error, or can anyone think of a possible cause? The server seems to disconnect me or other players when this error occurs but the server does not actually crash.
EDIT: I should also mention that just 1 player's client disconnects a time and that I have no clue when this problems triggers but I start experiencing it once multiple players are logged in.
8 years, 28 weeks ago
|
Cirras
Joined: 11th Mar 2011
Posts: 1221
Re: Logic Error: basic_string::substr
Lacking any other leads, I suggest doing a blanket search through the source for .substr. Place Console::Out messages before(label) and after each of them, then see what message is popping up with a label, but no *after.*
It's not a very elegant method, but if you don't know what's causing it then it seems like a simple way to isolate the problematic area. ---
Want to learn to pixel?
Pixelsource.org
8 years, 28 weeks ago
|
Re: Logic Error: basic_string::substr
What did you modify/add? I've had an out of range exception with it before but not in EOServ. It was because I tried to use substr but the values were out of range and it threw out that error. Maybe check if you did that? ---
stay tuned.
8 years, 28 weeks ago
|
Cirras
Joined: 11th Mar 2011
Posts: 1221
Re: Logic Error: basic_string::substr
andrewbob1 posted: (18th Sep 2015, 10:36 pm)
What did you modify/add? I've had an out of range exception with it before but not in EOServ. It was because I tried to use substr but the values were out of range and it threw out that error. Maybe check if you did that?
It would be entirely possible if he missed a -1 after a .size(), but I'd expect it to throw the out of range error like it did for you in that case. ---
Want to learn to pixel?
Pixelsource.org
8 years, 28 weeks ago
|
Re: Logic Error: basic_string::substr
Cirras posted: (18th Sep 2015, 11:56 pm)
andrewbob1 posted: (18th Sep 2015, 10:36 pm)
What did you modify/add? I've had an out of range exception with it before but not in EOServ. It was because I tried to use substr but the values were out of range and it threw out that error. Maybe check if you did that?
It would be entirely possible if he missed a -1 after a .size(), but I'd expect it to throw the out of range error like it did for you in that case.
It might be show up different because of the way eoserv handles displaying the exception? I'm not sure though. ---
stay tuned.
8 years, 28 weeks ago
|
Cirras
Joined: 11th Mar 2011
Posts: 1221
Re: Logic Error: basic_string::substr
andrewbob1 posted: (18th Sep 2015, 11:59 pm)
Cirras posted: (18th Sep 2015, 11:56 pm)
andrewbob1 posted: (18th Sep 2015, 10:36 pm)
What did you modify/add? I've had an out of range exception with it before but not in EOServ. It was because I tried to use substr but the values were out of range and it threw out that error. Maybe check if you did that?
It would be entirely possible if he missed a -1 after a .size(), but I'd expect it to throw the out of range error like it did for you in that case.
It might be show up different because of the way eoserv handles displaying the exception? I'm not sure though.
I *believe* I've seen an out-of-range error in EOSERV as well, but you might be right. ---
Want to learn to pixel?
Pixelsource.org
8 years, 28 weeks ago
|
Callum
Joined: 16th Oct 2011
Posts: 609
Re: Logic Error: basic_string::substr
The only time I've had an out of range error on EOSERV was when my character prompted a check for tiles off-map (Of course huh).
8 years, 28 weeks ago
|
Sausage
Administrator
Joined: 26th Jul 2008
Posts: 1346
Re: Logic Error: basic_string::substr
Use a debugger which will show you the point the exception is thrown. It will also show you the values of local variables, etc.
8 years, 28 weeks ago
|
Hollow
Joined: 30th Sep 2010
Posts: 3451
Re: Logic Error: basic_string::substr
Thanks, I hadn't really thought about that, I'll try debugging it. I will edit this post by the time I find it out more.
@andrewbob1 I already added a shitload of code before I attempted to run EOSERV so it's hard to tell what actually caused it, but i'll try debugging it as Sausage mentioned.
8 years, 28 weeks ago
|
Re: Logic Error: basic_string::substr
Cirras posted: (19th Sep 2015, 01:04 am)
andrewbob1 posted: (18th Sep 2015, 11:59 pm)
Cirras posted: (18th Sep 2015, 11:56 pm)
andrewbob1 posted: (18th Sep 2015, 10:36 pm)
What did you modify/add? I've had an out of range exception with it before but not in EOServ. It was because I tried to use substr but the values were out of range and it threw out that error. Maybe check if you did that?
It would be entirely possible if he missed a -1 after a .size(), but I'd expect it to throw the out of range error like it did for you in that case.
It might be show up different because of the way eoserv handles displaying the exception? I'm not sure though.
I *believe* I've seen an out-of-range error in EOSERV as well, but you might be right.
There is an out of range exception but it is related to maps and not substr I believe.
Hollow, if debugging doesn't work you could re-add everything one by one into a new rev to see which addition breaks the server. ---
stay tuned.
8 years, 28 weeks ago
|
Apollo
Administrator
Joined: 14th Apr 2009
Posts: 2759
Re: Logic Error: basic_string::substr
When I have seen this error it is usually due to a quest trigger breaking something. My guess is you have added a property to characters or a broken quest action that is throwing the character into an out of range scenario. Not sure exactly how you did this, but you may want to look into that.
Also, it is possible you have created a new character element that is somehow attempting to go out of range. Just guessing that since the server is not crashing those are probably the first places to look.
8 years, 28 weeks ago
|
Hollow
Joined: 30th Sep 2010
Posts: 3451
Re: Logic Error: basic_string::substr
Apollo posted: (19th Sep 2015, 06:10 pm)
When I have seen this error it is usually due to a quest trigger breaking something. My guess is you have added a property to characters or a broken quest action that is throwing the character into an out of range scenario. Not sure exactly how you did this, but you may want to look into that.
Also, it is possible you have created a new character element that is somehow attempting to go out of range. Just guessing that since the server is not crashing those are probably the first places to look.
Thank you that's very helpful. I have indeed added a couple of those to the server, I'm not suprised if that's the cause. I'll look into it, thanks!
8 years, 28 weeks ago
| | | | | | | | | | | | |