The International Simutrans Forum

 

Author Topic: SIGSEGV when trying to start a headless server  (Read 674 times)

0 Members and 1 Guest are viewing this topic.

Offline garro

  • *
  • Posts: 9
SIGSEGV when trying to start a headless server
« on: March 26, 2019, 11:48:49 PM »
Hi all.
I am trying to run a headless server.
I compiled Simutrans from sources as explained in a previous post.
I created the map using a instance of simutrans compiled with sdl2 (because I was unable to create it directly form the headless server - got ERROR: modal_dialogue():  called without a display driver => nothing will be shown!) and then launch the server with the following command:
./sim -server -objects pak128 -debug 5 -load server.
It outputs the following:
Code: [Select]
Use work dir /home/garro/Desktop/simutrans-src-120-4-1/build/default/
Reading low level config data ...
Simutrans version 120.4.1 from Mar 26 2019
parse_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!
Server started, added 2 server sockets
Loading BDF font 'font/cyr.bdf'
Init done.
parse_colours() at config/simuconf.tab: Reading simuconf.tab successful!
Calculating textures ...done
Segmentation fault (core dumped)
EDIT: Running with -debug 5 I get
Code: [Select]
...
Message: pakset_info_t::debug: VHCskoda180 -> sha1 = 3F6B824260C57A7C015A59B310C52050F6207664
Message: simmain(): Reading menu configuration ...
Message: simmain(): loading savegame "server"
Message: simmain(): Midi disabled ...
Calculating textures ...done
Warning: karte_t::load: disconnecting all clients
Message: karte_t::load(): Prepare for loading
Warning: karte_t::load: Fileversion: 120007
Message: nwc_auth_player_t::init_player_lock_server: new = 32767
Message: nwc_auth_player_t::init_player_lock_server: new = 32767
Warning: karte_t::load(): loaded savegame from 0/1930, next month=524288, ticks=44040 (per month=1<<19)
Message: simmain(): Running world, pause=0, fast forward=0 ...
Message: network_command_t::rdwr: write packet_id=16, client_id=0
Message: network_command_t::rdwr: write packet_id=16, client_id=0
Message: network_command_t::rdwr: write packet_id=16, client_id=0
Message: network_command_t::rdwr: write packet_id=8, client_id=0
Warning: nwc_tool_t::rdwr: rdwr id=8 client=0 plnr=255 pos=koord3d invalid tool_id=8224 defpar=32768,Adesso sono connessi 0 giocatori. init=1 flags=0
Warning: karte_t::interactive: server lagging by 384
Message: network_command_t::rdwr: write packet_id=9, client_id=0
Warning: nwc_tool_t::clone: send sync_steps=1  tool_id=8224 init
Message: network_command_t::rdwr: write packet_id=8, client_id=0
Warning: nwc_tool_t::rdwr: rdwr id=8 client=0 plnr=255 pos=koord3d invalid tool_id=8224 defpar=32768,Adesso sono connessi 0 giocatori. init=1 flags=0
Message: network_command_t::rdwr: write packet_id=16, client_id=0
Message: network_command_t::rdwr: write packet_id=16, client_id=0
Segmentation fault (core dumped)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4587
  • Languages: EN, DE, AT
Re: SIGSEGV when trying to start a headless server
« Reply #1 on: March 30, 2019, 08:48:23 AM »
Does this happen reproducibly? Can you please upload the savegame to test it?

Offline garro

  • *
  • Posts: 9
Re: SIGSEGV when trying to start a headless server
« Reply #2 on: March 30, 2019, 11:39:59 AM »
Yes it is reproducible. I also tried with 2 paksets (pak128 and pak64).
STEPS TO REPRODUCE
1. Download the latest version of Simutrans (simutrans-src-120-4-1.zip) on Ubuntu 18.04
2. Extract two times
3. Compile one version with BACKEND=posix COLOUR_DEPTH=16 OSTYPE=linux
4. Compile the other with BACKEND=sdl2 COLOUR_DEPTH=16 OSTYPE=linux
5. Download a pakset and install it in both versions.
6. Use the version compiled with sdl2 to make a new map (FEATURE REQUEST: add the possibility to make a map directly from the headless server) and save it
7. Execute the server.
8. The server segfaults

The map seems too big to be uploaded even on the German forum. Anyway, it was a new map generated only to be played on the server.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2677
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: SIGSEGV when trying to start a headless server
« Reply #3 on: March 30, 2019, 12:30:37 PM »
Try posix and color depth 0

Offline ceeac

  • *
  • Posts: 45
Re: SIGSEGV when trying to start a headless server
« Reply #4 on: March 30, 2019, 12:51:15 PM »
Hm, tried to reproduce the crash but couldn't with the latest svn version (r8742) on Ubuntu 18.10.
@garro:
Could you try reproducing the crash with the latest version? You can download the sources for the latest svn version from the github mirror here -> https://github.com/aburch/simutrans/archive/master.zip or directly via svn.
Like Vladki suggested, does the crash still occur when compiling the server with COLOUR_DEPTH=0 ?
If yes, what are your map generation settings (size, number of industries etc.)?

Offline garro

  • *
  • Posts: 9
Re: SIGSEGV when trying to start a headless server
« Reply #5 on: March 30, 2019, 05:28:04 PM »
The crash does NOT occur with COLOR_DEPTH=0.
Thank you

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2677
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: SIGSEGV when trying to start a headless server
« Reply #6 on: March 30, 2019, 07:54:03 PM »
This should be put in some simutrans server howto ;)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9505
  • Languages: De,EN,JP
Re: SIGSEGV when trying to start a headless server
« Reply #7 on: March 31, 2019, 09:13:41 AM »
Or the built should abort if color depth != 0 when compiling posix like in r8743 ...

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4587
  • Languages: EN, DE, AT
Re: SIGSEGV when trying to start a headless server
« Reply #8 on: March 31, 2019, 09:34:32 AM »
The crash occurs only if '-server' is set.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9505
  • Languages: De,EN,JP
Re: SIGSEGV when trying to start a headless server
« Reply #9 on: April 05, 2019, 06:07:45 AM »
But compiling posix without using it as a server is somewhat pointless ...