You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens when running the example apps on linux with the wifi
feature enabled (--wifi) because the device is actually connected
via ethernet and wifi is not connected. This could happen in a prod
device if > 1 network type was supported.
Fixesproject-chip#19585
* Fix crash on read Networks when not connected
This happens when running the example apps on linux with the wifi
feature enabled (--wifi) because the device is actually connected
via ethernet and wifi is not connected. This could happen in a prod
device if > 1 network type was supported.
Fixes#19585
* Restyled by clang-format
Co-authored-by: Restyled.io <[email protected]>
Problem
Attempting to read the Network attribute from a linux device where the networks have been added but not connected results in a seg fault.
Proposed Solution
This appears to be happening because the code assumes where is a connected interface. Need to add checks around that condition.
bt:
Thread 1 "chip-all-cluste" received signal SIGSEGV, Segmentation fault.
0x00005555557163dd in wpa_fi_w1_wpa_supplicant1_interface_get_current_network (object=0x0) at gen/include/platform/Linux/dbus/wpa/DBusWpaInterface.c:6434
6434 return WPA_FI_W1_WPA_SUPPLICANT1_INTERFACE_GET_IFACE (object)->get_current_network (object);
(gdb) bt
#0 0x00005555557163dd in wpa_fi_w1_wpa_supplicant1_interface_get_current_network (object=0x0) at gen/include/platform/Linux/dbus/wpa/DBusWpaInterface.c:6434
#1 0x00005555556ee4f7 in chip::DeviceLayer::ConnectivityManagerImpl::GetConfiguredNetwork(chip::DeviceLayer::NetworkCommissioning::Network&)
(this=0x55555580f420 chip::DeviceLayer::ConnectivityManagerImpl::sInstance, network=...) at ../../third_party/connectedhomeip/src/platform/Linux/ConnectivityManagerImpl.cpp:1349
#2 0x00005555556f619e in chip::DeviceLayer::NetworkCommissioning::LinuxWiFiDriver::WiFiNetworkIterator::Next(chip::DeviceLayer::NetworkCommissioning::Network&)
(this=0x5555558862b0, item=...) at ../../third_party/connectedhomeip/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp:210
#3 0x00005555555e7567 in operator()chip::app::AttributeValueEncoder::ListEncodeHelper(chip::app::AttributeValueEncoder::ListEncodeHelper const&) const
(__closure=0x7fffffffbb08, encoder=...) at ../../third_party/connectedhomeip/src/app/clusters/network-commissioning/network-commissioning.cpp:150
#4 0x00005555555e763f in chip::app::AttributeValueEncoder::EncodeList<chip::app::Clusters::NetworkCommissioning::Instance::Read(const chip::app::ConcreteReadAttributePath&, chip::app::AttributeValueEncoder&)::<lambda(const auto:10&)> >(struct {...}) (this=0x7fffffffbc40, aCallback=...) at ../../third_party/connectedhomeip/src/app/AttributeAccessInterface.h:227
#5 0x00005555555e4154 in chip::app::Clusters::NetworkCommissioning::Instance::Read(chip::app::ConcreteReadAttributePath const&, chip::app::AttributeValueEncoder&)
(this=0x555555807fe0 <(anonymous namespace)::sWiFiNetworkCommissioningInstance>, aPath=..., aEncoder=...)
at ../../third_party/connectedhomeip/src/app/clusters/network-commissioning/network-commissioning.cpp:145
#6 0x000055555559e794 in chip::app::(anonymous namespace)::ReadViaAccessInterface(chip::FabricIndex, bool, chip::app::ConcreteReadAttributePath const&, chip::app::AttributeReportIBs::Builder&, chip::app::AttributeValueEncoder::AttributeEncodeState*, chip::app::AttributeAccessInterface*, bool*)
(aAccessingFabricIndex=1 '\001', aIsFabricFiltered=true, aPath=..., aAttributeReports=..., aEncoderState=0x7fffffffc3dc, aAccessInterface=0x555555807ff8 <(anonymous namespace)::sWiFiNetworkCommissioningInstance+24>, aTriedEncode=0x7fffffffc17f) at ../../third_party/connectedhomeip/src/app/util/ember-compatibility-functions.cpp:476
#7 0x000055555559ec62 in chip::app::ReadSingleClusterData(chip::Access::SubjectDescriptor const&, bool, chip::app::ConcreteReadAttributePath const&, chip::app::AttributeReportIBs::Builder&, chip::app::AttributeValueEncoder::AttributeEncodeState*) (aSubjectDescriptor=..., aIsFabricFiltered=true, aPath=..., aAttributeReports=..., apEncoderState=0x7fffffffc3dc)
at ../../third_party/connectedhomeip/src/app/util/ember-compatibility-functions.cpp:579
#8 0x0000555555677d03 in chip::app::reporting::Engine::RetrieveClusterData(chip::Access::SubjectDescriptor const&, bool, chip::app::AttributeReportIBs::Builder&, chip::app::ConcreteReadAttributePath const&, chip::app::AttributeValueEncoder::AttributeEncodeState*)
(this=0x55555580d370 chip::app::sInteractionModelEngine+1200, aSubjectDescriptor=..., aIsFabricFiltered=true, aAttributeReportIBs=..., aPath=..., aEncoderState=0x7fffffffc3dc)
at ../../third_party/connectedhomeip/src/app/reporting/Engine.cpp:81
#9 0x000055555567810f in chip::app::reporting::Engine::BuildSingleReportDataAttributeReportIBs(chip::app::ReportDataMessage::Builder&, chip::app::ReadHandler*, bool*, bool*)
(this=0x55555580d370 chip::app::sInteractionModelEngine+1200, aReportDataBuilder=..., apReadHandler=0x555555865eb0, apHasMoreChunks=0x7fffffffc753, apHasEncodedData=0x7fffffffc751) at ../../third_party/connectedhomeip/src/app/reporting/Engine.cpp:179
#10 0x000055555567948c in chip::app::reporting::Engine::BuildAndSendSingleReportData(chip::app::ReadHandler*)
(this=0x55555580d370 chip::app::sInteractionModelEngine+1200, apReadHandler=0x555555865eb0) at ../../third_party/connectedhomeip/src/app/reporting/Engine.cpp:463
#11 0x0000555555679dc2 in chip::app::reporting::Engine::Run() (this=0x55555580d370 chip::app::sInteractionModelEngine+1200)
at ../../third_party/connectedhomeip/src/app/reporting/Engine.cpp:591
#12 0x0000555555679af8 in chip::app::reporting::Engine::Run(chip::System::Layer*, void*)
(aSystemLayer=0x55555580eac0 chip::DeviceLayer::SystemLayerImpl()::gSystemLayerImpl, apAppState=0x55555580d370 chip::app::sInteractionModelEngine+1200)
at ../../third_party/connectedhomeip/src/app/reporting/Engine.cpp:542
#13 0x000055555579b557 in chip::System::TimerData::Callback::Invoke() const (this=0x7fffffffcdd0) at ../../third_party/connectedhomeip/src/system/SystemTimer.h:61
#14 0x000055555579cb41 in chip::System::TimerPoolchip::System::TimerList::Node::Invoke(chip::System::TimerList::Node*)
(this=0x55555580f0c8 chip::DeviceLayer::SystemLayerImpl()::gSystemLayerImpl+1544, timer=0x555555886730) at ../../third_party/connectedhomeip/src/system/SystemTimer.h:224
#15 0x000055555579c76a in chip::System::LayerImplSelect::HandleEvents() (this=0x55555580eac0 chip::DeviceLayer::SystemLayerImpl()::gSystemLayerImpl)
at ../../third_party/connectedhomeip/src/system/SystemLayerImplSelect.cpp:397
#16 0x00005555556f7516 in chip::DeviceLayer::Internal::GenericPlatformManagerImpl_POSIXchip::DeviceLayer::PlatformManagerImpl::_RunEventLoop()
(this=0x55555580f630 chip::DeviceLayer::PlatformManagerImpl::sInstance+16)
at ../../third_party/connectedhomeip/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp:181
#17 0x000055555558f32a in chip::DeviceLayer::PlatformManager::RunEventLoop() (this=0x55555580f620 chip::DeviceLayer::PlatformManagerImpl::sInstance)
at ../../third_party/connectedhomeip/src/include/platform/PlatformManager.h:362
#18 0x000055555559176c in ChipLinuxAppMainLoop() () at ../../third_party/connectedhomeip/examples/platform/linux/AppMain.cpp:329
#19 0x000055555557d652 in main(int, char**) (argc=2, argv=0x7fffffffd0b8) at ../../main.cpp:30
The text was updated successfully, but these errors were encountered: