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

beta10 segfaults on start with default config #83

Closed
nekopsykose opened this issue Mar 25, 2023 · 2 comments
Closed

beta10 segfaults on start with default config #83

nekopsykose opened this issue Mar 25, 2023 · 2 comments

Comments

@nekopsykose
Copy link

hi,

when running the latest version of sfwbar, it segfaults with the following:

(lldb) target create "sfwbar"
Current executable set to '/usr/bin/sfwbar' (x86_64).
(lldb) r
Process 4804 launched: '/usr/bin/sfwbar' (x86_64)86_64.so.1...
Process 4804 stopped
* thread #1, name = 'sfwbar', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x00007fffe4d0767b network.so`net_set_interface [inlined] net_update_ifaddrs at network.c:76:26
   73  	 if(getifaddrs(&addrs) >= 0) {
   74  	   for(iter=addrs;iter;iter=iter->ifa_next)
   75  	   {
-> 76  	     iface = net_iface_from_name(iter->ifa_name,TRUE);
   77  	     switch(iter->ifa_addr->sa_family)
   78  	     {
   79  	       case AF_INET:
(lldb) fr v
(ifaddrs *) addrs = 0x00007fffe5d8b7d0
(ifaddrs *) iter = 0x00007fffe5d95050
(iface_info *) iface = 0x00007fffe5e252d0
(lldb) print *addrs
(ifaddrs) $0 = {
  ifa_next = 0x00007fffe5d8f790
  ifa_name = 0x00007fffe5d8b880 "lo"
  ifa_flags = 65609
  ifa_addr = 0x00007fffe5d8b810
  ifa_netmask = NULL
  ifa_ifu = {
    ifu_broadaddr = 0x00007fffe5d8b858
    ifu_dstaddr = 0x00007fffe5d8b858
  }
  ifa_data = 0x00007fffe5d8b898
}
(lldb) print *iter
(ifaddrs) $1 = {
  ifa_next = 0x00007fffe5d95a50
  ifa_name = 0x00007fffe5d95100 "wg-alpine"
  ifa_flags = 65745
  ifa_addr = NULL
  ifa_netmask = NULL
  ifa_ifu = {
    ifu_broadaddr = NULL
    ifu_dstaddr = NULL
  }
  ifa_data = 0x00007fffe5d95118
}

presumably, some error paths aren't handled in the networking code. (e.g., getifaddrs can fail but that isn't handled (though that is not this error here), ..)

@LBCrion
Copy link
Owner

LBCrion commented Mar 25, 2023

This should be fixed in 47c37b4. Would you mind trying the current git version and see if it still happens?

@nekopsykose
Copy link
Author

fixed indeed. thanks :)

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