[SOLVED] Self compiled server isn't working

Discussion about topics that don't fit elsewhere.
Post Reply
Faraday
Posts: 12
Joined: Wed Mar 29, 2017 8:49 am

[SOLVED] Self compiled server isn't working

Post by Faraday »

I cross-compiled tomenet.server.exe from WSL [Ubuntu 18.04].
When i start .exe it is just freezes with no output.

Client compiled from the same source is working with no issues.
Source is https://github.com/TomenetGame/tomenet

I use i686-w64-mingw32.
I had to change some lines in makefile.mingw to compile - removed "wine" command for tolua.exe. You can see changes in my fork: https://github.com/TomenetGame/tomenet/ ... ForWindows

There are also some warning in make output:

Code: Select all

L -D_GNU_SOURCE=1 -Dmain=SDL_main  -Iserver -Iserver/lua -o server/control.o -c server/control.c
server/control.c:17:0: warning: "EWOULDBLOCK" redefined
 #define EWOULDBLOCK WSAEWOULDBLOCK

In file included from server/../common/h-system.h:22:0,
                 from server/../common/h-basic.h:16,
                 from server/angband.h:22,
                 from server/control.c:12:
/usr/share/mingw-w64/include/errno.h:166:0: note: this is the location of the previous definition
 #define EWOULDBLOCK 140

Code: Select all

L -D_GNU_SOURCE=1 -Dmain=SDL_main  -Iserver -Iserver/lua -o server/spells2.o -c server/spells2.c
server/spells2.c: In function ‘detect_treasure’:
server/spells2.c:1947:31: warning: ‘c_ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  __GRID_DEBUG(Ind, wpos, c_ptr->feat, "detect_treasure()", 0);
                               ^~
server/spells2.c: In function ‘floor_detect_treasure’:
server/spells2.c:2022:31: warning: ‘c_ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  __GRID_DEBUG(Ind, wpos, c_ptr->feat, "floor_detect_treasure()", 0);
                               ^~
server/spells2.c: In function ‘detect_treasure_object’:
server/spells2.c:3116:31: warning: ‘c_ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  __GRID_DEBUG(Ind, wpos, c_ptr->feat, "detect_treasure_object()", 0);

Code: Select all

L -D_GNU_SOURCE=1 -Dmain=SDL_main  -Iserver -Iserver/lua -o server/files.o -c server/files.c
server/files.c: In function ‘top_twenty’:
server/files.c:2059:29: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  sprintf(the_score.p_r, "%2d", p_ptr->prace);
                             ^
server/files.c:2059:2: note: ‘sprintf’ output between 3 and 4 bytes into a destination of size 3
  sprintf(the_score.p_r, "%2d", p_ptr->prace);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2060:29: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  sprintf(the_score.p_c, "%2d", p_ptr->pclass);
                             ^
server/files.c:2060:2: note: ‘sprintf’ output between 3 and 4 bytes into a destination of size 3
  sprintf(the_score.p_c, "%2d", p_ptr->pclass);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2063:30: warning: ‘%3d’ directive writing between 3 and 6 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(the_score.cur_lev, "%3d", p_ptr->lev);
                              ^~~
server/files.c:2063:29: note: directive argument in the range [-32768, 32767]
  sprintf(the_score.cur_lev, "%3d", p_ptr->lev);
                             ^~~~~
server/files.c:2063:2: note: ‘sprintf’ output between 4 and 7 bytes into a destination of size 4
  sprintf(the_score.cur_lev, "%3d", p_ptr->lev);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2064:30: warning: ‘%3d’ directive writing between 3 and 6 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(the_score.cur_dun, "%3d", p_ptr->died_from_depth);
                              ^~~
server/files.c:2064:29: note: directive argument in the range [-32768, 32767]
  sprintf(the_score.cur_dun, "%3d", p_ptr->died_from_depth);
                             ^~~~~
server/files.c:2064:2: note: ‘sprintf’ output between 4 and 7 bytes into a destination of size 4
  sprintf(the_score.cur_dun, "%3d", p_ptr->died_from_depth);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2065:30: warning: ‘%3d’ directive writing between 3 and 6 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(the_score.max_lev, "%3d", p_ptr->max_plv);
                              ^~~
server/files.c:2065:29: note: directive argument in the range [-32768, 32767]
  sprintf(the_score.max_lev, "%3d", p_ptr->max_plv);
                             ^~~~~
server/files.c:2065:2: note: ‘sprintf’ output between 4 and 7 bytes into a destination of size 4
  sprintf(the_score.max_lev, "%3d", p_ptr->max_plv);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2066:30: warning: ‘%3d’ directive writing between 3 and 6 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(the_score.max_dun, "%3d", p_ptr->max_dlv);
                              ^~~
server/files.c:2066:29: note: directive argument in the range [-32768, 32767]
  sprintf(the_score.max_dun, "%3d", p_ptr->max_dlv);
                             ^~~~~
server/files.c:2066:2: note: ‘sprintf’ output between 4 and 7 bytes into a destination of size 4
  sprintf(the_score.max_dun, "%3d", p_ptr->max_dlv);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c: In function ‘display_scores’:
server/files.c:2146:29: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  sprintf(the_score.p_r, "%2d", p_ptr->prace);
                             ^
server/files.c:2146:2: note: ‘sprintf’ output between 3 and 4 bytes into a destination of size 3
  sprintf(the_score.p_r, "%2d", p_ptr->prace);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2147:29: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  sprintf(the_score.p_c, "%2d", p_ptr->pclass);
                             ^
server/files.c:2147:2: note: ‘sprintf’ output between 3 and 4 bytes into a destination of size 3
  sprintf(the_score.p_c, "%2d", p_ptr->pclass);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2150:30: warning: ‘%3d’ directive writing between 3 and 6 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(the_score.cur_lev, "%3d", p_ptr->lev);
                              ^~~
server/files.c:2150:29: note: directive argument in the range [-32768, 32767]
  sprintf(the_score.cur_lev, "%3d", p_ptr->lev);
                             ^~~~~
server/files.c:2150:2: note: ‘sprintf’ output between 4 and 7 bytes into a destination of size 4
  sprintf(the_score.cur_lev, "%3d", p_ptr->lev);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2152:30: warning: ‘%3d’ directive writing between 3 and 6 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(the_score.max_lev, "%3d", p_ptr->max_plv);
                              ^~~
server/files.c:2152:29: note: directive argument in the range [-32768, 32767]
  sprintf(the_score.max_lev, "%3d", p_ptr->max_plv);
                             ^~~~~
server/files.c:2152:2: note: ‘sprintf’ output between 4 and 7 bytes into a destination of size 4
  sprintf(the_score.max_lev, "%3d", p_ptr->max_plv);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
server/files.c:2153:30: warning: ‘%3d’ directive writing between 3 and 6 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(the_score.max_dun, "%3d", p_ptr->max_dlv);
                              ^~~
server/files.c:2153:29: note: directive argument in the range [-32768, 32767]
  sprintf(the_score.max_dun, "%3d", p_ptr->max_dlv);
                             ^~~~~
server/files.c:2153:2: note: ‘sprintf’ output between 4 and 7 bytes into a destination of size 4
  sprintf(the_score.max_dun, "%3d", p_ptr->max_dlv);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Code: Select all

L -D_GNU_SOURCE=1 -Dmain=SDL_main  -Iserver -Iserver/lua -o server/cmd4.o -c server/cmd4.c
server/cmd4.c: In function ‘do_cmd_check_artifacts’:
server/cmd4.c:268:29: warning: ‘ ’ directive writing 1 byte into a region of size between 0 and 11 [-Wformat-overflow=]
     sprintf(fmt, "%%%ds%s%2d %s%%s\n", (int)(43 - strlen(base_name)), cslv, lev, cs);
                             ^
server/cmd4.c:268:5: note: ‘sprintf’ output 10 or more bytes (assuming 21) into a destination of size 16
     sprintf(fmt, "%%%ds%s%2d %s%%s\n", (int)(43 - strlen(base_name)), cslv, lev, cs);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Code: Select all

L -D_GNU_SOURCE=1 -Dmain=SDL_main  -Iserver -Iserver/lua -o server/nserver.o -c server/nserver.c
In file included from server/nserver.c:83:0:
server/netserver.h:6:0: warning: "EWOULDBLOCK" redefined
 # define EWOULDBLOCK WSAEWOULDBLOCK

In file included from server/../common/h-system.h:22:0,
                 from server/../common/h-basic.h:16,
                 from server/angband.h:22,
                 from server/nserver.c:82:
/usr/share/mingw-w64/include/errno.h:166:0: note: this is the location of the previous definition
 #define EWOULDBLOCK 140

Code: Select all

L -D_GNU_SOURCE=1 -Dmain=SDL_main  -Iserver -Iserver/lua -o server/lua/liolib.o -c server/lua/liolib.c
server/lua/liolib.c:47:0: warning: "popen" redefined
 #define popen(x,y) NULL  /* that is, popen always fails */

In file included from server/lua/liolib.c:9:0:
/usr/share/mingw-w64/include/stdio.h:511:0: note: this is the location of the previous definition
 #define popen _popen
Does anyone know what can cause this problem and how i can solve/debug it?
Last edited by Faraday on Sun Nov 15, 2020 7:58 pm, edited 1 time in total.
mikaelh
Developer
Posts: 216
Joined: Sun Dec 13, 2009 3:18 pm

Re: Self compiled server isn't working

Post by mikaelh »

You should probably compile the server without SDL. SDL is only needed to build the client with sound support and it seems to break the server somehow.
Faraday
Posts: 12
Joined: Wed Mar 29, 2017 8:49 am

Re: Self compiled server isn't working

Post by Faraday »

Thanks. that worked!
Post Reply