.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > HPB_bot
HPB_bot The trusty good ole mechs by botman HLDMTFCOpposing ForceDMCFront Line Force

Reply
 
Thread Tools
Interesting Stripper2 problem, maybe someone can help?
Old
  (#1)
pl4tinum
Member
 
Status: Offline
Posts: 15
Join Date: Mar 2004
Default Interesting Stripper2 problem, maybe someone can help? - 26-09-2004

Hello,

I noticed something wierd today with Stripper2.

I am using the Linux version of Stripper2 (stripper2_mm_i386.so) on my linux gameserver. All of the _str.cfg files work perfectly with my maps on my server except those that are over 10kb in size. Each time one of the maps with a _str.cfg file over 10000 bytes loads up, the server crashes and restarts. If the file size is under 10000 bytes, it seems to be fine. I haven't tested with a file of size 9999 bytes but I'm assuming somewhere around 10000 is the breaking point. I know a map with _str.cfg file of 9465 bytes works just fine but the 4 maps I have with _str.cfg above that size level (between 10532 bytes and 15442 bytes) crash the server instantly.

If anyone has any idea as to what could be causing this... please let me know! I've been trying to figure it out and the servers logs leave me no information whatsoever on what could be the problem. I checked the sprite names and entity names in the _str.cfg files in question but they are all legit and should be fine.

Thanks again!

pl4tinum - Chris
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#2)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: Interesting Stripper2 problem, maybe someone can help? - 26-09-2004

it's probably because stripper 2 has a buffer size of that and if it goes over you'll be editing memory space not allocated for stripper 2 and windows will throw an exception or it will overwrite something critical for half-life to run normally and crash.
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#3)
pl4tinum
Member
 
Status: Offline
Posts: 15
Join Date: Mar 2004
Default Re: Interesting Stripper2 problem, maybe someone can help? - 26-09-2004

Well the first part of what you said sounds good, how do I bump that buffer size up a notch? And it's Linux that I'm using... so I don't think Windows will crash hehe.
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Interesting Stripper2 problem, maybe someone can help? - 27-09-2004

There must be a big buffer declared somewhere like this

char buffer[10000];

better do something like this

char *buffer;

buffer = (char *) malloc (min_size); // initialization

buffer = (char *) malloc (buffer, new_size); // reallocate each time you need the buffer to grow

free (buffer); // free the buffer when you don't need it anymore



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#5)
pl4tinum
Member
 
Status: Offline
Posts: 15
Join Date: Mar 2004
Default Re: Interesting Stripper2 problem, maybe someone can help? - 27-09-2004

Interesting that the Linux version would have this limitation but not the Windows version. Could it be something related to the /tmp folder on my Linux drive? Maybe the server doesn't have access to create temporary files? I am not a programmer so for me to change the source and recompile is a little out of my league... at least I think it is. If I have GCC, is it fairly straightforward?



Quote:
Originally Posted by Pierre-Marie Baty
There must be a big buffer declared somewhere like this

char buffer[10000];

better do something like this

char *buffer;

buffer = (char *) malloc (min_size); // initialization

buffer = (char *) malloc (buffer, new_size); // reallocate each time you need the buffer to grow

free (buffer); // free the buffer when you don't need it anymore
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#6)
pl4tinum
Member
 
Status: Offline
Posts: 15
Join Date: Mar 2004
Default Re: Interesting Stripper2 problem, maybe someone can help? - 27-09-2004

This seems to be the part of his code that actually reads in the Stripper _str.cfg files. The char input[1024] couldn't possibly be part of the problem could it?

bool scan_stripper_cfg(FILE *fp)
{
char input[1024];
char item_name[64];
int len, pos, index;
float percent;
while (!feof(fp))
{
if (fgets(input, 1023, fp) != NULL)
{
len = strlen(input);
if (input[len-1] == '\n')
input[len-1] = 0;
}
else
input[0] = 0;


What about this, do these seem fine?

#define MAX_STRIP_ITEMS 400
#define MAX_ADD_KEYVALUE 1000
#define MAX_ADD_ITEMS 400
#define MAX_ADD_GROUPS 100
#define MAX_PRECACHE_ITEMS 100

I honestly doubt there is anywhere close to 400 items in one of my maps. Maybe 150-200 but not 400. And I don't write [add] before every part so [add] groups should be only 1. Do you think maybe it's limiting to 100 items?
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Interesting Stripper2 problem, maybe someone can help? - 27-09-2004

The scan_stripper_cfg function looks fine. I don't think anything should be changed there but for the sake of cleanliness and readability.

But I smell great chances that if you double all these MAX_stuff values, the program won't crash anymore. You need gcc-2.95.3 to compile plugins on Linux (and you probably need the metamod SDK too...)



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#8)
pl4tinum
Member
 
Status: Offline
Posts: 15
Join Date: Mar 2004
Default Re: Interesting Stripper2 problem, maybe someone can help? - 27-09-2004

Thanks I will give it a shot. I appreciate the fast responses Pierre!!
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#9)
pl4tinum
Member
 
Status: Offline
Posts: 15
Join Date: Mar 2004
Default Re: Interesting Stripper2 problem, maybe someone can help? - 28-09-2004

I'm assuming I need the Metamod source code too, is there anything else I need? Darn metamod.org is down...
  
Reply With Quote
Re: Interesting Stripper2 problem, maybe someone can help?
Old
  (#10)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: Interesting Stripper2 problem, maybe someone can help? - 28-09-2004

http://sourceforge.net/projects/metamod
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com