increasing the stack size may be an improper way of solving your problem.
Why are you using "static" in global scope (where it's nearly useless) but not in local scope where it's actually REALLY needed^^
Code:
new err[MSGL2] = "";
format(err,MSGL1,"SQL statement last char != ; SQL = %s",sql);
public send_sock(const callback,const data[]){
new error = 0
new constring[1024]
public receive_data(data[]){
new data2[1024];
format(data2,1023,data)
You can also replace "format" with "formatex" in most cases of your code