-
Notifications
You must be signed in to change notification settings - Fork 540
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
Qt widget mixin segfaults on unexpected messages. #973
Comments
No, at least it should report an error in this case but not producing a segfault. |
Yup died straight away, when I removed the handler for the message type.
|
Hi @alatdneg. Thanks for providing test code at your personal branch. The unexpected message log line you saw is common behavior in case of receiving something you don't have a message handler for, and is unrelated to the segfault. The issue you mentioned goes away once you include the To discuss this further: @Neverlord receiving a message from an unknown id_block causes a segfault at the destructor of Here is the example. |
Ah ta, I see, yeah that'd probably work, as my atoms are used external of Qt as well as in it, i'd have to apply the same default offset. Custom Qt events start at 1000. So I'll have to offset my first atom id by that amount, that way I only need to declare one set of atoms, not two sets (internal vs Qt Event flavour with the 1000 id offset . Does that sound right ? Or is there only one atom id used in the Qt event, as it wraps the message in the event. Sorry it's been awhile since I've touched this code and forgotten how it works :) |
It shouldn't segfault, as that could be triggered accidentally by a remote actor sending an unknown message id ? |
The second parameter to
If I've got the question right here, then yes, you declare one set of atoms and use those across the whole application. It makes no difference if you make a |
Just a note on this: using the same ID will work. Just be aware that CAF allocates an array to hold the type ID information. So large gaps will mean some waste of memory and you'll have an array with > 1000 entries. Shouldn't really matter unless you're running in constrained (embedded) devices, but I wanted to point it out. :)
As long as you register the ID in both worlds, I don't see a reason for concerns.
When sending messages over the wire, CAF will check incoming type IDs and will complain to the sender of the message when receiving an unknown type ID. Initializing the local meta information table is always required, though. Sorry for the inconvenience. With 0.19, we have already added diagnostic to print a useful error message when not initializing the meta object table (https://github.com/actor-framework/actor-framework/blob/master/CHANGELOG.md#0190---2023-04-17) to make it a lot more obvious what's going wrong in cases like this. However, this error message isn't showing up here. We'll improve on the error reporting. |
Ah, cheers I didn't realise it allocated the array fully, I had a quite sizeable offset in there.. |
Changing the label, since it's actually a lack of diagnostic, not a bug per se. |
Send it a unexpected message and it get's very unhappy, as soon as I add a placeholder to receive it it's happy again.
Is there special behaviour required here?
The text was updated successfully, but these errors were encountered: