Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSCServer crashes #52

Open
Burtan opened this issue Jan 3, 2021 · 5 comments
Open

OSCServer crashes #52

Burtan opened this issue Jan 3, 2021 · 5 comments

Comments

@Burtan
Copy link

Burtan commented Jan 3, 2021

Hi,
when there many messages at once, the OSCServer crashes at line 99.
I tested it with RME TotalMixFX. When enabling the OSC mode for TotalMixFX all data are send at once and the server crashes.

@devinroth
Copy link
Member

devinroth commented Jan 3, 2021 via email

@Burtan
Copy link
Author

Burtan commented Jan 4, 2021

This is the value of data at the crash point:

00100011 01100010 01110101 01101110 01100100 01101100 01100101 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000100 00101111 00110001 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00110001 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00110001 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00110010 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00110010 00000000 00101100 01100110 00000000 00000000 00111111 10000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00110011 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00110011 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00110100 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00110100 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00110101 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00110101 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00110110 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00110110 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00110111 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00110111 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01101100 01100001 01100010 01100101 01101100 01010011 00111000 00000000 00000000 00101100 01110011 00000000 00000000 01010011 01110101 01100010 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01110011 01101111 01101100 01101111 00101111 00110001 00101111 00111000 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 00101111 00110001 00101111 01100010 01110101 01110011 01001001 01101110 01110000 01110101 01110100 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00011000 00101111 00110001 00101111 01100010 01110101 01110011 01010000 01101100 01100001 01111001 01100010 01100001 01100011 01101011 00000000 00000000 00101100 01100110 00000000 00000000 00000000 00000000 00000000 00000000

@devinroth
Copy link
Member

Okay try this hack. Change

             if "#bundle\0".toData() == nextData.subdata(in: Range(0...7)){//matches string #bundle
                    if let newbundle = self.decodeBundle(nextData){
                        bundle?.add(newbundle)
                    } else {
                        bundle = nil
                    }
                } else {
                    
                    if let message = self.decodeMessage(nextData) {
                        bundle?.add(message)
                    } else {
                        bundle = nil
                    }
                }

to

                    if let message = self.decodeMessage(nextData) {
                        bundle?.add(message)
                    } else {
                        bundle = nil
                    }

it's not a proper fix since you can have a bundle in a bundle. But it should work for you in the time being. Hopefully. Let me know the result. I'm pretty sure the issue is because I'm not validating the data properly.

@Burtan
Copy link
Author

Burtan commented Jan 17, 2021

The change prevents the crash yes.

@soundflix
Copy link

Hi, I had a similar crash with TotalMix.
This fix helped.
It's not your code, I tested with osculator app, which says (not crashing):
"Receive error occurred (OSC UDP Server error: 9902 in #bundle: Invalid bundle received"
There's something fishy on RME's side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants