• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
daemon crashes in rewrite
#1
The daemon.c shows a warning during compile (and still fails with an error on arm / Raspbian). And during execution the daemon crashes because of those lines.

Code:
[ 73%] Building C object CMakeFiles/pilight-daemon.dir/daemon.c.o
/home/pi/pilight-rewrite/daemon.c: In function 'receive_parse_code':
/home/pi/pilight-rewrite/daemon.c:401:26: warning: passing argument 1 of 'protocol-><U38e8>.parseCode' from incompatible pointer type [-Wincompatible-pointer-types]
      protocol->parseCode(message);
                          ^
/home/pi/pilight-rewrite/daemon.c:401:26: note: expected 'char **' but argument is of type 'char *'
/home/pi/pilight-rewrite/daemon.c: In function 'send_queue':
/home/pi/pilight-rewrite/daemon.c:644:36: warning: passing argument 2 of 'protocol->createCode' from incompatible pointer type [-Wincompatible-pointer-types]
     if(protocol->createCode(jcode, message) == 0 && main_loop == 1) {
                                    ^
/home/pi/pilight-rewrite/daemon.c:644:36: note: expected 'char **' but argument is of type 'char *'
[ 74%] Linking C executable pilight-daemon
[ 74%] Built target pilight-daemon

The daemon crashes when running pilight-send on any protocol, for example generic_switch.

Code:
pilight-send -p generic_switch -i 2 -t -I ubuntu

First start the daemon and run pilight-send in a second terminal.

Code:
root@ubuntu:/home/pi/pilight-rewrite/build# pilight-daemon -D
(/home/pilight/source/wiringX-dev/src/soc/broadcom/2835.c #130) [Aug 05 13:57:21:491275] ERROR: wiringX failed to open /dev/mem for raw memory access
(/home/pi/pilight-rewrite/daemon.c #1864) [Aug 05 13:57:21:492006] INFO: version
(/home/pi/pilight-rewrite/libs/pilight/core/socket.c #573) [Aug 05 13:57:21:493884] INFO: socket server started at port #42490, fd: 9
(/home/pi/pilight-rewrite/libs/pilight/core/ssdp.c #446) [Aug 05 13:57:21:494050] INFO: ssdp server started
(/home/pi/pilight-rewrite/libs/pilight/core/webserver.c #1683) [Aug 05 13:57:21:494138] INFO: secured webserver started on port: 5002 (fd 11)
(/home/pi/pilight-rewrite/libs/pilight/core/webserver.c #1686) [Aug 05 13:57:21:494211] INFO: regular webserver started on port: 5001 (fd 12)
(/home/pi/pilight-rewrite/daemon.c #1495) [Aug 05 13:57:22:388385] DEBUG: cpu: 0.000000%
(/home/pi/pilight-rewrite/daemon.c #306) [Aug 05 13:57:22:388806] DEBUG: broadcasted: {"values":{"cpu":0.000000},"origin":"core","type":-1}
(/home/pi/pilight-rewrite/libs/pilight/core/socket.c #371) [Aug 05 13:57:24:637140] DEBUG: new client, fd: 13, ip: 0.0.0.0, port: 55906
(/home/pi/pilight-rewrite/libs/pilight/core/socket.c #371) [Aug 05 13:57:24:637245] DEBUG: new client, fd: 14, ip: 0.0.0.0, port: 44378
(/home/pi/pilight-rewrite/daemon.c #877) [Aug 05 13:57:24:639226] DEBUG: socket recv: {"action":"send","code":{"on":1,"id":2,"protocol":["generic_switch"]}}
Segmentation fault (core dumped)

config.json
Code:
{
    "devices": {},
    "gui": {},
    "rules": {},
    "settings": {
        "log-level": 6,
        "pid-file": "/var/run/pilight.pid",
        "log-file": "/var/log/pilight.log",
        "gpio-platform": "raspberrypi1b2",
        "webserver-enable": 1,
        "webserver-root": "/usr/local/share/pilight/",
        "webserver-http-port": 5001,
        "webserver-https-port": 5002,
        "webserver-cache": 1,
        "whitelist": ""
    },
    "hardware": {
        "none": {}
    },
    "registry": {}
}


Code:
root@ubuntu:/home/pi/pilight-rewrite/build# ./pilight-unittest
[ test_unittest                                    ]
[ test_memory                                      ]
WARNING: calling free on already freed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #85
  CHECK: calling free on already freed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #85
WARNING: unfreed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #120
  CHECK: unfreed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #120
WARNING: unfreed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #138
WARNING: unfreed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #135
  CHECK: unfreed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #138
  CHECK: unfreed pointer in /home/pi/pilight-rewrite/tests/memory.c at line #135
ERROR: calling realloc on an unknown pointer in /home/pi/pilight-rewrite/tests/memory.c at line #156
CHECK: calling realloc on an unknown pointer in /home/pi/pilight-rewrite/tests/memory.c at line #156
WARNING: calling free after xfree was called in /home/pi/pilight-rewrite/tests/memory.c at line #178
  CHECK: calling free after xfree was called in /home/pi/pilight-rewrite/tests/memory.c at line #178
ERROR: trying to free an unknown pointer in /home/pi/pilight-rewrite/tests/memory.c at line #219
CHECK: trying to free an unknown pointer in /home/pi/pilight-rewrite/tests/memory.c at line #219
[ test_explode                                     ]
[ test_nrcpu                                       ]
[ test_isrunning                                   ]
[ test_isnummeric                                  ]
[ test_name2uid                                    ]
[ test_strstr                                      ]
[ test_ishex                                       ]
[ test_urldecode                                   ]
[ test_urlencode                                   ]
[ test_base64decode                                ]
[ test_base64encode                                ]
[ test_hostname                                    ]
[ test_distroname                                  ]
[ test_file_exists                                 ]
[ test_path_exists                                 ]
[ test_vercmp                                      ]
[ test_uniq_space                                  ]
[ test_str_replace                                 ]
[ test_stricmp                                     ]
[ test_file_get_contents                           ]
[ test_calc_time_interval                          ]
[ test_inet_devs                                   ]
[ test_dev2mac                                     ]
[ test_host2ip                                     ]
[ test_whitelist_check                             ]
[ test_binary                                      ]
[ test_proc                                        ]
[ - calculating 50000 primes                       ]
[ - now 35000 and 25000 primes in two threads      ]
[ test_coord2tz                                    ]
[ test_datetime2ts                                 ]
[ test_localtime_l                                 ]
[ test_datefix                                     ]
[ test_json_encode                                 ]
[ test_json_decode                                 ]
[ test_cast_bool                                   ]
[ test_cast_string                                 ]
[ test_cast_int                                    ]
[ test_sha256cache                                 ]
[ test_strptime                                    ]
[ test_options_valid                               ]
[ test_options_invalid                             ]
[ test_options_merge                               ]
[ test_dso                                         ]
[ test_eventpool_callback_nothreads                ]
[ test_eventpool_callback_threaded                 ]
[ test_log                                         ]
(/home/pi/pilight-rewrite/tests/log.c #42) [Aug 05 13:34:56:356487] emergency
(/home/pi/pilight-rewrite/tests/log.c #43) [Aug 05 13:34:56:356646] alert
(/home/pi/pilight-rewrite/tests/log.c #44) [Aug 05 13:34:56:356693] critical
(/home/pi/pilight-rewrite/tests/log.c #45) [Aug 05 13:34:56:356749] ERROR: test
(/home/pi/pilight-rewrite/tests/log.c #46) [Aug 05 13:34:56:356831] WARNING: test
(/home/pi/pilight-rewrite/tests/log.c #47) [Aug 05 13:34:56:356904] NOTICE: test
(/home/pi/pilight-rewrite/tests/log.c #48) [Aug 05 13:34:56:357001] INFO: test
(/home/pi/pilight-rewrite/tests/log.c #49) [Aug 05 13:34:56:357116] DEBUG: test
DEBUG: garbage collected log library
[ test_ssdp_client                                 ]
[ test_ssdp_server                                 ]
[ test_ping_localhost                              ]
[ test_ping_timeout                                ]
[ test_ping_response                               ]
[ test_ping_localhost_threaded                     ]
[ test_ping_timeout_threaded                       ]
[ test_ping_response_threaded                      ]
[ test_ntp                                         ]
[ test_arp                                         ]
[ - waiting for connection                         ]
[ - waiting for ip change                          ]
[ - waiting for mac change                         ]
[ - waiting for disconnection                      ]
[ test_http                                        ]
[ - plain get                                      ]
[ - plain get ssl                                  ]
[ - json get                                       ]
[ - big file get                                   ]
[ - chunked get                                    ]
[ - multiple chunked get                           ]
[ - 404 header, ssl, and lower case headers        ]
[ - simple post                                    ]
[ - simple ssl post                                ]
[ - http auth                                      ]
[ test_http_threaded                               ]
[ - plain get                                      ]
[ - plain get ssl                                  ]
[ - json get                                       ]
[ - big file get                                   ]
[ - chunked get                                    ]
[ - multiple chunked get                           ]
[ - 404 header, ssl, and lower case headers        ]
[ - simple post                                    ]
[ - simple ssl post                                ]
[ - http auth                                      ]
[ test_mail                                        ]
[ - gmail plain                                    ]
[ - gmail switch to ssl                            ]
[ - gmail full ssl                                 ]
[ - tele2 plain                                    ]
[ - gmail ehlo error                               ]
[ - gmail invalid base64                           ]
[ - gmail wrong username/password                  ]
[ test_mail_threaded                               ]
[ - gmail plain                                    ]
[ - gmail switch to ssl                            ]
[ - gmail full ssl                                 ]
[ - tele2 plain                                    ]
[ - gmail ehlo error                               ]
[ - gmail invalid base64                           ]
[ - gmail wrong username/password                  ]
[ test_webserver_get                               ]
[ - http://../                                     ]
[ - http://../jquery-2.1.4.min.js                  ]
[ - http://../jquery.mobile-1.4.5.min.js           ]
[ - http://../moment.min.js                        ]
[ - http://../pilight.js                           ]
[ - http://../jquery.mobile-1.4.5.min.css          ]
[ - http://../pilight.css                          ]
[ - http://../pilight.jquery.theme.css             ]
[ - http://../ajax-loader.gif                      ]
[ - http://../config                               ]
[ - https://../                                    ]
[ - https://../jquery-2.1.4.min.js                 ]
[ - https://../jquery.mobile-1.4.5.min.js          ]
[ - https://../moment.min.js                       ]
[ - https://../pilight.js                          ]
[ - https://../jquery.mobile-1.4.5.min.css         ]
[ - https://../pilight.css                         ]
[ - https://../pilight.jquery.theme.css            ]
[ - https://../ajax-loader.gif                     ]
[ - https://../config                              ]
[ - https://../nonexisting                         ]
[ test_webserver_auth                              ]
[ - http://test:test@../                           ]
[ - http://test1:test1@../                         ]
[ test_webserver_websocket1                        ]
[ test_webserver_websocket2                        ]
[ test_socket_client                               ]
[ test_socket_server                               ]
[ test_socket_large_content                        ]
[ test_socket_reject_client                        ]
[ test_protocols_433_alecto_ws1700                 ]
[ test_protocols_433_alecto_wx500                  ]
[ test_protocols_433_arctech_contact               ]
[ test_protocols_433_arctech_dimmer                ]
[ test_protocols_433_arctech_dusk                  ]
[ test_protocols_433_livolo_switch                 ]
[ test_protocols_api_cpu_temp                      ]
[ test_protocols_api_datetime                      ]
[ test_protocols_api_sunriseset_amsterdam          ]
[ test_protocols_api_sunriseset_new_york           ]
[ test_protocols_api_sunriseset_beijing            ]
[ test_protocols_api_sunriseset_rise               ]
[ test_protocols_api_sunriseset_at_rise            ]
[ test_protocols_api_sunriseset_set                ]
[ test_protocols_api_sunriseset_at_set             ]
[ test_protocols_api_sunriseset_midnight           ]
[ test_protocols_api_sunriseset_at_midnight        ]
[ test_protocols_api_lirc                          ]
[ - round 1                                        ]
[ - round 2                                        ]
[ test_protocols_api_xbmc                          ]
[ - round 1                                        ]
[ - round 2                                        ]
[ test_protocols_api_openweathermap_update         ]
[ - waiting for update message                     ]
[ - waiting for openweathermap notification        ]
[ test_protocols_api_openweathermap_sunrise        ]
[ - waiting for first openweathermap notification  ]
[ - waiting for openweathermap sunrise             ]
[ test_protocols_api_openweathermap_sunset         ]
[ - waiting for first openweathermap notification  ]
[ - waiting for openweathermap sunset              ]
[ test_protocols_api_openweathermap_midnight       ]
[ - waiting for first openweathermap notification  ]
[ - waiting for openweathermap midnight            ]
[ test_protocols_api_wunderground_update           ]
[ - waiting for update message                     ]
[ - waiting for wunderground notification          ]
[ test_protocols_api_wunderground_sunrise          ]
[ - waiting for first wunderground notification    ]
[ - waiting for wunderground sunrise               ]
[ test_protocols_api_wunderground_sunset           ]
[ - waiting for first wunderground notification    ]
[ - waiting for wunderground sunset                ]
[ test_protocols_api_wunderground_midnight         ]
[ - waiting for first wunderground notification    ]
[ - waiting for wunderground midnight              ]
[ test_protocols_network_ping                      ]
[ test_protocols_network_arping                    ]
[ - waiting for connection                         ]
[ - waiting for ip change                          ]
[ - waiting for mac change                         ]
[ - waiting for disconnection                      ]
[ test_protocols_core_raw                          ]
[ test_protocols_generic_dimmer                    ]
[ test_protocols_generic_label                     ]
[ test_protocols_generic_screen                    ]
[ test_protocols_generic_switch                    ]
[ test_protocols_generic_weather                   ]
[ test_protocols_generic_webcam                    ]
Cannot read directory '/lib/modules/4.4.0-83-generic/': No such file or directory
[ test_protocols_i2c_lm75       (requires i2c-stub)]
Cannot read directory '/lib/modules/4.4.0-83-generic/': No such file or directory
[ test_protocols_i2c_lm76       (requires i2c-stub)]
Cannot read directory '/lib/modules/4.4.0-83-generic/': No such file or directory
[ test_protocols_i2c_bmp180     (requires i2c-stub)]
[ test_protocols_gpio_ds18s20                      ]
[ test_protocols_gpio_ds18b20                      ]
[ test_event_operator_and                          ]
[ test_event_operator_divide                       ]
[ test_event_operator_eq                           ]
[ test_event_operator_ge                           ]
[ test_event_operator_gt                           ]
[ test_event_operator_intdivide                    ]
[ test_event_operator_le                           ]
[ test_event_operator_lt                           ]
[ test_event_operator_minus                        ]
[ test_event_operator_modulus                      ]
[ test_event_operator_multiply                     ]
[ test_event_operator_ne                           ]
[ test_event_operator_or                           ]
[ test_event_operator_plus                         ]
[ test_event_function_date_add                     ]
[ test_event_function_date_format                  ]
[ test_event_function_random                       ]
[ test_event_actions_switch_check_parameters       ]
[ test_event_actions_switch_run                    ]
[ test_event_actions_switch_run_delayed            ]
[ test_event_actions_switch_run_overlapped         ]
[ test_event_actions_switch_run_override           ]
[ test_event_actions_toggle_check_parameters       ]
[ test_event_actions_toggle_run                    ]
[ test_event_actions_label_check_parameters        ]
[ test_event_actions_label_run                     ]
[ test_event_actions_label_run_delayed             ]
[ test_event_actions_label_run_overlapped          ]
[ test_event_actions_label_run_override            ]
[ test_event_actions_dim_check_parameters          ]
[ test_event_actions_dim_run                       ]
[ test_event_actions_dim_run_delayed               ]
[ test_event_actions_dim_run_stepped               ]
[ test_event_actions_dim_run_overlapped            ]
[ test_event_actions_dim_run_override              ]
[ test_event_actions_mail_check_parameters         ]
[ test_event_actions_mail_run                      ]
[ test_events                                      ]
[ - simple_true_formula                            ]
[ - simple_false_formula                           ]
[ - with_hooks                                     ]
[ - with_and                                       ]
[ - single_quoted_with_and                         ]
[ - double_quoted_with_and                         ]
[ - with_or                                        ]
[ - with_or                                        ]
[ - multiple_and_or                                ]
[ - multiple_and_or                                ]
[ - multiple_and_or_hooks                          ]
[ - multiple_and_or_hooks                          ]
[ - gt_and                                         ]
[ - with_dot                                       ]
[ - valid_device_param                             ]
[ - valid_device_param                             ]
[ - valid_device_param                             ]
[ - function_as_device_param                       ]
[ - valid_device_param_in_function                 ]
[ - dimmer_values_from_function                    ]
[ - multiple_actions                               ]
[ - multiple_rules                                 ]
[ - multiple_rules_one_inactive                    ]
[ - nested_functions                               ]
[ - received_device                                ]
[ - date_format_with_device_parameter              ]
[ - date_add_with_device_parameter                 ]
[ - only_execute_device_rules                      ]
.............................................................................................................................................

OK (141 tests)
 
Reply
#2
The daemon itself has not been ported properly to rewrite in any way so should also not be used.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  program protocol missing in rewrite Niek 1 614 10-07-2017, 08:55 PM
Last Post: curlymo
  rewrite fails to compile ma-ca 24 4,564 09-01-2017, 11:57 AM
Last Post: wseifert
  dim action fails in rewrite ma-ca 1 636 08-04-2017, 05:16 PM
Last Post: curlymo
  pilight rewrite branch fails to compile ebk 0 920 06-30-2017, 01:07 PM
Last Post: ebk
  Rewrite development status TopdRob 1 1,313 12-10-2016, 10:31 PM
Last Post: curlymo
  [fixed] bug fix for ds18b20.c rewrite branch beaming 1 1,250 05-13-2016, 06:27 AM
Last Post: curlymo
  [Solved] openSUSE 13.2 "pilight-daemon -H" segfault pilino1234 2 1,835 04-22-2016, 08:39 AM
Last Post: pilino1234
  HowTo Move your 3rd party code code from development to rewrite wo_rasp 0 1,119 03-15-2016, 02:10 PM
Last Post: wo_rasp

Forum Jump:


Browsing: 1 Guest(s)