Elvas Tower: X2673: Crashes in sound system - Elvas Tower

Jump to content

  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

X2673: Crashes in sound system Marias Pass 5, activity Auto train with set-out Rate Topic: -----

#1 User is offline   KiwiPeter 

  • Hostler
  • Group: Status: Active Member
  • Posts: 61
  • Joined: 21-May 14
  • Gender:Male
  • Simulator:Open Rails X
  • Country:

Posted 06 December 2014 - 03:07 AM

Seemingly random crashes:

Attached Image: Image 1.jpg

Attached File(s)



#2 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,012
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 06 December 2014 - 05:31 AM

I just got the same problem on the MEP route, during debugging, when switching view from one train to another through the Alt-9 command.

#3 User is offline   dennisat 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 474
  • Joined: 16-February 13
  • Gender:Male
  • Simulator:Open Rails & MSTS
  • Country:

Posted 06 December 2014 - 01:23 PM

I've had quite a number of these and my tracing has led to the conclusion that the new compare/exchange serialisation cannot protect a dictionary which is, in effect, a list of lists. I understand that compare/exchange can only protect contiguous items of data, not many separate items which is what a dictionary must usually be.

Dennis

Edit
Try reducing sleep time to 5ms - it will crash all the time.
Restore the lock processing - it will work fasultlessly.

#4 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,869
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 07 December 2014 - 01:21 AM

 dennisat, on 06 December 2014 - 01:23 PM, said:

new compare/exchange serialisation

Must have missed this. What is it, please?

#5 User is offline   dennisat 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 474
  • Joined: 16-February 13
  • Gender:Male
  • Simulator:Open Rails & MSTS
  • Country:

Posted 07 December 2014 - 01:50 AM

Interlocked compare / exchange is a method that can be used to make safe updates to data that can be updated by more than one thread. The problem with using it on the sound sources dictionary is that the dictionary only points to other lists. Compare / exchange protects the copy of the dictionary but does not, as far as I can tell, copy the lists that the dictionary is pointing to. You therefore end up with two dictionaries pointing to the same underlying data. Thus the conflict.

Dennis

#6 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,869
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 07 December 2014 - 03:57 AM

Very clear. Thanks, Dennis.

#7 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,012
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 10 December 2014 - 09:54 PM

 dennisat, on 06 December 2014 - 01:23 PM, said:

Restore the lock processing - it will work fasultlessly.

Dennis,
can you please post a patch for this? I just had again the crash, see attached file.
Attached File  OpenRailsLog.txt (12.62K)
Number of downloads: 162

#8 User is offline   dennisat 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 474
  • Joined: 16-February 13
  • Gender:Male
  • Simulator:Open Rails & MSTS
  • Country:

Posted 11 December 2014 - 12:56 AM

 Csantucci, on 10 December 2014 - 09:54 PM, said:

can you please post a patch for this? I just had again the crash, see attached file.


I have not totally dispensed with the Interlocked Compare Exchange because I understand the reasons for getting away from Lock processing. Locked code can cause bad bottlenecks. Since the Update process was spending the most time in the locked state I've therefore made it interruptible and restartable (sort of) using Compare Exchange. This allows the short Add and Remove Soundsource processes access immediately they need it. These processes are used in bursts when tiles are loaded/unloaded and AI trains are created/removed. If they are held up, they can be a contributory cause of the game stuttering. I've also made Sleeptime variable depending on the sound update response time in an effort to allow heavy bursts of activity through more quickly. To this end, I've also removed the "once every 4 cycle update except for NeedsFrequentUpdate" code. I'm afraid a lot of my debugging / monitoring code is in this patch; some of my stats calculation in cases of heavy interruption of the Update process leaves something to be desired but it was good enough for my purposes. I have some very sound dense activities and I was getting these crashes as soon as the new method of serialisation was introduced.

The Sound Debug Form also crashes randomly because of the same problem. Just leave the form up while running the game, it will crash sooner or later. I haven't looked at how to cure that yet. I hope this gives you some ideas about a more elegant and permanent solution. The patch is based on X2698


Dennis

Attached File  SoundProcess__ElvasTower.zip (2.26K)
Number of downloads: 185

#9 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,012
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 11 December 2014 - 02:11 AM

Thanks Dennis,
this is something that goes beyond my knowledge. I hope that someone else will tackle the problem.

#10 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,012
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 12 December 2014 - 11:54 PM

Bug report created.

  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users