The International Simutrans Forum

 

Author Topic: Segmentation fault in money_to_string function  (Read 206 times)

0 Members and 1 Guest are viewing this topic.

Offline Roboron

  • Devotee
  • *
  • Posts: 440
    • Las Galácticas Aventuras de Komoyo Diga
  • Languages: ES, EN
Segmentation fault in money_to_string function
« on: January 03, 2022, 08:22:11 PM »
Trying to build and run Simutrans 123 on Ubuntu 20.04 LTS VM, I'm getting segfault when running the game (just at the end of the loading screen). Running debug build in GDB gave me this:

Code: [Select]
Thread 1 "simutrans" received signal SIGSEGV, Segmentation fault.
0x0000555555a283e9 in money_to_string (
    p=0x7ffffffff001 <error: No se puede acceder a la memoria en la dirección 0x7ffffffff001>,
    f=200000, show_decimal=true) at /home/rober/Documentos/trunk/utils/simstring.cc:109
109        *p++ = tp[i++];

("No se puede acceder a la memoria en la dirección #" =  cannot access memory address #)

=> https://github.com/aburch/simutrans/blob/master/utils/simstring.cc#L109

A check is missing somewhere?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 11060
  • Languages: De,EN,JP
Re: Segmentation fault in money_to_string function
« Reply #1 on: January 04, 2022, 10:12:16 AM »
This is shows at the bottom of the screen, in the player dialog and the finance window. However, I suspect a broken or missing translation file is the most likely cause. Otherwise the nubmer would have to be extremely large (larger than 10^100)

Offline Roboron

  • Devotee
  • *
  • Posts: 440
    • Las Galácticas Aventuras de Komoyo Diga
  • Languages: ES, EN
Re: Segmentation fault in money_to_string function
« Reply #2 on: January 04, 2022, 03:01:54 PM »
It's a clean install, I have not modified any file. On my main machine I can't reproduce this, not even if I delete my simutrans folder and start fresh. May it be something related to the virtual machine?