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 when using netwok manager #294

Open
Kasper24 opened this issue May 13, 2022 · 1 comment
Open

Segmentation fault when using netwok manager #294

Kasper24 opened this issue May 13, 2022 · 1 comment

Comments

@Kasper24
Copy link

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ffff7fb2266 in lgi_object_2c () from /usr/lib/lua/5.3/lgi/corelgilua51.so


#0  0x00007ffff7fb2266 in lgi_object_2c () at /usr/lib/lua/5.3/lgi/corelgilua51.so
#1  0x00007ffff7fb4792 in lgi_marshal_2c () at /usr/lib/lua/5.3/lgi/corelgilua51.so
#2  0x00007ffff7fb638c in  () at /usr/lib/lua/5.3/lgi/corelgilua51.so
#3  0x00007ffff7fb465d in lgi_marshal_2c () at /usr/lib/lua/5.3/lgi/corelgilua51.so
#4  0x00007ffff7fb4d17 in  () at /usr/lib/lua/5.3/lgi/corelgilua51.so
#5  0x00007ffff7fb5166 in  () at /usr/lib/lua/5.3/lgi/corelgilua51.so
#6  0x00007ffff792ffff in  () at /usr/lib/liblua5.3.so.5.3
#7  0x00007ffff793d72d in  () at /usr/lib/liblua5.3.so.5.3
#8  0x00007ffff79303b8 in  () at /usr/lib/liblua5.3.so.5.3
#9  0x00007ffff792f710 in  () at /usr/lib/liblua5.3.so.5.3
#10 0x00007ffff793073b in  () at /usr/lib/liblua5.3.so.5.3
#11 0x00007ffff792b91a in lua_pcallk () at /usr/lib/liblua5.3.so.5.3
#12 0x00007ffff7fb5927 in  () at /usr/lib/lua/5.3/lgi/corelgilua51.so
#13 0x00007ffff738e0fb in  () at /usr/lib/libffi.so.8
#14 0x00007ffff738e758 in  () at /usr/lib/libffi.so.8
#15 0x00007ffff75855f4 in  () at /usr/lib/libgio-2.0.so.0
#16 0x00007ffff758562d in  () at /usr/lib/libgio-2.0.so.0
#17 0x00007ffff7ddb163 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#18 0x00007ffff7e319e9 in  () at /usr/lib/libglib-2.0.so.0
#19 0x00007ffff7dda6a3 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#20 0x0000555555568ecb in main ()

Snippest:

for _, device in ipairs(devices) do
   if device:get_device_type() == "WIFI" then
        device.on_state_changed = function(device)
           local state = device:get_state()
           local state_reason = device:get_state_reason()

          if (state == "UNAVAILABLE" or state == "FAILED" or state == "DEACTIVATING")
             and state_reason ~= "NEW_ACTIVATION" then
             self:emit_signal("wireless_state", false)
          elseif state ==  "DISCONNECTED" and state_reason ~= "NEW_ACTIVATION" then
             gtimer { timeout = 5, autostart = true, call_now = false, single_shot = true, callback = function()
                self:scan_access_points()
             end }
          elseif state == "ACTIVATED" then
              local active_access_point = device:get_active_access_point()
              self:scan_access_points()
              self:emit_signal("wireless_state", true, ssid_to_utf8(active_access_point))
          end
   end
end
@ntd
Copy link
Contributor

ntd commented May 18, 2022

It would help a lot if you condense this monster into the one-liner that triggers the crash. A link to the API documentation would have avoided a lot of guesswork too. Having something that can be run would also be appreciated.

From a quick look, I can see at least the folling issues:

  • the on_state_changed signal has a lot more than the device parameter
  • get_state_reason returns the state and the reason, not only the latter
  • the selfvariable is not assigned
  • I did not find the wireless_state signal anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants