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

Random segfault while all-clusters-app linux is doing nothing matter-related #19586

Open
cecille opened this issue Jun 14, 2022 · 3 comments
Open

Comments

@cecille
Copy link
Contributor

cecille commented Jun 14, 2022

Problem

bt:
116 ../sysdeps/x86_64/multiarch/strcmp-avx2.S: No such file or directory.
(gdb) bt
#0 __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:116
#1 0x00005555556f7c16 in chip::DeviceLayer::PlatformManagerImpl::WiFIIPChangeListener() () at ../../third_party/connectedhomeip/src/platform/Linux/PlatformManagerImpl.cpp:120
#2 0x00005555556f9759 in std::__invoke_impl<void, void ()()>(std::__invoke_other, void (&&)())
(__f=@0x555555858d98: 0x5555556f7a7c chip::DeviceLayer::PlatformManagerImpl::WiFIIPChangeListener()) at /usr/include/c++/11/bits/invoke.h:61
#3 0x00005555556f9711 in std::__invoke<void ()()>(void (&&)()) (__fn=@0x555555858d98: 0x5555556f7a7c chip::DeviceLayer::PlatformManagerImpl::WiFIIPChangeListener())
at /usr/include/c++/11/bits/invoke.h:96
#4 0x00005555556f96be in std::thread::_Invoker<std::tuple<void ()()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x555555858d98) at /usr/include/c++/11/bits/std_thread.h:253
#5 0x00005555556f9692 in std::thread::_Invoker<std::tuple<void (
)()> >::operator()() (this=0x555555858d98) at /usr/include/c++/11/bits/std_thread.h:260
#6 0x00005555556f9676 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() (this=0x555555858d90) at /usr/include/c++/11/bits/std_thread.h:211
#7 0x00007ffff779b9d3 in () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007ffff7f86d80 in start_thread (arg=0x7ffff5579640) at pthread_create.c:481
#9 0x00007ffff74a476f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Proposed Solution

no crash is better crash

@bzbarsky-apple
Copy link
Contributor

So the crashing line is this:

                        if (strcmp(name, ConnectivityManagerImpl::GetWiFiIfName()) != 0)

which suggests that either name is not null-terminated or ConnectivityManagerImpl::GetWiFiIfName() has some problem. And in particular, GetWiFiIfName() can absolutely return nullptr if sWiFiIfName is empty:

src/platform/Linux/ConnectivityManagerImpl.h:    static const char * GetWiFiIfName() { return (sWiFiIfName[0] == '\0') ? nullptr : sWiFiIfName; }

This code needs to either check for null, or change GetWiFiIfName to return a non-null empty string if that's what we have.

@stale
Copy link

stale bot commented Dec 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Dec 11, 2022
@bzbarsky-apple bzbarsky-apple removed the stale Stale issue or PR label Dec 17, 2022
@stale
Copy link

stale bot commented Jun 24, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Jun 24, 2023
@bzbarsky-apple bzbarsky-apple removed the stale Stale issue or PR label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants