ExistentialAudio / SwiftOSC

SwiftOSC is an Open Sound Control client and server framework written in Swift.
MIT License
270 stars 51 forks source link

Crash in Timetag.swift #55

Open Burtan opened 3 years ago

Burtan commented 3 years ago

Hi, I'm experiencing one more crash when sending a bank change to REAPER and receiving bulk data as an answer to that.

Here is the stack trace:

Timetag.swift Line 35

Exception = Swift runtime failure: arithmetic overflow
self = {Swift.UInt64} 16777216

OSCServer.swift Line 184

Exception = Swift runtime failure: arithmetic overflow
element = {SwiftOSC.OSCBundle | 0x600001aa87a0} OSCBundle [Timetag<16777216> Elements<30>]
self = {SwiftOSC.OSCServer | 0x6000039b3020} <OSCServer: 0x6000039b3020>
bundle = {SwiftOSC.OSCBundle | 0x600001aa87a0} OSCBundle [Timetag<16777216> Elements<30>]
 timetag = {SwiftOSC.Timetag} 16777216
 elements = {Swift.Array<SwiftOSC.OSCElement>} 30 values
  [0] = {SwiftOSC.OSCMessage | 0x600003914140} OSCMessage [Address</track/1/name> String<Track 17>]
  [1] = {SwiftOSC.OSCMessage | 0x600003914280} OSCMessage [Address</track/1/number/str> String<17>]
  [2] = {SwiftOSC.OSCMessage | 0x600003914230} OSCMessage [Address</track/2/name> String<Track 18>]
  [3] = {SwiftOSC.OSCMessage | 0x6000039143c0} OSCMessage [Address</track/2/number/str> String<18>]
  [4] = {SwiftOSC.OSCMessage | 0x600003914460} OSCMessage [Address</track/3/name> String<Track 19>]
  [5] = {SwiftOSC.OSCMessage | 0x600003914550} OSCMessage [Address</track/3/number/str> String<19>]
  [6] = {SwiftOSC.OSCMessage | 0x6000039145f0} OSCMessage [Address</track/4/name> String<Track 20>]
  [7] = {SwiftOSC.OSCMessage | 0x6000039146e0} OSCMessage [Address</track/4/number/str> String<20>]
  [8] = {SwiftOSC.OSCMessage | 0x600003914780} OSCMessage [Address</track/5/name> String<Track 21>]
  [9] = {SwiftOSC.OSCMessage | 0x600003914870} OSCMessage [Address</track/5/number/str> String<21>]
  [10] = {SwiftOSC.OSCMessage | 0x600003914910} OSCMessage [Address</track/5/volume/db> Float<-150.0>]
  [11] = {SwiftOSC.OSCMessage | 0x6000039149b0} OSCMessage [Address</track/5/volume/str> String<-inf dB>]
  [12] = {SwiftOSC.OSCMessage | 0x600003914a50} OSCMessage [Address</track/5/volume> Float<0.002513873>]
  [13] = {SwiftOSC.OSCMessage | 0x600003914b40} OSCMessage [Address</track/5/monitor> Float<0.0>]
  [14] = {SwiftOSC.OSCMessage | 0x600003914c30} OSCMessage [Address</track/6/name> String<Track 22>]
  [15] = {SwiftOSC.OSCMessage | 0x600003914d20} OSCMessage [Address</track/6/number/str> String<22>]
  [16] = {SwiftOSC.OSCMessage | 0x600003914dc0} OSCMessage [Address</track/6/volume/db> Float<-150.0>]
  [17] = {SwiftOSC.OSCMessage | 0x600003914e60} OSCMessage [Address</track/6/volume/str> String<-inf dB>]
  [18] = {SwiftOSC.OSCMessage | 0x600003914f00} OSCMessage [Address</track/6/volume> Float<0.002513873>]
  [19] = {SwiftOSC.OSCMessage | 0x600003914ff0} OSCMessage [Address</track/6/monitor> Float<0.0>]
  [20] = {SwiftOSC.OSCMessage | 0x6000039150e0} OSCMessage [Address</track/7/name> String<Track 23>]
  [21] = {SwiftOSC.OSCMessage | 0x6000039151d0} OSCMessage [Address</track/7/number/str> String<23>]
  [22] = {SwiftOSC.OSCMessage | 0x600003915270} OSCMessage [Address</track/7/volume/db> Float<-150.0>]
  [23] = {SwiftOSC.OSCMessage | 0x600003915310} OSCMessage [Address</track/7/volume/str> String<-inf dB>]
  [24] = {SwiftOSC.OSCMessage | 0x6000039153b0} OSCMessage [Address</track/7/volume> Float<0.002513873>]
  [25] = {SwiftOSC.OSCMessage | 0x6000039154a0} OSCMessage [Address</track/7/monitor> Float<0.0>]
  [26] = {SwiftOSC.OSCMessage | 0x600003915590} OSCMessage [Address</track/8/name> String<Track 24>]
  [27] = {SwiftOSC.OSCMessage | 0x6000039156d0} OSCMessage [Address</track/8/number/str> String<24>]
  [28] = {SwiftOSC.OSCMessage | 0x600003915680} OSCMessage [Address</track/8/volume/db> Float<-150.0>]
  [29] = {SwiftOSC.OSCMessage | 0x600003914050} OSCMessage [Address</track/8/volume/str> String<-inf dB>]
devinroth commented 3 years ago

The quick fix for this is to comment out line 35 and replace it with return 0.0.

On Jan 17, 2021, 11:36 AM -0800, Frederik Bertling notifications@github.com, wrote:

Hi, I'm experiencing one more crash when sending a bank change to REAPER and receiving bulk data as an answer to that. Here is the stack trace: Timetag.swift Line 35 Exception = Swift runtime failure: arithmetic overflow self = {Swift.UInt64} 16777216 OSCServer.swift Line 184 Exception = Swift runtime failure: arithmetic overflow element = {SwiftOSC.OSCBundle | 0x600001aa87a0} OSCBundle [Timetag<16777216> Elements<30>] self = {SwiftOSC.OSCServer | 0x6000039b3020} <OSCServer: 0x6000039b3020> bundle = {SwiftOSC.OSCBundle | 0x600001aa87a0} OSCBundle [Timetag<16777216> Elements<30>] timetag = {SwiftOSC.Timetag} 16777216 elements = {Swift.Array} 30 values [0] = {SwiftOSC.OSCMessage | 0x600003914140} OSCMessage [Address</track/1/name> String<Track 17>] [1] = {SwiftOSC.OSCMessage | 0x600003914280} OSCMessage [Address</track/1/number/str> String<17>] [2] = {SwiftOSC.OSCMessage | 0x600003914230} OSCMessage [Address</track/2/name> String<Track 18>] [3] = {SwiftOSC.OSCMessage | 0x6000039143c0} OSCMessage [Address</track/2/number/str> String<18>] [4] = {SwiftOSC.OSCMessage | 0x600003914460} OSCMessage [Address</track/3/name> String<Track 19>] [5] = {SwiftOSC.OSCMessage | 0x600003914550} OSCMessage [Address</track/3/number/str> String<19>] [6] = {SwiftOSC.OSCMessage | 0x6000039145f0} OSCMessage [Address</track/4/name> String<Track 20>] [7] = {SwiftOSC.OSCMessage | 0x6000039146e0} OSCMessage [Address</track/4/number/str> String<20>] [8] = {SwiftOSC.OSCMessage | 0x600003914780} OSCMessage [Address</track/5/name> String<Track 21>] [9] = {SwiftOSC.OSCMessage | 0x600003914870} OSCMessage [Address</track/5/number/str> String<21>] [10] = {SwiftOSC.OSCMessage | 0x600003914910} OSCMessage [Address</track/5/volume/db> Float<-150.0>] [11] = {SwiftOSC.OSCMessage | 0x6000039149b0} OSCMessage [Address</track/5/volume/str> String<-inf dB>] [12] = {SwiftOSC.OSCMessage | 0x600003914a50} OSCMessage [Address</track/5/volume> Float<0.002513873>] [13] = {SwiftOSC.OSCMessage | 0x600003914b40} OSCMessage [Address</track/5/monitor> Float<0.0>] [14] = {SwiftOSC.OSCMessage | 0x600003914c30} OSCMessage [Address</track/6/name> String<Track 22>] [15] = {SwiftOSC.OSCMessage | 0x600003914d20} OSCMessage [Address</track/6/number/str> String<22>] [16] = {SwiftOSC.OSCMessage | 0x600003914dc0} OSCMessage [Address</track/6/volume/db> Float<-150.0>] [17] = {SwiftOSC.OSCMessage | 0x600003914e60} OSCMessage [Address</track/6/volume/str> String<-inf dB>] [18] = {SwiftOSC.OSCMessage | 0x600003914f00} OSCMessage [Address</track/6/volume> Float<0.002513873>] [19] = {SwiftOSC.OSCMessage | 0x600003914ff0} OSCMessage [Address</track/6/monitor> Float<0.0>] [20] = {SwiftOSC.OSCMessage | 0x6000039150e0} OSCMessage [Address</track/7/name> String<Track 23>] [21] = {SwiftOSC.OSCMessage | 0x6000039151d0} OSCMessage [Address</track/7/number/str> String<23>] [22] = {SwiftOSC.OSCMessage | 0x600003915270} OSCMessage [Address</track/7/volume/db> Float<-150.0>] [23] = {SwiftOSC.OSCMessage | 0x600003915310} OSCMessage [Address</track/7/volume/str> String<-inf dB>] [24] = {SwiftOSC.OSCMessage | 0x6000039153b0} OSCMessage [Address</track/7/volume> Float<0.002513873>] [25] = {SwiftOSC.OSCMessage | 0x6000039154a0} OSCMessage [Address</track/7/monitor> Float<0.0>] [26] = {SwiftOSC.OSCMessage | 0x600003915590} OSCMessage [Address</track/8/name> String<Track 24>] [27] = {SwiftOSC.OSCMessage | 0x6000039156d0} OSCMessage [Address</track/8/number/str> String<24>] [28] = {SwiftOSC.OSCMessage | 0x600003915680} OSCMessage [Address</track/8/volume/db> Float<-150.0>] [29] = {SwiftOSC.OSCMessage | 0x600003914050} OSCMessage [Address</track/8/volume/str> String<-inf dB>] — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.