Closed domvanrob closed 4 months ago
ok, noted. I'm having a strong case of "veja-vu" here ... I believe there's a very similar issue in the list of fixed issues (that's why the tag is "possible bug" and not directly "bug" for now ;)). Let my search/browse a little ...
Think I know which one you mean: https://github.com/FIWARE/context.Orion-LD/issues/1495
Nah, what I found is similar but not similar enough.
Rest for HTTPS notification: (null)
Might be just a log message using that NULL pointer. That would cause a SIGSEGV (11). I'll try to find some time to look into this asap
Think I know which one you mean: https://github.com/FIWARE/context.Orion-LD/issues/1495
Yes, that's the one I was thinking of
Alright, hopefully you'll find something!
I did find something, and it is related to the empty URL PATH of the notification endpoint. Bug fixed and tests running. If all goes well, and I have no reason to doubt that, a fix PR should be merged in a few hours.
So, hopefully fixed the issue, please try again with the newest image on dockerhub and close this issue if all is OK. (and if not, please let me know and I'll keep looking)
It's working!! Thanks for the fast reply, and fix.
What was the issue, if I may ask? Tried to understand the changes, but not sure why this was causing the crash.
Yeah, it was a stupidity. Not enough QA :( The crash occurs when the URL PATH of the notification endpoint is empty, as in your case. This worked just fine:
"notification": {
"endpoint": {
"uri": "https://IP:PORT/urlpath"
...
While this provokes the crash:
"notification": {
"endpoint": {
"uri": "https://IP:PORT/" # empty URL PATH
...
The piece pf code getting Segmentation Fault was this:
if (rest[0] == '/')
rest = &rest[1];
rest
is the variable (a char pointer) that references the URL PATH, in your case as there is no URL PATH, rest
is a NULL pointer.
Referencing (looking inside) rest
in if (rest[0] == '/')
as rest == 0 (NULL), is an access to memory address ZERO in the system and that is not allowed. It causes the crash due to Segmentation Fault.
Very easy fix: if rest
is NULL, don't do it.
That sounds logical, and already what I expected after viewing the changes. Funny enough, that I hadn't tested a variant with a path, in which case I could have probably made a more direct case in the issue :D
Thanks for the explanation, and keep up the good work!
The Issue
The context broker completely crashes when a subscription exists which has an HTTPS notification URI. Using an HTTP notification URI, the subscription seems to work as expected.
Environment
Locally using Docker (see composer below), but it also crashes my cloud hosted container.
Orion-LD: v1.5.1, but I've also tried the latest v1.6.0-pre-1609 image MongoDB: v6.0
Replication and logs
Create subscription:
Result: 201 Created
Retrieve subscription
Result:
Update entity
Result: Crashes container
Logs
I've tried multiple startup commands to increase the amount of insight in the logs. As you can see in the composer snippet, I'm currently using
-logLevel DEBUG -t 0-5,20-22,31,41-47
which yields the most info. Although, I haven't seen an actualERROR
/FATAL
log which explains the crash. The container hosted in the cloud crashes withUncaught signal: 11, pid=1, tid=44, fault_addr=0.
._I've replaced the actual URI with {HTTPSURL}
If any additional information is required, please ask.
Thanks in advance!