homebridge-foscamcamera
homebridge-foscamcamera copied to clipboard
Segmentation fault: 11 on mac os x with foscam c2
Hi,
I'm getting segmentation fault 11s on mac's homebridge setup. I tried to find other causes, but it seems that the foscamcamera is indeed causing this error when combined with the c2. I've been monitoring all crashes for a couple of weeks and the segmentation faults all follow the following:
[2016-10-29 09:23:05] [Foscam C2] Foscam-NG: Getting snapshot. [2016-10-29 09:23:05] [Foscam C2] Foscam-NG: Got snapshot. Segmentation fault: 11
I've enabled debugging, but than it seems to crash less frequent which makes it harder to tackle.
What I expect is that the C2 (possibly combined with the foscam-client) generated snapshot of very large dimension which may cause the segmentation fault on my mac. What are your thoughts on this? How would you suggest the try and solve this? Shall I put in a log output that prints the image's size?
Thanks!
Roy
Any debug log will be helpful. How many cameras do you have? Do you have cameras other than the C2? Does the home app show the snapshot without problem?
If you think that the problem is caused by the size of the snapshot, try to default you camera to 720p and see if that still happens
I did not get a debug log that's of much use since it crashes less frequent. I only have one cam, btw. Perhaps your suggestion to lower the resolution worked. It has been running for a full day now...
Mmm spoke to soon. Just a crash with the following log
[2016-10-31 17:04:12] [Foscam C2] Foscam-NG: Getting snapshot. [2016-10-31 17:04:12] [Foscam C2] Foscam-NG: Got snapshot. homebridge(12997,0x7fffb834c3c0) malloc: *** error for object 0x102c1ca90: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6
I'll try the debug option again.
Yesterday it crashed with a debug log. Can you see anything out of the ordinary? There are two ip adreses and I noticed a mismatch in the homekit automation triggers. Therefore I reseted one of the devices to fix this mismatched. It's now running again with debug log. Thanks!
Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":35,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +1ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":28,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +4m HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":44,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Motion Detected" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +4ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":14,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.14 +5ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.14 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +0ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.21 +5ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.21 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +0ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.35 +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.35 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +0ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.28 +6ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.28 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +0ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +4ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":21,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":35,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":28,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.14 +2m HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.14 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +0ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.21 +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.21 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +1ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.35 +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.35 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +0ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics?id=1.28 +4ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /characteristics?id=1.28 +0ms Accessory [Foscam C2] Getting value for Characteristic "Streaming Status" +0ms Accessory [Foscam C2] Got Characteristic "Streaming Status" value: AQEA +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +10ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":44,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Motion Detected" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":14,"ev":true}] +1ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +4ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":21,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +3ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":35,"ev":true}] +1ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP request: /characteristics +8ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: PUT /characteristics +0ms Accessory [Foscam C2] Processing characteristic set: [{"aid":1,"iid":28,"ev":true}] +0ms Accessory [Foscam C2] Registering Characteristic "Streaming Status" for events +0ms EventedHTTPServer [::ffff:10.0.1.9] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.11] Client connection closed +24s EventedHTTPServer [::ffff:10.0.1.11] HTTP connection was closed +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP server was closed +0ms EventedHTTPServer [::ffff:10.0.1.11] Client connection closed +2ms EventedHTTPServer [::ffff:10.0.1.11] HTTP connection was closed +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP server was closed +0ms EventedHTTPServer [::ffff:10.0.1.11] New connection from client +4s EventedHTTPServer [::ffff:10.0.1.11] HTTP server listening on port 60500 +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP request: /pair-verify +2ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: POST /pair-verify +0ms HAPServer [C2:2D:FB:F3:9B:26] Pair verify step 1/2 +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.11] New connection from client +16ms EventedHTTPServer [::ffff:10.0.1.11] HTTP server listening on port 60502 +1ms EventedHTTPServer [::ffff:10.0.1.11] HTTP request: /pair-verify +1ms HAPServer [CC:22:3D:E3:CE:32] HAP Request: POST /pair-verify +0ms HAPServer [CC:22:3D:E3:CE:32] Pair verify step 1/2 +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.11] HTTP request: /pair-verify +20ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: POST /pair-verify +1ms HAPServer [C2:2D:FB:F3:9B:26] Pair verify step 2/2 +0ms HAPServer [C2:2D:FB:F3:9B:26] Client E3EE11F8-1908-4356-BB34-82463474C31D verification complete +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP Response is finished +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP request: /accessories +5ms HAPServer [C2:2D:FB:F3:9B:26] HAP Request: GET /accessories +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.11] HTTP request: /pair-verify +6ms HAPServer [CC:22:3D:E3:CE:32] HAP Request: POST /pair-verify +0ms HAPServer [CC:22:3D:E3:CE:32] Pair verify step 2/2 +0ms HAPServer [CC:22:3D:E3:CE:32] Client E3EE11F8-1908-4356-BB34-82463474C31D verification complete +0ms EventedHTTPServer [::ffff:10.0.1.11] HTTP Response is finished +1ms EventedHTTPServer [::ffff:10.0.1.11] HTTP request: /accessories +3ms HAPServer [CC:22:3D:E3:CE:32] HAP Request: GET /accessories +0ms Segmentation fault: 11
What version of node are you running?
I'm on 6.9.1.
I just got the following error:
homebridge(21335,0x7fffc452c3c0) malloc: *** error for object 0x1020a3838: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6
Do you know how to setup the debugger/breakpoint with homebridge?
Have no idea about that. Probably it will be easier to ask in homebridge github
Thanks! I'll ask over there
just got a better error message. I did not have time to dig into it myself, yet, but this is the error:
[2016-11-06 17:40:23] [Foscam C2] { Error: This socket has been ended by the other party at Socket.writeAfterFIN as write at FoscamStreamLayer.sendPacket (/usr/local/lib/node_modules/homebridge-foscamcamera/node_modules/foscam-binary-client/lib/FoscamPacketLayer.js:97:21) at FoscamStreamLayer.sendPacket (/usr/local/lib/node_modules/homebridge-foscamcamera/node_modules/foscam-binary-client/lib/FoscamEncryptionLayer.js:253:15) at self.connect.then (/usr/local/lib/node_modules/homebridge-foscamcamera/node_modules/foscam-binary-client/lib/FoscamStreamLayer.js:116:18) code: 'EPIPE' } [2016-11-06 17:40:23] [Foscam C2] Resetting connection to server... [2016-11-06 17:40:23] [Foscam C2] Connected to server for motion notification. events.js:160 throw er; // Unhandled 'error' event ^
Error: read ECONNRESET at exports._errnoException (util.js:1026:11) at TCP.onread (net.js:569:26)
Just got a C2 and my issues appear to be wifi related (seems much less stable than the R2 on wifi). I'm hardwiring it now as a test - keeping the camera at 1080/15fps.