You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
After customizing colors of multiple themes, theme changes stop being synced between instances (+assert fail in debug) #24724
@cbjeukendrup@Eism@igorkorsukov I am not sure who to ask so tagging you all. The problem here is that the themes setting ui/application/themes is more than 2048 bytes long (on my machine it is 3531 bytes holding 4 themes) and the IPC communication cannot handle messages of more than 2048 bytes (MAX_PACKAGE_SIZE) for which there is an assert in ipc::readFromSocket in ipc.cpp (can be found in the description of this issue).
My question is: how do we want to fix this:
Do we want to send all messages in chunks of no more than MAX_PACKAGE_SIZE bytes?
Do we simply want to increase the value of MAX_PACKAGE_SIZE for now? This would be a super simple fix but would make the problem return in case in the future a message ends up being longer. Also it is unknown whether it is safe to increase this value and how much - it must be there for a reason after all. I tried looking at the history and finding out what had necesitated limiting the incoming packages to 2048 bytes and all I was able to dig out was an "out-of-range error". I didn't find any issue associated with this change and the info was scarce. It is unlikely that @Eism or @DmitryArefiev will remember (it is not a recent change) but let's give it a try. Here is the commit with the change.
I believe the best solution right now is to simply increase the maximum package size.
And I think we should check the size of the data both when sending and when receiving.
add check to bool muse::ipc::writeToSocket(QLocalSocket* socket, const QByteArray& data)
I think at this stage this should be enough, because this system was not intended for transmitting large messages.
Also, work is currently underway, based on the results of which we will probably abandon this system (there will be one process for all windows, and not many instances)
If this system still remains and we need to send large messages, then we will have at least two options:
Make the transfer at the infrastructure level, i.e. at the IPC channel level, break the message into parts, and then build it from the parts... Make some kind of protocol for this.
At the client level, if the client knows that his special message may be too large, he can break it into parts and then build it (i.e. this will be an exceptional situation for special cases)
But, as I wrote above, this is not needed at the moment and may not be needed at all.
@Eism and @DmitryArefiev : do you guys remember what out-of-range error exactly was fixed with the above-mentioned commit where the max package size of 2048 bytes was introduced? How was the value 2048 chosen? I know it is been a while since that change was put in place. Anything you can remember will be appreciated.
The value was chosen experimentally: I logged the value, launched a couple of MuseScore instances, chose the maximum value (200), and multiplied it by 10. So perhaps the option of increasing the value is what we need.
Activity
krasko78 commentedon Jan 11, 2025
@cbjeukendrup @Eism @igorkorsukov I am not sure who to ask so tagging you all. The problem here is that the themes setting
ui/application/themesis more than 2048 bytes long (on my machine it is 3531 bytes holding 4 themes) and the IPC communication cannot handle messages of more than 2048 bytes (MAX_PACKAGE_SIZE) for which there is an assert inipc::readFromSocketinipc.cpp(can be found in the description of this issue).My question is: how do we want to fix this:
Do we want to send all messages in chunks of no more than MAX_PACKAGE_SIZE bytes?
Do we simply want to increase the value of MAX_PACKAGE_SIZE for now? This would be a super simple fix but would make the problem return in case in the future a message ends up being longer. Also it is unknown whether it is safe to increase this value and how much - it must be there for a reason after all. I tried looking at the history and finding out what had necesitated limiting the incoming packages to 2048 bytes and all I was able to dig out was an "out-of-range error". I didn't find any issue associated with this change and the info was scarce. It is unlikely that @Eism or @DmitryArefiev will remember (it is not a recent change) but let's give it a try. Here is the commit with the change.
Other ideas?
igorkorsukov commentedon Jan 13, 2025
@krasko78
I believe the best solution right now is to simply increase the maximum package size.
And I think we should check the size of the data both when sending and when receiving.
add check to
bool muse::ipc::writeToSocket(QLocalSocket* socket, const QByteArray& data)I think at this stage this should be enough, because this system was not intended for transmitting large messages.
Also, work is currently underway, based on the results of which we will probably abandon this system (there will be one process for all windows, and not many instances)
If this system still remains and we need to send large messages, then we will have at least two options:
Make the transfer at the infrastructure level, i.e. at the IPC channel level, break the message into parts, and then build it from the parts... Make some kind of protocol for this.
At the client level, if the client knows that his special message may be too large, he can break it into parts and then build it (i.e. this will be an exceptional situation for special cases)
But, as I wrote above, this is not needed at the moment and may not be needed at all.
krasko78 commentedon Jan 13, 2025
Thank you, @igorkorsukov.
@Eism and @DmitryArefiev : do you guys remember what out-of-range error exactly was fixed with the above-mentioned commit where the max package size of 2048 bytes was introduced? How was the value 2048 chosen? I know it is been a while since that change was put in place. Anything you can remember will be appreciated.
Eism commentedon Jan 14, 2025
@krasko78
This fix was made after receiving several crash reports from users. For example
The value was chosen experimentally: I logged the value, launched a couple of MuseScore instances, chose the maximum value (200), and multiplied it by 10. So perhaps the option of increasing the value is what we need.
krasko78 commentedon Jan 14, 2025
Thanks @Eism. I'll go ahead and bump the value up to 4096.