The International Simutrans Forum

 

Author Topic: SIGSEV when opening industry info window  (Read 785 times)

0 Members and 1 Guest are viewing this topic.

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
SIGSEV when opening industry info window
« on: September 07, 2020, 11:17:38 AM »
Starting a new thread because I'm not sure where it belongs. No reproduction case at the moment. Occurs line 332 of gui_factor_storage_info.cc. Assertion was added to Ranran's patch by ceeac.
« Last Edit: September 17, 2020, 09:17:08 AM by freddyhayward »

Offline Ranran

  • Devotee
  • *
  • Posts: 1219
  • Languages: ja
Re: Assertion failure when opening industry info window
« Reply #1 on: September 08, 2020, 09:57:07 AM »
I'm not sure if it has something to do with the problem pointed out in this thread. But the compiler was warning about the order of initialization, but I found that applying the GUI overhaul would cause them to crash and not be able to display those dialogs. (´・ω・`)
Therefore I submit a patch that fixes it at this stage. Please check pull request #277.

As far as I confirmed, I think that there is no change in operation with the current version. I don't know about Assertion failure.
However this change seems to be necessary for the GUI overhaul patch.

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #2 on: September 17, 2020, 09:17:18 AM »
Update: this is not an assertion failure but a segfault that occurs because of transport_goods being NULL in Ranran's industry UI patch. Ranran, can you please look into this?

Offline Ranran

  • Devotee
  • *
  • Posts: 1219
  • Languages: ja

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #4 on: September 17, 2020, 10:38:27 AM »

Offline Ranran

  • Devotee
  • *
  • Posts: 1219
  • Languages: ja
Re: SIGSEV when opening industry info window
« Reply #5 on: September 17, 2020, 11:39:40 AM »
Can you provide a save game that can reproduce it?

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #6 on: September 17, 2020, 11:59:35 AM »
Can you provide a save game that can reproduce it?
Save the bridgewater-brunel server game, then cllick the builders yard at Pintstock.

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #7 on: September 18, 2020, 01:22:15 AM »
If it's any help, I tried the following 'fixes':
1. do not initialise transport_goods as NULL -> works but possible undefined behaviour
2. if transport_goods == NULL, then transport_goods = new goods_desc_t() -> works but possible memory leak
3. if transport_goods == NULL then continue -> prevents segfault but leads to blank (but clickable) entries

Offline Ranran

  • Devotee
  • *
  • Posts: 1219
  • Languages: ja
Re: SIGSEV when opening industry info window
« Reply #8 on: September 19, 2020, 10:07:50 AM »
The save data on the bridgewater server is too big to use.

I don't know how the situation was created. I don't think there can be an empty line unless they are connected but there are no goods to transport.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20274
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #9 on: September 19, 2020, 10:22:28 AM »
Freddy - can you push your no. 3 patch? This should be a temporary solution, I think, as this is much better than crashes occurring.

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #10 on: September 19, 2020, 11:21:58 AM »
I found a better solution that doesn't produce visual bugs or undefined behaviour, and submitted a pull request for it.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20274
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #11 on: September 19, 2020, 11:26:02 AM »
I found a better solution that doesn't produce visual bugs or undefined behaviour, and submitted a pull request for it.

Splendid, thank you for that: now incorporated.

Offline Phystam

  • Devotee
  • *
  • Posts: 495
  • Pak256.Ex developer
    • Pak256 wiki page
  • Languages: JP, EN, EO
Re: SIGSEV when opening industry info window
« Reply #12 on: September 20, 2020, 07:02:19 AM »
However, the debug message causes another segv.
Reproducable data:https://drive.google.com/file/d/1fR35CSimYnh6_ZuLO1WleaQKXuur20GI/view?usp=sharing

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #13 on: September 20, 2020, 08:40:01 AM »
However, the debug message causes another segv.
Reproducable data:https://drive.google.com/file/d/1fR35CSimYnh6_ZuLO1WleaQKXuur20GI/view?usp=sharing

This should be split to a new thread, but I have fixed it here: https://github.com/jamespetts/simutrans-extended/pull/280
James, it would be good to merge this and force-update bridgewater-brunel as soon as possible. Apologies for having caused this with my previous changes.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20274
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #14 on: September 20, 2020, 11:03:54 AM »
Thank you for that - I have applied your patch and restarted the server.

Online freddyhayward

  • Devotee
  • *
  • Posts: 437
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #15 on: September 21, 2020, 02:01:00 AM »
With the UI now working, the underlying issue has been revealed:

The builders yard previously consumed stone from the quarry and wrought iron from the ironworks. Upon being upgraded, it abandoned stone for cement and wrought iron for steel. However, its connections must not have been updated in the process, which now show that it is connected to industries from which it no longer accepts goods.

Offline Ranran

  • Devotee
  • *
  • Posts: 1219
  • Languages: ja
Re: SIGSEV when opening industry info window
« Reply #16 on: September 21, 2020, 04:15:43 AM »
Yes, I tried to explain that a situation that never happened is happening.
It was trying to show a strange situation where two industries were connected by NULL goods.
I don't know how the situation was created. I don't think there can be an empty line unless they are connected but there are no goods to transport.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20274
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: SIGSEV when opening industry info window
« Reply #17 on: October 02, 2020, 09:11:39 PM »
I am moving this to the solved bug reports section, since the crash has been solved. Any other bug should be reported in a separate thread, as it is confusing to have a discussion about a non-crash bug in a thread whose title refers to a crash bug.