Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 58122
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Perl Devs @ Gentoo <perl@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: André Lemos <tux@tuxslare.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
log perl -V text/plain André Lemos 2004-07-25 11:26 0000 2.66 KB Details
spamd.pat (Test) patch against spamd patch Malte S. Stretz 2004-07-25 16:17 0000 833 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 58122 depends on: Show dependency tree
Bug 58122 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-07-23 14:28 0000
I'm starting to have this problem, when I try to start spamassassin
(/etc/init.d/spamd start), I get:

Could not create INET socket: Invalid argument IO::Socket::INET: Invalid
argument

The version of spamassassin is 2.63

------- Comment #1 From Malte S. Stretz 2004-07-24 10:49:29 0000 -------
Please post the output of the following five commands:
  cat /etc/conf.d/spamd
  spamd -D
  emerge -pv spamassassin
  perl -V
  id

------- Comment #2 From André Lemos 2004-07-25 11:25:21 0000 -------
<b>cat /etc/conf.d/spamd</b>
SPAMD_OPTS="-a"

<b>spamd -D</b>
debug: Score set 0 chosen.
Could not create INET socket: Invalid argument IO::Socket::INET: Invalid argument

<b>emerge -pv spamassassin</b>
[ebuild   R   ] mail-filter/spamassassin-2.63  +berkdb +ssl  0 kB

<b>id</b>
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video),250(portage)


(let's hope the b tags stick up) ;)

------- Comment #3 From André Lemos 2004-07-25 11:26:53 0000 -------
Created an attachment (id=36138) [details]
perl -V

------- Comment #4 From Malte S. Stretz 2004-07-25 16:17:13 0000 -------
Created an attachment (id=36150) [details]
(Test) patch against spamd

That looks like a local configuration problem. From
<http://ftp.cfu.net/pub/amavisd-new/>:
| On some operating systems the Perl module IO::Socket reports obscure error
| on unsuccessful connect() in non-blocking mode as: "Invalid argument" in
| place of the true cause: "Connection refused". The remote service should be
| checked if available and accessible (firewall rules? network problems?). 
|
| Another possible reason for "Invalid argument" reported by IO::Socket when
| running within chroot jail is some network-related system file missing in a
| chroot jail, e.g. /etc/protocols, /etc/services, /etc/netconfig, 
| /etc/resolv.conf, /etc/nsswitch.conf, /etc/hosts, /etc/host.conf
| -- depending on the operating system in use. System debugging tools
| (debugger, strace, truss) may help to find the cause. 

Please do the following:

1. What does the following command say? Should be 1.27.
     perl -MIO::Socket -le 'print $IO::Socket::INET::VERSION'


2. Please apply the attached patch with the following command (replace
"spamd.patch" with the name under which you saved the attachment):
      patch /usr/bin/spamd spamd.patch
You should get the following:
creating INET socket:
	Listen: 128
	LocalAddr: 127.0.0.1
	LocalPort: 783
	Proto: 6
	ReuseAddr: 1
	Type: 1
If you've got different values, something's wrong with your system but I can
hopefully find out what it is ;)

------- Comment #5 From André Lemos 2004-07-25 17:47:41 0000 -------
yes it is 1.27, and the patch gives me:

debug: Score set 0 chosen.
creating INET socket:
        Listen: 128
        LocalAddr: 127.0.0.1
        LocalPort: 783
        Proto: 6
        ReuseAddr: 1
        Type: 1
Could not create INET socket: Invalid argument IO::Socket::INET: Invalid argument

------- Comment #6 From Malte S. Stretz 2004-07-25 23:50:22 0000 -------
Hm, the last few days I learned more about the IO::Socket internals than I ever
wanted ;-)

This looks like some Perl bug, nothing really SpamAssassin related. Either the
call socket(AF_INET, SOCK_STREAM, 6) or sockopt(SO_REUSEPORT, 1) fails with an
EINVAL. Which shouldn't happen.

Just out of interested, could you please attach the output of 'strace spamd' so
I know which command exactly fails?

As a workaround, you could try to use spamd with UNIX sockets (which is also a
little bit faster than TCP). See --socketpath in the spamd manpage and -U for
spamc. Maybe re-emerging perl would help, too, but I doubt it.

------- Comment #7 From André Lemos 2004-07-26 01:05:40 0000 -------
read(5, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 1846
close(5)                                = 0
munmap(0x40018000, 4096)                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffff78c) = -1 EINVAL (Invalid argument)
_llseek(5, 0, 0xbffff7c0, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffff78c) = -1 EINVAL (Invalid argument)
_llseek(5, 0, 0xbffff7c0, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(5, {sa_family=0x3837 /* AF_??? */, sa_data="3\0\0\0\0\0\0\0\0\0001\306\1\0"}, 3) = -1 EINVAL (Invalid argument)
close(5)                                = 0
write(2, "Could not create INET socket: In"..., 82Could not create INET socket: Invalid argument IO::Socket::INET: Invalid argument

------- Comment #8 From Malte S. Stretz 2004-07-26 03:59:24 0000 -------
bind(5, {sa_family=0x3837 /* AF_??? */,
sa_data="3\0\0\0\0\0\0\0\0\0001\306\1\0"}, 3) = -1 EINVAL (Invalid argument)

This looks fishy and is the culprit. sa_family should be AF_INET, which is 2.
And addrlen (the third parameter) should be 16 instead of 3.

That command is called in the deep guts of Perl itself, your 'perl -V' output
looks good, I don't know why your Perl is so b0rked.

------- Comment #9 From André Lemos 2004-07-30 08:07:20 0000 -------
updating perl to the latest table on the stable tree did the trick (5.8.4)

------- Comment #10 From Malte S. Stretz 2004-07-30 08:20:25 0000 -------
Great. Thanks for helping debugging this stuff.

------- Comment #11 From Marc "Slyoldfox" Vanbrabant 2004-12-20 04:51:32 0000 -------
I seem to be getting this also now after emerging dev-lang/perl-5.8.5-r2, has
any of your done an upgrade to this version yet with spamassassin?

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug