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

Segmentation Fault: 11 #8

Closed
samsonrosen opened this issue Jun 17, 2020 · 14 comments · Fixed by #10
Closed

Segmentation Fault: 11 #8

samsonrosen opened this issue Jun 17, 2020 · 14 comments · Fixed by #10
Labels
bug Something isn't working

Comments

@samsonrosen
Copy link

Hi,

Since installing the latest updateI'm now getting 'Segmentation Fault: 11'. Homebridge stops after a couple hours and I have to re-run it start.

I uninstalled the SwitchBot plugin and haven’t the issue since. Here is my config, and I attached the output of running in Debug Mode.

Versions:
Church-Server:~ churchserver$ node -v
v14.3.0
Church-Server:~ churchserver$ npm -v
6.14.5
Church-Server:~ churchserver$ homebridge -V
0.4.53

Mac OS 10.4

sudo homebridge -I -D.txt

{
    "bridge": {
        "name": "Homebridge Mac",
        "username": "CC:22:3D:E3:CE:38",
        "port": 51827,
        "pin": "031-45-150"
    },
    "description": "Homebridge Mac",
    "accessories": [
      {
        "accessory": "ApplescriptFile",
        "name": "Wireless Record Player",
        "on": "/Users/churchserver/Documents/Airfoil/AirFoilRecord.scpt",
        "off": "/Users/churchserver/Documents/Airfoil/DisconnectAirfoil.scpt"
    },
    {
      "accessory": "ApplescriptFile",
      "name": "All Speakers",
      "on": "/Users/churchserver/Documents/Airfoil/AllSpeakers.scpt",
      "off": "/Users/churchserver/Documents/Airfoil/AllSpeakersOff.scpt"
  },
    {
      "accessory": "ApplescriptFile",
      "name": "Wireless CD Player",
      "on": "/Users/churchserver/Documents/Airfoil/AirFoilCD.scpt",
      "off": "/Users/churchserver/Documents/Airfoil/DisconnectAirfoil.scpt"
  },
  {
            "accessory": "SwitchBot-For-Mac",
            "name": "Printer",
            "delay": 5000,
            "macAddress": "CC:70:9C:72:9C:D8",
            "ping": {
                "ipAddress": "192.168.1.78",
                "interval": 2000
            }
          }
],
    "platforms": [
      {
      "platform": "SamsungTizen",
      "devices": [
          {
              "name": "TV",
              "ip": "192.168.1.130",
              "mac": "8C:79:F5:E4:7B:DA"
          }
      ]
  },
      {
           "platform": "BelkinWeMo",
           "name": "WeMo Platform"
       },
      {
            "platform": "MiLight",
            "bridges": [
                {
                    "ip_address": "192.168.1.75",
                    "version": "v6",
                    "lights": {
                        "bridge": [
                            "iMac"
                        ],
                        "rgbw": [
                            null,
                            "Green Chair",
                            "Piano"
                        ],
                        "fullColor": [
                            "Myer"
                        ]
                    },
                    "repeat": 3,
                    "delay": 5
                }
            ],
            "name": "MiLight"
        },
  {
       "platform":"People",
       "threshold":15,
       "anyoneSensor":true,
       "nooneSensor":true,
       "webhookPort":51828,
       "cacheDirectory":"./.node-persist/storage",
       "pingInterval":10000,
       "ignoreReEnterExitSeconds":0,
       "people":[
          {
             "name":"person1",
             "target":"192.168.1.107",
             "threshold":15,
             "pingInterval":10000,
             "ignoreReEnterExitSeconds":0
          },
          {
             "name":"person2",
             "target":"192.168.1.129",
             "threshold":15,
             "pingInterval":10000,
             "ignoreReEnterExitSeconds":0
          }
       ]
    },
        {
            "platform": "cmdSwitch2",
            "switches": [
                {
                    "name": "Smarter Kettle",
                    "on_cmd": "/Users/churchserver/iBrew/ibrewlegacy heat 192.168.1.217",
                    "off_cmd": "/Users/churchserver/iBrew/ibrewlegacy stop 192.168.1.217",
                    "state_cmd": "/Users/churchserver/iBrew/ibrewlegacy status 192.168.1.217 | grep 'Heating water 100ºC selected'",
                    "polling": true,
                    "interval": 50
                },
                {
                    "name": "Singer",
                    "on_cmd": "blinkstick white",
                    "off_cmd": "blinkstick off",
                    "polling": true,
                    "interval": 50
                }
            ]
        },
        {
      "platform":"BroadlinkRM",
      "name":"Broadlink RM",
      "hideScanFrequencyButton": true,
      "hideLearnButton": false,
      "hideWelcomeMessage": true,
      "accessories":[
        {
        "name": "CD Player",
        "type": "switch",
        "data": {
        "off": "2600500000012a94121412121313111411141213121312131337123812381337121313381138123813121214133711381338111313131114123812381213121311141338113812381300054200012a4b12000d050000000000000000",
        "on": "2600500000012a94121412121313111411141213121312131337123812381337121313381138123813121214133711381338111313131114123812381213121311141338113812381300054200012a4b12000d050000000000000000"
        }
        },
    {
      "name":"Oscillation",
      "type":"switch",
      "enableAutoOff": true,
      "onDuration": 5,
      "data":{
        "on":"26004800451f1538151f151f1637161d161c161d1639161d1439161e1636171c1736161d16000cc6471e1637161e151e1836151d161e161d1538161e1935161d1637151d1637161d15000d05"
      }
    },
        {
          "name":"Dyson",
          "type":"fan",
          "hideRotationDirection": true,
          "persistState": false,
          "hideSwingMode": true,
          "data":{
            "on": "0000 006d 0022 0000 0054 001f 001c 003c 001c 001f 001c 003c 001c 001f 001c 001f 001c 001f 001c 001f 001c 0021 001c 0020 001c 0020 001c 0020 001c 0020 001c 0020 001c 003d 001c 003d 001c 0f7f 0054 001f 001c 003c 001c 001f 001c 003c 001c 001f 001c 001f 001c 001f 001c 001f 001c 0021 001c 0020 001c 0020 001c 0020 001c 0020 001c 0020 001c 003d 001c 003d 001c 001f",
            "off":"0000 006d 0022 0000 0054 001f 001c 003c 001c 001f 001c 003c 001c 001f 001c 001f 001c 001f 001c 001f 001c 0021 001c 0020 001c 0020 001c 0020 001c 0020 001c 0020 001c 001f 001c 001f 001c 0f80 0054 001f 001c 003c 001c 001f 001c 003c 001c 001f 001c 001f 001c 001f 001c 001f 001c 0021 001c 0020 001c 0020 001c 0020 001c 0020 001c 0020 001c 001f 001c 001f 001c 001f",
            "fanSpeed10": [
              {
                "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
                "sendCount": 9,
                "interval": 0.3
              }
    ],
    "fanSpeed20": [
      {
        "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
        "sendCount": 9,
        "interval": 0.3,
        "pause": 0.2
      },
      {
        "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
        "sendCount": 1
      }
],
"fanSpeed30": [
  {
    "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
    "sendCount": 9,
    "interval": 0.3,
    "pause": 0.2
  },
  {
    "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
    "sendCount": 2
  }
],
"fanSpeed40": [
  {
    "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
    "sendCount": 9,
    "interval": 0.3,
    "pause": 0.2
  },
  {
    "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
    "sendCount": 3
  }
],
"fanSpeed50": [
  {
    "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
    "sendCount": 9,
    "interval": 0.3,
    "pause": 0.2
  },
  {
    "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
    "sendCount": 4
  }
],
"fanSpeed60": [
  {
    "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
    "sendCount": 9,
    "interval": 0.3,
    "pause": 0.2
  },
  {
    "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
    "sendCount": 5
  }
],
"fanSpeed70": [
  {
    "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
    "sendCount": 9,
    "interval": 0.3,
    "pause": 0.2
  },
  {
    "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
    "sendCount": 6
  }
],
"fanSpeed80": [
  {
    "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
    "sendCount": 9,
    "interval": 0.3,
    "pause": 0.2
  },
  {
    "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
    "sendCount": 7
  }
],
"fanSpeed90": [
  {
    "data": "26004800471d1736171d171d1636171d161d161d163816371637173616361736161d163616000d01461e1637171d161e1636171c171d161d163816371637173517361636171c173616000d05",
    "sendCount": 9,
    "interval": 0.3,
    "pause": 0.2
  },
  {
    "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
    "sendCount": 8
  }
],
    "fanSpeed100": [
      {
        "data": "26004800491b1835191b181c1933191b181b181b191b1a34191a1a33191b1834171c191a19000cd7491b1a33171d171d1934191a191a171c171e1934191b19331a1a17351a19171c19000d05",
        "sendCount": 9,
        "interval": 0.3
      }
]
          }
        }
      ]
    }
]
}
@zizi4n5
Copy link
Owner

zizi4n5 commented Jun 17, 2020

It's not happening on my Homebridge, so maybe it's the newly added ping feature that's causing it.
Could you remove the ping settings once and see if the problem occurs?

@zizi4n5 zizi4n5 added the bug Something isn't working label Jun 17, 2020
@samsonrosen
Copy link
Author

samsonrosen commented Jun 17, 2020 via email

@samsonrosen
Copy link
Author

Hey,

I’ve been using it all day without the crash. Seems to be the ping module. Let me know if there’s any more logs I can provide.

@zizi4n5
Copy link
Owner

zizi4n5 commented Jun 18, 2020

Thank you for the confirmation and the suggestion to provide a log.
Unfortunately, version 0.1.0 does not embed the logs for failure investigation.
For this reason, I will consider releasing a version with additional logging.

I'm sorry, but I can only work on it on weekends, so it will take some time.

@zizi4n5
Copy link
Owner

zizi4n5 commented Jun 18, 2020

The homebridge-broadlink-rm also seems to have a crash in the net-ping module used for pinging, so this may be a problem with the net-ping module.
lprhodes/homebridge-broadlink-rm#631

@zizi4n5
Copy link
Owner

zizi4n5 commented Jun 20, 2020

I have released 0.1.2 with the following fixes, can you check again?

Fix ping session generation process, which could be the cause of the crash, to run only once.

Unfortunately, if you still have problems with 0.1.2, you can use the ping option and see if you can't improve it by changing that.

https://github.com/zizi4n5/homebridge-switchbot-for-mac#ping

@zizi4n5 zizi4n5 reopened this Jun 20, 2020
@samsonrosen
Copy link
Author

Hey! Thanks for updating this so quickly. I have updated and inserted the new sample config and will let you know if I get the same error.

With the printer switched off I am getting an error every second: [Error: No route to Host] followed by [Error: Host is down]. Which makes sense as the printer is off. But it does fill the homebridge terminal up.

@zizi4n5
Copy link
Owner

zizi4n5 commented Jun 22, 2020

With the printer switched off I am getting an error every second: [Error: No route to Host] followed by [Error: Host is down]. Which makes sense as the printer is off. But it does fill the homebridge terminal up.

Hi! As you said, the log output of ping results was too many.
For this reason, I have released an improved version 0.1.3, which only shows the log output when Homebrige Settings is debug mode.
homebridge-debug-mode

@samsonrosen
Copy link
Author

Wow! You’re the best. Thanks for being so responsive. Is there somewhere I can donate to your efforts? This is a great plugin.

Can we hound you when the SwitchBot curtain comes out? Haha.

I’ll update to 0.1.3. But I can confirm I haven’t had the segmentation error and Homebridge has been running for over 24 hours now.

@samsonrosen
Copy link
Author

Hey! I just updated and now I'm getting this error:

Church-Server:~ churchserver$ homebridge -V
0.4.53

I've since uninstalled and downgraded back to 0.1.2 and now it's working. Is there something I need to change in the config code?

`====================
[22/06/2020, 08:11:01] ERROR LOADING PLUGIN homebridge-switchbot-for-mac:
[22/06/2020, 08:11:01] Error: Plugin /usr/local/Cellar/node/12.4.0/lib/node_modules/homebridge-switchbot-for-mac requires a HomeBridge version of >0.4.53 which does not satisfy the current HomeBridge version of 0.4.53. You may need to upgrade your installation of HomeBridge.
at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:57:11)
at Server. (/usr/local/lib/node_modules/homebridge/lib/server.js:153:14)
at Array.forEach (:null:null)
at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:145:22)
at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:57:24)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:32:16)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47

[22/06/2020, 08:11:01] ====================
`

Error: The requested accessory 'SwitchBot-For-Mac' was not registered by any plugin. at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:297:42) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:91:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1200:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10) at Module.load (internal/modules/cjs/loader.js:1049:32) at Function.Module._load (internal/modules/cjs/loader.js:937:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47

@zizi4n5
Copy link
Owner

zizi4n5 commented Jun 22, 2020

Sorry.
For TypeScript support, the required version of homebridge has been changed to 1.0.0 or later.
Is it possible to up-date homebridge to 1.0.0 or later?

@samsonrosen
Copy link
Author

samsonrosen commented Jun 22, 2020 via email

@samsonrosen
Copy link
Author

Hey! So I've done a bit of digging and homebridge -V isn't representative of my current version. I think I need to update the link somehow between typing homebridge in the CLI and what's actually installed.. I think it might be linked to an old version.

None the less I've installed Homebridge 1.1.0, updated to your 0.1.3 version and manually run the command:

sudo /usr/local/Cellar/node/12.4.0/lib/node_modules/homebridge/bin/homebridge -I

And now it's behaving.

@zizi4n5
Copy link
Owner

zizi4n5 commented Jun 22, 2020

Thanks for the confirmation.
I'm glad to see it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants