Ticket #46418

Server crashing on startup in Windows

Open Date: 2023-01-02 05:09 Last Update: 2023-01-02 19:47

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
7
Severity:
5 - Medium
Resolution:
Fixed
File:
9

Details

Server crashes on Windows.

init_nls() gets first called before fc_support_init() that initializes support mutexes, including that of fallback fc_vsnprintf() implementation used on Windows. Another Windows specialty in play is that init_nls() might call fc_vsnprintf() for LANG setup.

Ticket History (3/18 Histories)

2023-01-02 05:09 Updated by: cazfi
  • New Ticket "Server crashing on startup in Windows" created
2023-01-02 05:49 Updated by: cazfi
  • Priority Update from 5 - Medium to 7
Comment

Patch for master attached.

Will treat this issue as emergency build fix - no review period required before I may push fixes in. Given how long autotools based Windows builds take, I may even test only that fixes don't break linux, not that they really fix Windows, before pushing them in.

2023-01-02 06:13 Updated by: cazfi
Comment

S3_1 version attached

2023-01-02 06:30 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.6 (closed)
Comment

S3_0 and S2_6 versions.

2023-01-02 12:26 Updated by: cazfi
Comment

It seems that much bigger rearrangements are needed for fixing all the cases, and also the deinitialization part.

Attached new master version. Changes listed in commit message:

- fc_interface_init() renamed as libfreeciv_init()
- free_libfreeciv() renamed as libfreeciv_free()
- libfreeciv_init() takes a parameter telling if fc_interface check should be done, so programs without fc_interface can use it
- libfreciv_init() call added to modpack installer
- In other programs libfreeciv_init() call moved earlier, as needed
- init_nls() / free_nls() calls moved inside libfreeciv_init() / libfreeciv_free() to have them exactly right time

2023-01-02 13:22 Updated by: cazfi
Comment

Another version for master, with unnecessary include removed. Up-to-date patches for all the other branches too.

2023-01-02 13:36 Updated by: cazfi
Comment

I already know this still crashes on exit in Windows, but that's a minor issue compared to crash on start -> likely leave to a later ticket, and get forward with this.

2023-01-02 14:29 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed
2023-01-02 19:47 Updated by: cazfi
Comment

Reply To cazfi

I already know this still crashes on exit in Windows, but that's a minor issue compared to crash on start -> likely leave to a later ticket, and get forward with this.

-> #46426

Edit

Please login to add comment to this ticket » Login