<div dir="ltr">Did the last 50 lines make it through? I still have a message &quot;awaiting moderator approval.&quot;<br><br>Thanks<br>Clifford<br><br><div class="gmail_quote">On Mon, Jul 28, 2008 at 6:44 PM, acv &lt;<a href="mailto:acv@miniguru.ca">acv@miniguru.ca</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I only need the last ~50 lines or so. The idea is to pinpoint the last thing<br>
the software did...<br>
<br>
Alex<br>
<br>
On Mon, Jul 28, 2008 at 06:41:31PM -0400, Clifford Thurber wrote:<br>
&gt; Date: Mon, 28 Jul 2008 18:41:31 -0400<br>
<div><div></div><div class="Wj3C7c">&gt; From: &quot;Clifford Thurber&quot; &lt;<a href="mailto:clifford@hdn.net">clifford@hdn.net</a>&gt;<br>
&gt; To: &quot;WiFiDog Captive Portal&quot; &lt;<a href="mailto:wifidog@listes.ilesansfil.org">wifidog@listes.ilesansfil.org</a>&gt;<br>
&gt; Subject: Re: [isf-wifidog] seg fault<br>
&gt;<br>
&gt; I think the output is getting rejected by the list server b/c the body is<br>
&gt; too big with all the debug output. Is there a work around?<br>
&gt;<br>
&gt; On Mon, Jul 28, 2008 at 6:32 PM, acv &lt;<a href="mailto:acv@miniguru.ca">acv@miniguru.ca</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Wifidog should run in the foreground. What&#39;s the output when you try<br>
&gt; &gt; with -d 7 ?<br>
&gt; &gt;<br>
&gt; &gt; Alex<br>
&gt; &gt;<br>
&gt; &gt; On Mon, Jul 28, 2008 at 06:23:29PM -0400, Clifford Thurber wrote:<br>
&gt; &gt; &gt; Date: Mon, 28 Jul 2008 18:23:29 -0400<br>
&gt; &gt; &gt; From: &quot;Clifford Thurber&quot; &lt;<a href="mailto:clifford@hdn.net">clifford@hdn.net</a>&gt;<br>
&gt; &gt; &gt; To: &quot;WiFiDog Captive Portal&quot; &lt;<a href="mailto:wifidog@listes.ilesansfil.org">wifidog@listes.ilesansfil.org</a>&gt;<br>
&gt; &gt; &gt; Subject: Re: [isf-wifidog] seg fault<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I made the changes you mentioned and when I run it in the foreground &nbsp;it<br>
&gt; &gt; &gt; seems to go just fine before eventually aborting. Will wifidog not run<br>
&gt; &gt; &gt; indefinitely in the foreground of a terminal? When I run it in the<br>
&gt; &gt; backround<br>
&gt; &gt; &gt; I see the following in syslog:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26746]: Reading configuration file<br>
&gt; &gt; &gt; &#39;/usr/local/etc/wifidog.conf&#39;<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26746]: Forking into background<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Setting started_time<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Creating web server on<br>
&gt; &gt; &gt; <a href="http://216.193.211.3:2060" target="_blank">216.193.211.3:2060</a><br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Removing Firewall rules<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Creating ICMP socket<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Initializing Firewall<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Waiting for connections<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: ONLINE status became ON<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Clearing the authservers list<br>
&gt; &gt; &gt; Jul 28 15:14:03 wifidog wifidog[26748]: Setting the authservers list<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; However I don&#39;t see any process called wifidog running and when I look<br>
&gt; &gt; for<br>
&gt; &gt; &gt; 2060 in netstat I don&#39;t see anything listening. I am confused.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks<br>
&gt; &gt; &gt; Clifford<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Mon, Jul 28, 2008 at 5:45 PM, Clifford Thurber &lt;<a href="mailto:clifford@hdn.net">clifford@hdn.net</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I am running:<br>
&gt; &gt; &gt; &gt; Fedora release 9 (Sulphur) on an Intel Xeon. I am going to try the fix<br>
&gt; &gt; you<br>
&gt; &gt; &gt; &gt; suggested right now.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Mon, Jul 28, 2008 at 5:20 PM, acv &lt;<a href="mailto:acv@miniguru.ca">acv@miniguru.ca</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; I&#39;ve reproduced the bug on Ubuntu 7.10 x86_64. The fix is trivial,<br>
&gt; &gt; &gt; &gt;&gt; util.c must include &lt;arpa/inet.h&gt;. Right now this only happens if<br>
&gt; &gt; &gt; &gt;&gt; __NetBSD__ is defined.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; I&#39;ve tested on Red Hat 7.3 (as a suitable substitute for antique<br>
&gt; &gt; &gt; &gt;&gt; Linux platform and as an i386 32-bit platform) and there it works<br>
&gt; &gt; &gt; &gt;&gt; regardless of whether &lt;arpa/inet.h&gt; is included. Although the man<br>
&gt; &gt; &gt; &gt;&gt; page says it&#39;s required.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; I don&#39;t have a 32-bit Ubuntu 7.10 to test whether 32-bit Linux as<br>
&gt; &gt; &gt; &gt;&gt; a whole is exempt from including that file. I&#39;ll commit the include<br>
&gt; &gt; &gt; &gt;&gt; to the SVN later today when I get home (hopefully I&#39;ll remember my<br>
&gt; &gt; &gt; &gt;&gt; password.) If someone else wants to check it in, go ahead.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Temporary fix:<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; In src/util.c, cut line 45 (#include &lt;arpa/inet.h&gt;) and paste it<br>
&gt; &gt; &gt; &gt;&gt; above line 44 (#if defined(__NetBSD__)).<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Cheers,<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Alex<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; On Mon, Jul 28, 2008 at 04:57:28PM -0400, acv wrote:<br>
&gt; &gt; &gt; &gt;&gt; &gt; Date: Mon, 28 Jul 2008 16:57:28 -0400<br>
&gt; &gt; &gt; &gt;&gt; &gt; From: acv &lt;<a href="mailto:acv@miniguru.ca">acv@miniguru.ca</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; To: WiFiDog Captive Portal &lt;<a href="mailto:wifidog@listes.ilesansfil.org">wifidog@listes.ilesansfil.org</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Mail-Followup-To: WiFiDog Captive Portal &lt;<br>
&gt; &gt; <a href="mailto:wifidog@listes.ilesansfil.org">wifidog@listes.ilesansfil.org</a><br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Subject: Re: [isf-wifidog] seg fault<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; On the surface, it looks like the bug is caused by inet_ntoa() not<br>
&gt; &gt; &gt; &gt;&gt; returning<br>
&gt; &gt; &gt; &gt;&gt; &gt; a null-terminated string, that&#39;s why strlen() segfaults, it goes<br>
&gt; &gt; beyond<br>
&gt; &gt; &gt; &gt;&gt; the<br>
&gt; &gt; &gt; &gt;&gt; &gt; end of the string. This could either be caused by inet_ntoa()<br>
&gt; &gt; failing or<br>
&gt; &gt; &gt; &gt;&gt; &gt; the ioctl() call failing or even the memcpy() bit just below.<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Code snippet (lines 176-185 from src/util.c):<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; 176 &nbsp; &nbsp; &nbsp; &nbsp;if (ioctl (sockd, SIOCGIFADDR, &amp;if_data) &lt; 0) {<br>
&gt; &gt; &gt; &gt;&gt; &gt; 177 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debug(LOG_ERR, &quot;ioctl(): SIOCGIFADDR %s&quot;,<br>
&gt; &gt; &gt; &gt;&gt; strerror(errno));<br>
&gt; &gt; &gt; &gt;&gt; &gt; 178 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return NULL;<br>
&gt; &gt; &gt; &gt;&gt; &gt; 179 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt; &gt; &gt; &gt;&gt; &gt; 180 &nbsp; &nbsp; &nbsp; &nbsp;memcpy ((void *) &amp;ip, (void *) &amp;if_data.ifr_addr.sa_data<br>
&gt; &gt; + 2,<br>
&gt; &gt; &gt; &gt;&gt; 4);<br>
&gt; &gt; &gt; &gt;&gt; &gt; 181 &nbsp; &nbsp; &nbsp; &nbsp;in.s_addr = ip;<br>
&gt; &gt; &gt; &gt;&gt; &gt; 182<br>
&gt; &gt; &gt; &gt;&gt; &gt; 183 &nbsp; &nbsp; &nbsp; &nbsp;ip_str = (char *)inet_ntoa(in);<br>
&gt; &gt; &gt; &gt;&gt; &gt; 184 &nbsp; &nbsp; &nbsp; &nbsp;close(sockd);<br>
&gt; &gt; &gt; &gt;&gt; &gt; 185 &nbsp; &nbsp; &nbsp; &nbsp;return safe_strdup(ip_str);<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; ioctl() errors are checked. Either the memcpy() call or its<br>
&gt; &gt; &gt; &gt;&gt; &gt; pointer arithmetics is off? sa_data in a sockaddr_in struct starts<br>
&gt; &gt; &gt; &gt;&gt; &gt; with a 16-bit value so the math looks OK. This stumps me right now,<br>
&gt; &gt; &gt; &gt;&gt; &gt; what&#39;s the distro? Ubuntu 7.10?<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; Alex<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; On Mon, Jul 28, 2008 at 04:15:08PM -0400, Clifford Thurber wrote:<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; Date: Mon, 28 Jul 2008 16:15:08 -0400<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; From: &quot;Clifford Thurber&quot; &lt;<a href="mailto:clifford@hdn.net">clifford@hdn.net</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; To: &quot;WiFiDog Captive Portal&quot; &lt;<a href="mailto:wifidog@listes.ilesansfil.org">wifidog@listes.ilesansfil.org</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; Subject: Re: [isf-wifidog] seg fault<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; [root@wifidog src]# ifconfig eth1<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; eth1 &nbsp; &nbsp; &nbsp;Link encap:Ethernet &nbsp;HWaddr 00:18:8B:2E:B1:A5<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:<a href="http://216.193.211.3" target="_blank">216.193.211.3</a> &nbsp;Bcast:<a href="http://216.193.211.255" target="_blank">216.193.211.255</a> &nbsp;Mask:<br>
&gt; &gt; &gt; &gt;&gt; <a href="http://255.255.255.0" target="_blank">255.255.255.0</a><br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UP BROADCAST RUNNING MULTICAST &nbsp;MTU:1500 &nbsp;Metric:1<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX packets:194391 errors:0 dropped:0 overruns:0 frame:0<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX packets:84 errors:0 dropped:0 overruns:0 carrier:0<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; collisions:0 txqueuelen:1000<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX bytes:12474968 (11.8 MiB) &nbsp;TX bytes:16381 (15.9 KiB)<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Interrupt:16 Memory:f8000000-f8012100<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; On Mon, Jul 28, 2008 at 4:11 PM, acv &lt;<a href="mailto:acv@miniguru.ca">acv@miniguru.ca</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; On Mon, Jul 28, 2008 at 03:43:14PM -0400, Clifford Thurber<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; Program received signal SIGSEGV, Segmentation fault.<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; 0x0000003ea6280eb0 in strlen () from /lib64/libc.so.6<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; Missing separate debuginfos, use: debuginfo-install<br>
&gt; &gt; glibc.x86_64<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; (gdb) bt<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; #0 &nbsp;0x0000003ea6280eb0 in strlen () from /lib64/libc.so.6<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; #1 &nbsp;0x0000003ea6280be6 in strdup () from /lib64/libc.so.6<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; #2 &nbsp;0x000000000040bfdc in safe_strdup ()<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; #3 &nbsp;0x0000000000409c64 in get_iface_ip ()<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; #4 &nbsp;0x000000000040720b in main_loop ()<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; #5 &nbsp;0x00000000004078a2 in main ()<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &gt; (gdb) exit<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; This is very strange. What&#39;s the output of ifconfig for<br>
&gt; &gt; that<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; interface?<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; Alex<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; WiFiDog mailing list<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; <a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; WiFiDog mailing list<br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; <a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; &gt; &gt;&gt; &gt; &gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; &gt;&gt; &gt; WiFiDog mailing list<br>
&gt; &gt; &gt; &gt;&gt; &gt; <a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; &gt; &gt;&gt; &gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; _______________________________________________<br>
&gt; &gt; &gt; &gt;&gt; WiFiDog mailing list<br>
&gt; &gt; &gt; &gt;&gt; <a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; &gt; &gt;&gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; WiFiDog mailing list<br>
&gt; &gt; &gt; <a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; &gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; WiFiDog mailing list<br>
&gt; &gt; <a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
&gt; &gt;<br>
<br>
&gt; _______________________________________________<br>
&gt; WiFiDog mailing list<br>
&gt; <a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
&gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
</div></div><br>_______________________________________________<br>
WiFiDog mailing list<br>
<a href="mailto:WiFiDog@listes.ilesansfil.org">WiFiDog@listes.ilesansfil.org</a><br>
<a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br></blockquote></div><br></div>