You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2007/12/31 17:19:10 UTC

[Bug 5761] New: SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761

           Summary: SA 32x/r607737  'make test' failures (139/2082) on
                    FreeBSD
           Product: Spamassassin
           Version: 3.2.3
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Regression Tests
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: schneecrash+apache@gmail.com


hi,

building

	SA branches/3.2, r607737

in a FreeBSD jail,

	uname -a 
		FreeBSD jMAIL.internal.net 6.2-RELEASE-p9 FreeBSD 6.2-RELEASE-p9 #0: Fri Dec
21 13:28:48 PST 2007     sc@jMAIL.internal.net:/usr/obj/usr/src/sys/JAILHOST  amd64


using,

	setenv LDFLAGS   "-L/usr/local/lib"
	setenv CFLAGS    "-I/usr/local/include"
	setenv CPPFLAGS  $CFLAGS
	perl Makefile.PL \
	 PREFIX=/usr/local \
	 DATADIR=/usr/local/etc/SA/Dist \
	 CONFDIR=/usr/local/etc/SA/Local \
	 LOCALSTATEDIR=/usr/local/etc/SA/Updates \
	 ENABLE_SSL="yes" \
	 CONTACT_ADDRESS=""
	make install

build's OK, SA --lints fine, and all seesm to run well.

however, 'make test',

	/usr/local/bin/spamd \
	--local \
	--port=48373 \
	--listen-ip=10.0.0.200 \
	--nouser-config \
	--ipv4only \
	--daemonize \
	--configpath=/usr/local/etc/SA/Dist \
	--socketpath /var/run/spamd/spamd.sock \
	--socketowner spamd \
	--socketgroup spamd \
	--socketmode 0664

	setenv SPAMD_HOST "10.0.0.200"
	chown -R spamd .
	sudo -u spamd make test

fails (summary)

	Test Summary Report
	-------------------
	t/spamc_B.t                   (Wstat: 0 Tests: 9 Failed: 1)
	  Failed test number(s):  9
	t/spamc_c.t                   (Wstat: 0 Tests: 2 Failed: 1)
	  Failed test number(s):  1
	t/spamc_c_stdout_closed.t     (Wstat: 0 Tests: 2 Failed: 1)
	  Failed test number(s):  1
	t/spamc_E.t                   (Wstat: 0 Tests: 2 Failed: 1)
	  Failed test number(s):  2
	t/spamc_headers.t             (Wstat: 0 Tests: 5 Failed: 2)
	  Failed test number(s):  3-4
	t/spamc_optC.t                (Wstat: 0 Tests: 9 Failed: 4)
	  Failed test number(s):  2, 4, 6, 8
	t/spamc_optL.t                (Wstat: 0 Tests: 16 Failed: 16)
	  Failed test number(s):  1-16
	t/spamc_x_e.t                 (Wstat: 0 Tests: 7 Failed: 3)
	  Failed test number(s):  2-4
	t/spamc_x_E_R.t               (Wstat: 0 Tests: 49 Failed: 5)
	  Failed test number(s):  4-6, 8, 11
	t/spamc_z.t                   (Wstat: 0 Tests: 9 Failed: 5)
	  Failed test number(s):  4-5, 7-9
	t/spamd.t                     (Wstat: 0 Tests: 14 Failed: 7)
	  Failed test number(s):  5-6, 8-10, 12-13
	t/spamd_allow_user_rules.t    (Wstat: 0 Tests: 5 Failed: 1)
	  Failed test number(s):  4
	t/spamd_hup.t                 (Wstat: 0 Tests: 110 Failed: 10)
	  Failed test number(s):  11, 22, 33, 44, 55, 66, 77, 88, 99, 110
	t/spamd_kill_restart.t        (Wstat: 0 Tests: 93 Failed: 1)
	  Failed test number(s):  93
	t/spamd_kill_restart_rr.t     (Wstat: 0 Tests: 93 Failed: 1)
	  Failed test number(s):  93
	t/spamd_maxchildren.t         (Wstat: 0 Tests: 22 Failed: 10)
	  Failed test number(s):  3-7, 17-21
	t/spamd_parallel.t            (Wstat: 0 Tests: 20 Failed: 10)
	  Failed test number(s):  2-6, 16-20
	t/spamd_port.t                (Wstat: 0 Tests: 4 Failed: 2)
	  Failed test number(s):  3-4
	t/spamd_protocol_10.t         (Wstat: 0 Tests: 8 Failed: 6)
	  Failed test number(s):  2-4, 6-8
	  Parse errors: Bad plan.  You planned 10 tests but ran 8.
	t/spamd_report.t              (Wstat: 0 Tests: 6 Failed: 3)
	  Failed test number(s):  3-5
	t/spamd_report_ifspam.t       (Wstat: 0 Tests: 10 Failed: 3)
	  Failed test number(s):  3-5
	t/spamd_ssl.t                 (Wstat: 0 Tests: 9 Failed: 5)
	  Failed test number(s):  4-5, 7-9
	t/spamd_ssl_accept_fail.t     (Wstat: 0 Tests: 12 Failed: 5)
	  Failed test number(s):  7-8, 10-12
	t/spamd_ssl_tls.t             (Wstat: 0 Tests: 9 Failed: 5)
	  Failed test number(s):  4-5, 7-9
	t/spamd_ssl_v2.t              (Wstat: 0 Tests: 9 Failed: 5)
	  Failed test number(s):  4-5, 7-9
	t/spamd_ssl_v23.t             (Wstat: 0 Tests: 9 Failed: 5)
	  Failed test number(s):  4-5, 7-9
	t/spamd_ssl_v3.t              (Wstat: 0 Tests: 9 Failed: 5)
	  Failed test number(s):  4-5, 7-9
	t/spamd_stop.t                (Wstat: 0 Tests: 2 Failed: 1)
	  Failed test number(s):  2
	t/spamd_symbols.t             (Wstat: 0 Tests: 3 Failed: 2)
	  Failed test number(s):  2-3
	t/spamd_syslog.t              (Wstat: 0 Tests: 7 Failed: 5)
	  Failed test number(s):  3-7
	t/spamd_user_rules_leak.t     (Wstat: 0 Tests: 28 Failed: 6)
	  Failed test number(s):  3-6, 9, 20
	t/spamd_utf8.t                (Wstat: 0 Tests: 3 Failed: 2)
	  Failed test number(s):  2-3
	Files=144, Tests=2082, 930 wallclock secs ( 1.46 usr  1.81 sys + 407.12 cusr
109.15 csys = 519.55 CPU)
	Result: FAIL
	Failed 32/144 test programs. 139/2082 subtests failed.
	*** Error code 255

fwiw, the same results are obtained with/without the SPAMD_HOST var set.

verbose failed-test details are attached.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 15:31 -------
I think we need someone who knows more about networks and/or FreeBSD than I do.

What does the @ HOST and @ JAIL mean when you tried netstat -nr? Is there
anything about that which would make a tcp connection to 127.0.0.1 not go
through the loopback interface 127.0.0.1 -> 127.0.0.1?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2008-01-01 16:39 -------
> if i try this as "sudo -u spamd make test" -- since we're not supposed to
>run tests as root, right? -- it fails as before

Did you make as root? If you did, did you chown -R spamd . ?

Is it possible that /etc/sudoers contains

 Defaults        env_reset

That would prevent the SPAMD_HOST environment variable you set from being seen
inside the make test. One workaround would be to use visudo to edit the
/etc/sudoers file and insert

 Defaults        env_keep += "SPAMD_HOST"

somewhere after the env_reset line. Another workaround would be to
 sudo -u spamd sh
to get a shell as the spamd user and then set SPAMD_HOST and do the make test.

If none of the above helps, I would like to see the outputs with TEST_VERBOSE=1
when you get the errors from spamc_B.t to see how they are the same or different
from the results you got in response to comment #9




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 19:49 -------
I think I may have found what it is about jails that is causing the problem. I
did a bit of Googling about FreeBSD jails and I found this quote at
http://www.ascilite.org.au/ajet/ajet21/armitage.html

"A jail host does not completely replicate the environment of a regular FreeBSD
host. The limitations primarily relate to the jail host's networking and kernel
functionality. In FreeBSD 4.x these include:

    * Networking
    * A jail host has a single network interface and a single IP address
[...]
Some applications need fine tuning to handle the fact that localhost
(traditionally 127.0.0.1) is silently mapped to the jail host's actual IP
address. For example, the ssh daemon within each jail host must be told not to
use 'localhost' when setting up X11 forwarding back across inbound ssh connections"

And here the same thing is phrased a little differently, explaining how spamc
can reach spamd at ip address 127.0.0.1 but have it look like it is coming from
10.0.0.200, and how traceroute 127.0.0.1 seems to work when there really is no
127.0.0.1, from "Maximising Student Exposure to Unix Networking using FreeBSD
Virtual Hosts" http://caia.swin.edu.au/reports/030320A/CAIA-TR-030320A.pdf

"The localhost address of 127.0.0.1 is silently
mapped to the jail's real IP address"

In other words, it is not the host name 'localhost' that is silently mapped, as
implied by the first quote, but the ip address 127.0.0.1 itself is mapped to the
real ip address. So when make test runs spamd and spamc using 127.0.0.1,
everything works except that spamd sees the connection coming in from the jail's
ip address which is not authorized in the spamd command line (option -A).

As far as I can tell the only thing that is affected would be the spamc and
apamd tests that are using 127.0.0.1. If you install spamassassin and run spamd
using -i 10.0.0.200 -A 10.0.0.200 and run spamc using -d 10.0.0.200 then it
should run ok. I don't see a way to get make test to work in that environment.





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 11:10 -------
(In reply to comment #2)
> I started up spamd using the simpler command line
> 
> spamd --local --port=48373 --listen 192.168.0.2  --ipv4only --daemonize
>
> so there is no question about the --nouser-config or what user it is
> running as or combining listening on a unix socket and tcp port.

ah.  i'd done this cuz t/README sez:

"If SPAMD_HOST is set, you must ensure that the spamd daemon is
running before you run make test, and stop it afterwards. The spamd
daemon must run with options that include

  spamd -L -x -p 48373

The last parameter is the port on which spamd will be listening. If
you specify a different port number set the environment variable
SPAMD_PORT in the environment of the make test to be the same number."


what i missed was that it was in section titled:

 "Testing on Windows or with spamd running on another system"




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2008-01-01 19:03 -------
(In reply to comment #32)
> Did you make as root?

nor originally; originally, as spamd.

but most recently, yes.

> If you did, did you chown -R spamd . ?

normally, when following my build notes, i always do. maybe i skipped while i
was 'messing around' ... 

> Is it possible that /etc/sudoers contains
> 
>  Defaults        env_reset

checked ... there's neither a 

 Defaults        env_reset

nor a,

 Defaults        env_keep += " ... "

defined.

rather than monkeying with the sudoers file, which -- esp in a jail -- i'd
rather keep as simple as possible,  i:

   cd /usr/local/build/spamassassin/
   chown -R spamd .                      <-- made sure, this time
   sudo -u spamd tcsh
   setenv SPAMD_HOST 10.0.0.200
   make test

and, voila!

so, clearly, my own fault.

  All tests successful.
Files=144, Tests=2084, 986 wallclock secs ( 1.44 usr  2.90 sys + 406.88 cusr
129.63 csys = 540.85 CPU)
  Result: PASS

bottom line, tests -- run as !root -- & pass 100% in the jail now.

thanks!




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2008-01-01 00:36 -------
Created an attachment (id=4225)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4225&action=view)
Patch against 3.2 branch to try out to see if solves problem

Guess what, it looks like a bug in the tests after all!

Here is a patch to try out. Apply the patch, set SPAMD_HOST to 10.0.0.200, but
_do not_ start up a separate spamd instance yourself. So just apply this patch,
set SPAMD_HOST and try your make test.

This isn't a final fix, but if it works for you it means we know what is going
on. The problem is that SPAMD_HOST was intended for an external spamd running
on another machine, such as you would have to have under Windows where spamd
doesn't run. However, if not running under Windows, when SPAMD_HOST is set the
spam[cd]*.t tests run their instances of spamd set to accept conections from
SPAMD_HOST and then run spamc connecting to SPAMD_HOST. That doesn't really
make sense and should be changed.

The strange thing is that as a result if you set SPAMD_HOST to an ip address of
the local machine and don't start up another spamd, everything is almost right
for running the spamc/spamd tests using the ip address $SPAMD_HOST instead of
127.0.0.1. There were just two things missing from that scenario, spamd was
started without the -i option, and one place in one test
(t/spamd_protocol_10.t) had a hardcoded 127.0.0.1 in it.

This patch changes those two lines and allows SPAMD_HOST to indicate a local ip
address other than 127.0.0.1 for the tests to use.

If this works I'll think a bit about a more correct fix.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 12:45 -------
Whoops. That would be a strange coincidence, because the errors are just what
you would expect trying to run the test with SPAMD_HOST set.

Can you verify the results after checking your environment to make sure
SPAMD_HOST is not set, starting from make clean and perl Makefile.PL again and
then doing just a simple

 make
 make test

without anything else fancy?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 15:12 -------
(In reply to comment #18)
> What do you see from the command
> 
>  netstat -nr
> 
> especially for 127.0.01, is there a line beginning with
> 
> 127.0.0.1     127.0.0.1
> 
> or anything else with 127.0.0.1 in the gateway column?

@ HOST:
netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            10.0.0.100         UGS         0   105644   nve0
127.0.0.1          127.0.0.1          UH          0     1132    lo0
10.0.0/24          link#2             UC          0        0   nve0
10.0.0.100         00:00:46:b3:11:c4  UHLW        2     3963   nve0   1183
10.0.0.6           00:0d:92:9b:bc:52  UHLW        1   217298   nve0    967
10.0.0.200         00:1d:33:a2:d6:fa  UHLW        1   410178    lo0 =>
10.0.0.200/32      link#2             UC          0        0   nve0

Internet6:
Destination                       Gateway                       Flags      Netif
Expire
::1                               ::1                           UHL         lo0
fe80::%lo0/64                     fe80::1%lo0                   U           lo0
fe80::1%lo0                       link#3                        UHL         lo0
ff01:3::/32                       fe80::1%lo0                   UC          lo0
ff02::%lo0/32                     fe80::1%lo0                   UC          lo0

not surprisingly, @ JAIL:
netstat -nr
 netstat: kvm not available
 Routing tables
 rt_tables: symbol not in namelist




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 13:39 -------
Created an attachment (id=4224)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4224&action=view)
spamd.err.1.txt




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 20:26 -------
(In reply to comment #25)

your google-fu in this matter is far superior to mine!

thanks for the refs.

> As far as I can tell the only thing that is affected would be the spamc and
> apamd tests that are using 127.0.0.1. If you install spamassassin and run spamd
> using -i 10.0.0.200 -A 10.0.0.200 and run spamc using -d 10.0.0.200 then it
> should run ok.

that in itself is useful info.

> I don't see a way to get make test to work in that environment.

fair enuf.

are you, though, suggesting that it shouldn't be bothered with?

if so, i'd argue that spamd ( & everything mail-y ) in a jail &/or vm will be an
increasingly frequent use-case ... along with the attempts @ running 'make
test'.  as such, it may well be worth hammering this out.

i'll be happy to be guinea-pig -- henceforth, though, on fbsd/jail rather than
osx ... 



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2008-01-01 23:21 -------
(In reply to comment #34)
> Great! It looks like you are set, we know what has to be done to fix this
> correctly, and it can wait for the next release. I'll target this for 3.2.5 so 
> I don't forget to deal with it soon.
> 
> Thanks for all the work trying things out.


Thanks much!  I'm 'done' with this then ... I'll leave it open, and in your hands.

Cheers!





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 18:37 -------
Ok, so if I understand it correctly you are trying to install spamassassin on
JAIL, that's where make test fails, and you can't run netstat -nr on that
machine so we still don't know if there is something funky with the routing to
127.0.0.1 there. Is there anything besides netstat that you can run on JAIL to
see what the route is to 127.0.0.1? Perhaps traceroute 127.0.0.1 would do it?

Are there any lines in /etc/rc.conf on JAIL that say anything about 127.0.0.1?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 15:45 -------
(In reply to comment #20)
> I think we need someone who knows more about networks and/or FreeBSD than I do.
> 
> What does the @ HOST and @ JAIL mean when you tried netstat -nr? Is there
> anything about that which would make a tcp connection to 127.0.0.1 not go
> through the loopback interface 127.0.0.1 -> 127.0.0.1?

sorry, i should be careful not to presume; those are just my comments from my
notes -- not cmds i typed, or output from netstat.

the info following "@HOST" is simply that from 'netstat -nr' typed into a shell
window logged into the HOST machine (@ 10.0.0.100), whereas, similarly,

the info following "@JAIL" is from 'netstat -nr' typed into a shell window
logged into the JAIL machine (@ 10.0.0.200), within which jail'd env spamd runs
fine.





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 19:20 -------
it may (?) also be worth noting that freebsd jails, unlike full VM
implementations, do NOT (currently) have separate networking stacks from the host.

that's being, at least, wished-for
(http://article.gmane.org/gmane.os.freebsd.questions/213123), if not developed ...

could that have bearing on 'this'?  yes, i'm scrounging around ....



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From jm@jmason.org  2007-12-31 11:54 -------
(In reply to comment #5)
> Ok, I'll close this bug. It does look like there is some bit rot and/or missing
> documentation in t/README related to trying to run the regression tests with
> SPAMD_HOST set, but your specific case is more user error, as you did not need
> to set SPAMD_HOST and start up spamd at all.
> 
> I do see that SPAMD_PORT has to be set explicitly if SPAMD_HOST is set because
> not all the tests will use port 43783 as default the way they used to. Also ,
> there is no mention of starting the external spamd with the -A option to accept
> connections from the ip address of the system running the make test. And
> --nouser-config is needed to run this. That all makes more of the tests work but
> not all of them. This could use some cleanup and someone should verify that
> tests that are supposed to work this way do still work under Windows, but I'm
> going to close this bug for now.

should the bug be closed?  as far as I can see the first comment notes that
the test fails with AND without SPAMD_HOST set.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2008-02-11 05:48 -------
Snowcrash, could you please revert the test patch attachment 4335, install the
patch in attachment 4260 and confirm that you can then make test in FreeBSD jail
by using

   make test SPAMD_LOCALHOST=10.0.0.200

If that works I'll commit the change to 3.2 branch




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 08:20 -------
Created an attachment (id=4222)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4222&action=view)
verbose output of 'make test' for failed tests




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From jm@jmason.org  2008-01-01 03:50 -------

> I think it's safe to say that we can target it for a later release.

+1



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 13:41 -------
doing,

  sh /usr/local/etc/rc.d/sa-spamd.sh stop

  cd /usr/local/build/spamassassin


  # clean house
  pkg_delete bsdpan-Mail-SpamAssassin\* p5-Mail-SpamAssassin\*
  unsetenv CFLAGS CPPFLAGS CXX CXXFLAGS LDFLAGS LDDLFLAGS LIBS LD_PREBIND \
		   EXTRA_LDFLAGS EXTRA_LIBS ACLOCAL AUTOHEADER AUTOMAKE AUTOCONF
  unsetenv SPAMD_HOST
  
  
  setenv LDFLAGS   "-L/usr/local/lib"
  setenv CFLAGS    "-I/usr/local/include"
  setenv CPPFLAGS  $CFLAGS
  
  cd /usr/local/build/spamassassin
  perl Makefile.PL \
   PREFIX=/usr/local \
   DATADIR=/usr/local/etc/SA/Dist \
   CONFDIR=/usr/local/etc/SA/Local \
   LOCALSTATEDIR=/usr/local/etc/SA/Updates \
   ENABLE_SSL="yes" \
   CONTACT_ADDRESS=""
  
  make

  sh /usr/local/etc/rc.d/sa-spamd.sh start
  make test TEST_VERBOSE=1 TEST_FILES="t/spamc_B.t"
  ...
  echo $SPAMD_HOST
    SPAMD_HOST: Undefined variable.


attachments 

 spam_b_verbose.txt
 spamd.err.1.txt

contain requested verbose and log output.

hm ... in spamd.err.1.txt, at 1st glance i wonder abt:

[89310] warn: spamd: unauthorized connection from jMAIL.internal.net
[10.0.0.200] at port 50185 at ../spamd/spamd.raw line 1211.






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From sidney@sidney.com  2007-12-31 11:43 -------
Ok, I'll close this bug. It does look like there is some bit rot and/or missing
documentation in t/README related to trying to run the regression tests with
SPAMD_HOST set, but your specific case is more user error, as you did not need
to set SPAMD_HOST and start up spamd at all.

I do see that SPAMD_PORT has to be set explicitly if SPAMD_HOST is set because
not all the tests will use port 43783 as default the way they used to. Also ,
there is no mention of starting the external spamd with the -A option to accept
connections from the ip address of the system running the make test. And
--nouser-config is needed to run this. That all makes more of the tests work but
not all of them. This could use some cleanup and someone should verify that
tests that are supposed to work this way do still work under Windows, but I'm
going to close this bug for now.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|Undefined                   |3.2.5




------- Additional Comments From sidney@sidney.com  2008-01-01 21:27 -------
Great! It looks like you are set, we know what has to be done to fix this
correctly, and it can wait for the next release. I'll target this for 3.2.5 so I
don't forget to deal with it soon.

Thanks for all the work trying things out.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From lwilton@earthlink.net  2007-12-31 14:11 -------
What's the actual IP on the host machine?  10.0.0.200 maybe?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 14:26 -------
(In reply to comment #15)
> What's the actual IP on the host machine?  10.0.0.200 maybe?
 
yup. from HOST's rc.conf,

...
defaultrouter="10.0.0.100"
ifconfig_nve0="inet 10.0.0.100 netmask 255.255.255.0"          # main
ifconfig_nve0_alias0="inet 10.0.0.200 netmask 255.255.255.255" # jMAIL
...
jail_MAIL_hostname="jMAIL.internal.net"
jail_MAIL_ip="10.0.0.200"
...



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2008-02-09 16:27 -------
there is a typo in comment #36 in the example which should be

make test SPAMD_LOCALHOST=10.1.2.3





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 11:04 -------
Running spamd without --daemonize and with -D it appears that the make test
never calls it.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 13:38 -------
Created an attachment (id=4223)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4223&action=view)
spam_b_verbose.txt




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|SA 32x/r607737  'make test' |spamc/spamd 'make test'
                   |failures (139/2082) on      |failures in FreeBSD jail
                   |FreeBSD                     |




------- Additional Comments From sidney@sidney.com  2008-01-01 03:58 -------
Changed summary to more accurately describe the problem now that it has been
analyzed.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 13:59 -------
> 89310] warn: spamd: unauthorized connection from jMAIL.internal.net
> [10.0.0.200] at port 50185 at ../spamd/spamd.raw line 1211.

That explains the errors, but not why it is happening.

It means that when spamc is being run, it talks to spamd on 127.0.0.1 but spamd
sees the connection coming in from 10.0.0.200 which is not authorized because
the tests are being run only on 127.0.0.1 and no other ip address has to be
authorized.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 14:18 -------
I would guess from everything else here that 10.0.0.200 is the machine's ip
address, but how does a tcp socket opened up to 127.0.0.1 get seen as coming
from the other interface?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 19:08 -------
(In reply to comment #22)
> Ok, so if I understand it correctly 

if you DO, please fill ME in, cuz, networking between-n-betwixt fbsd jails seems
to be ~ 33% voudou :-/  at least, available info/expertise is a bit sparse ...

> you are trying to install spamassassin on
> JAIL, that's where make test fails, and you can't run netstat -nr on that
> machine so we still don't know if there is something funky with the routing to
> 127.0.0.1 there. Is there anything besides netstat that you can run on JAIL to
> see what the route is to 127.0.0.1? Perhaps traceroute 127.0.0.1 would do it?

well, fwiw, @JAIL

traceroute 127.0.0.1
  traceroute to 127.0.0.1 (127.0.0.1), 64 hops max, 52 byte packets
    1  localhost (127.0.0.1)  0.270 ms  0.093 ms  0.103 ms

is that what you're looking for?

> Are there any lines in /etc/rc.conf on JAIL that say anything about 127.0.0.1?

alas, nope

  egrep "127|localhost" /etc/rc.conf
    (empty)

just in case, again note that spamd runs/operates in the jail ... just the tests
are failing.

also, googl'ing on routing/jails/freebsd, i note, e.g., @

  http://www.securitytracker.com/alerts/2004/Jun/1010412.html

"A vulnerability was reported in jail(2) in the FreeBSD kernel. Jailed processes
may be able to modify host routing tables." 

This reminds me that jailed procs should not, of course, mod the router tables.

Now, my naive question is ... are the tests, in spawning, or attempting to
spawn, new proces withing the jail, attemptin -- and failing -- to make such
router table mods?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 23:49 -------
> are you, though, suggesting that it shouldn't be bothered with?

No, I wasn't suggesting that and I have been thinking about how to deal with it.
You reported this at an interesting time, just as I closed the last bug in the
queue for the 3.2.4 release, so I have been very keen on determining as quickly
as possible if this bug was going to be serious enough to hold up the release.

I think it's safe to say that we can target it for a later release.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2008-02-09 16:24 -------
Created an attachment (id=4260)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4260&action=view)
Fix, adding SPAMD_LOCALHOST option for use in FreeBSD jail

The attaced patch is now committed to trunk. With this change, SPAMD_HOST
should only be set to indicate the ip address of an external spamd server, and
will suppress any attempt to run spamd locally during tests. A new option
SPAMD_LOCALHOST should be set to the ip address to use instead of 127.0.0.1 for
local testing, as would be necessary for running under FreeBSD jail. So, to
test whle in jail, use

  make test SPAMD_LOCAL_HOST=10.1.2.3

where you use your own ip address where I said "10.1.2.3"

I think this can be committed to 3.2 branch without review, since it only
patches t/SATest.pm and t/spamd_protocol_10.t, but I'm running off to a
conference right now and don't want to commit to branch in a rush with nobody
having looked at it. So please check this out and comment if needed.

Committed to trunk revision 620225




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From schneecrash+apache@gmail.com  2008-01-01 10:54 -------
progress, i think!

co r607876
apply patch @
<http://issues.apache.org/SpamAssassin/attachment.cgi?id=4225&action=view>

config/make/install as before

kill any existing SPAMd

	/usr/local/etc/rc.d/sa-spamd.sh  stop
	ps ax | grep spam               86475  p4  R+J    0:00.00 grep spam
		(empty)

	setenv SPAMD_HOST "10.0.0.200"
	whoami
		root

(if i try this as "sudo -u spamd make test" -- since we're not supposed to run
tests as root, right? -- it fails as before. perms or code, i dunno.)

	make test

now succeeds with,

	All tests successful.
	Files=144, Tests=2078, 936 wallclock secs ( 0.81 usr  3.46 sys + 384.21 cusr
114.23 csys = 502.71 CPU)
	Result: PASS

checking in detail just,

	make test TEST_VERBOSE=1 TEST_FILES="t/spamc_B.t"

we see,

	/usr/local/bin/perl build/mkrules --exit_on_no_src --src rulesrc --out rules
--manifest MANIFEST --manifestskip MANIFEST.SKIP
	mkrules: no rules updated
	/usr/local/bin/perl build/preprocessor  -Mvars  -DVERSION="3.002004" 
-DPREFIX="/usr/local"  -DDEF_RULES_DIR="/usr/local/etc/SA/Dist" 
-DLOCAL_RULES_DIR="/usr/local/etc/SA/Local" 
-DLOCAL_STATE_DIR="/usr/local/etc/SA/Updates" 
-DINSTALLSITELIB="/usr/local/lib/perl5/site_perl/5.8.8"  -DCONTACT_ADDRESS=""
-Msharpbang  -Mconditional  -DPERL_BIN="/usr/local/bin/perl"  -DPERL_WARN="" 
-DPERL_TAINT="" -m755 -isa-update.raw -osa-update
	cp sa-update blib/script/sa-update
	/usr/local/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/sa-update
	PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(1, 'blib/lib', 'blib/arch')" t/spamc_B.t
	t/spamc_B......
	1..9
	# Running under perl version 5.008008 for freebsd
	# Current time local: Tue Jan  1 10:49:19 2008
	# Current time GMT:   Tue Jan  1 18:49:19 2008
	# Using Test.pm version 1.25
		/usr/local/bin/perl SATest.pl -Mredirect -Olog/d.spamc_B/spamd.err.1
-olog/d.spamc_B/spamd.out.1 -- /usr/local/bin/perl -T -w ../spamd/spamd.raw -D
-x -s stderr -C log/test_rules_copy  --siteconfigpath log/localrules.tmp -p
41083 -A 10.0.0.200 -i 10.0.0.200 -L -s log/d.spamc_B/spamd.err.1.timestamped &
		../spamc/spamc -F data/spamc_blank.cf -d 10.0.0.200 -p 41083 -B <
data/spam/bsmtpnull
	ok 1
		../spamc/spamc -F data/spamc_blank.cf -d 10.0.0.200 -p 41083 -B < data/spam/bsmtp
	ok 2
		Checking data
	ok 3
		Checking helo
	ok 4
		Checking status
	ok 5
		Checking mailfrom
	ok 6
		Checking quit
	ok 7
		Checking rcptto
	ok 8
		Checking spamflag
	ok 9
	Killed 1 spamd instances
	Waiting for spamd at pid 8500 to exit...
	ok
	All tests successful.
	Files=1, Tests=9,  8 wallclock secs ( 0.05 usr  0.00 sys +  0.31 cusr  0.60
csys =  0.96 CPU)
	Result: PASS





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 14:48 -------
What do you see from the command

 netstat -nr

especially for 127.0.01, is there a line beginning with

127.0.0.1     127.0.0.1

or anything else with 127.0.0.1 in the gateway column?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 10:50 -------
I can confirm this in branch 3.2 current svn, simplifying the test case a little
bit. I'm using MacOS X 10.5. I haven't tried this on a non-BSD system, but I
suspect that doesn't matter. A simple make, then make test does work ok. I did a
sudo make install, so the problem is not the --configpath of the spamd command
line not matching what is being tested. I started up spamd using the simpler
command line

spamd --local --port=48373 --listen 192.168.0.2  --ipv4only --daemonize

so there is no question about the --nouser-config or what user it is running as
or combining listening on a unix socket and tcp port.

and then

 export SPAMD_HOST=192.168.0.2

which is the local ip address of my computer.

make test (not using sudo -u) then failed in what appears to be the same way as
reported here.

I suspect that we have not made sure that the spamc*.t and spamd*.t tests all
work properly when using an external spamd on SPAMD_HOST. This might just turn
out to be a problem that some tests have to be skipped when using an external
spamd because the tests assume some control over spamd that it doesn't have in
that case.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] [review] spamc/spamd 'make test' failures in FreeBSD jail

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|spamc/spamd 'make test'     |[review] spamc/spamd 'make
                   |failures in FreeBSD jail    |test' failures in FreeBSD
                   |                            |jail
  Status Whiteboard|                            |waiting for someone to test
                   |                            |in FreeBSD jail






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 14:03 -------
This is the spamc command line from the log,

../spamc/spamc -F data/spamc_blank.cf -d 127.0.0.1 -p 56660 -B < data/spam/bsmtp

Does anyone have any idea how a client call like that could open a socket to
talk to 127.0.0.1 port 56660 and have the server see it coming in from 10.0.0.200?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761





------- Additional Comments From sidney@sidney.com  2007-12-31 13:12 -------
Looking at the verbose output you attached, the result for spamc_B.t has

# Using Test.pm version 1.25
	/usr/local/bin/perl SATest.pl -Mredirect -Olog/d.spamc_B/spamd.err.1
-olog/d.spamc_B/spamd.out.1 -- /usr/local/bin/perl -T -w ../spamd/spamd.raw -D
-x -s stderr -C log/test_rules_copy  --siteconfigpath log/localrules.tmp -p
46460 -A 127.0.0.1 -L -s log/d.spamc_B/spamd.err.1.timestamped &
	../spamc/spamc -F data/spamc_blank.cf -d 127.0.0.1 -p 46460 -B <
data/spam/bsmtpnull

which certainly looks like SPAMD_HOST is not set but results in the same error
output as if it was.

Let's concentrate for now on just the spamc_B.t test. Could you run that and
then attach the t/log/d.spamc_B/spamd.err.1 file as well as the verbose output?




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 5761] SA 32x/r607737 'make test' failures (139/2082) on FreeBSD

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5761


schneecrash+apache@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Additional Comments From schneecrash+apache@gmail.com  2007-12-31 12:19 -------
who? what? where?

i certainly didn't intend for my comment to suggest that i'm NOT getting these
errors.

justin's right ... i get them in any/all cases, w/ or w/o the ENV vars set.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.