mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: A few issues on MIPS and now on ARMEL
@ 2012-11-15 22:21 Paul Schutte
  2012-11-15 23:37 ` Rich Felker
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Schutte @ 2012-11-15 22:21 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

Hi guys,

I am now hitting a similar problem on armel.

I am cross-compiling "dnsmasq"

Glibc strace:

---snip---
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0


Musl strace:

socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(5, SOL_SOCKET, *0xf /* SO_??? */*, [1], 4) = -1 ENOPROTOOPT
(Protocol not available)

Regards
Paul

On Mon, Nov 5, 2012 at 7:31 PM, Rich Felker <dalias@aerifal.cx> wrote:

> On Mon, Nov 05, 2012 at 07:27:44PM +0200, Paul Schutte wrote:
> > Thanks for the reply.
> >
> > I suspected something like you mention and therefore I made sure that I
> > installed the correct kernel headers before I compiled musl or any of the
> > other software.
>
> Kernel headers are completely irrelevant; they're not used anywhere.
> nsz's analysis is right. I have a patch I'm about to commit. In case
> you'd like to try it directly without using git, I'm attaching it
> here.
>
> There may be more fixes still needed. MIPS has A LOT of gratuitous
> differences in constant definitions and I thought I'd caught all of
> them before, but apparently some slipped through. The fcntl part of
> the patch has been tested and seems correct. The socket parts should
> be right, but they're untested; I'm working on a test for them now.
>
> Rich
>

[-- Attachment #2: Type: text/html, Size: 2343 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A few issues on MIPS and now on ARMEL
  2012-11-15 22:21 A few issues on MIPS and now on ARMEL Paul Schutte
@ 2012-11-15 23:37 ` Rich Felker
  2012-11-16  0:11   ` Rich Felker
  0 siblings, 1 reply; 6+ messages in thread
From: Rich Felker @ 2012-11-15 23:37 UTC (permalink / raw)
  To: musl

On Fri, Nov 16, 2012 at 12:21:11AM +0200, Paul Schutte wrote:
> Hi guys,
> 
> I am now hitting a similar problem on armel.
> 
> I am cross-compiling "dnsmasq"
> 
> Glibc strace:
> 
> ---snip---
> socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
> setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> 
> 
> Musl strace:
> 
> socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> setsockopt(5, SOL_SOCKET, *0xf /* SO_??? */*, [1], 4) = -1 ENOPROTOOPT
> (Protocol not available)

Thanks for the report. I'll check and see if ARM has unusual
definitions we're missing.

Rich


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A few issues on MIPS and now on ARMEL
  2012-11-15 23:37 ` Rich Felker
@ 2012-11-16  0:11   ` Rich Felker
  2012-11-16  0:18     ` Rich Felker
  0 siblings, 1 reply; 6+ messages in thread
From: Rich Felker @ 2012-11-16  0:11 UTC (permalink / raw)
  To: musl

On Thu, Nov 15, 2012 at 06:37:25PM -0500, Rich Felker wrote:
> On Fri, Nov 16, 2012 at 12:21:11AM +0200, Paul Schutte wrote:
> > Hi guys,
> > 
> > I am now hitting a similar problem on armel.
> > 
> > I am cross-compiling "dnsmasq"
> > 
> > Glibc strace:
> > 
> > ---snip---
> > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
> > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> > 
> > 
> > Musl strace:
> > 
> > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > setsockopt(5, SOL_SOCKET, *0xf /* SO_??? */*, [1], 4) = -1 ENOPROTOOPT
> > (Protocol not available)
> 
> Thanks for the report. I'll check and see if ARM has unusual
> definitions we're missing.

This doesn't seem to be ARM-specific. Linux has reserved a number for
SO_REUSEPORT, but it's not implemented in the kernel it seems, and
musl is providing the value, presumably causing the app to use it and
think it works. I'm guessing I should just remove it, but it might be
possible/preferable to make setsockopt and getsockopt remap it to
SO_REUSEADDR internally. Ideas anyone?

Rich


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A few issues on MIPS and now on ARMEL
  2012-11-16  0:11   ` Rich Felker
@ 2012-11-16  0:18     ` Rich Felker
  2012-11-16  1:28       ` Paul Schutte
  0 siblings, 1 reply; 6+ messages in thread
From: Rich Felker @ 2012-11-16  0:18 UTC (permalink / raw)
  To: musl

On Thu, Nov 15, 2012 at 07:11:10PM -0500, Rich Felker wrote:
> On Thu, Nov 15, 2012 at 06:37:25PM -0500, Rich Felker wrote:
> > On Fri, Nov 16, 2012 at 12:21:11AM +0200, Paul Schutte wrote:
> > > Hi guys,
> > > 
> > > I am now hitting a similar problem on armel.
> > > 
> > > I am cross-compiling "dnsmasq"
> > > 
> > > Glibc strace:
> > > 
> > > ---snip---
> > > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
> > > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > > setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> > > 
> > > 
> > > Musl strace:
> > > 
> > > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> > > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > > setsockopt(5, SOL_SOCKET, *0xf /* SO_??? */*, [1], 4) = -1 ENOPROTOOPT
> > > (Protocol not available)
> > 
> > Thanks for the report. I'll check and see if ARM has unusual
> > definitions we're missing.
> 
> This doesn't seem to be ARM-specific. Linux has reserved a number for
> SO_REUSEPORT, but it's not implemented in the kernel it seems, and
> musl is providing the value, presumably causing the app to use it and
> think it works. I'm guessing I should just remove it, but it might be
> possible/preferable to make setsockopt and getsockopt remap it to
> SO_REUSEADDR internally. Ideas anyone?

For now I've disabled it, matching what other libcs do on Linux.
Changes are in current git.

Rich


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A few issues on MIPS and now on ARMEL
  2012-11-16  0:18     ` Rich Felker
@ 2012-11-16  1:28       ` Paul Schutte
  2013-04-01 17:55         ` Rich Felker
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Schutte @ 2012-11-16  1:28 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 2446 bytes --]

Thanks Rich !

It is working.

You guys are the best !

Don't know if anyone is interested, but this is the memory usage of the
glibc binary (dynamically linked, distro supplied) :
root      9931  0.4  0.4   4232  1020 pts/2    S+   03:23   0:00 /dnsmasq

Musl binary, statically linked:
root      9927  0.0  0.1    328   244 pts/2    S    03:20   0:00 ./dnsmasq

RSS size down from 1020 to 244, thus 25% of original consumption.

Regards
Paul

On Fri, Nov 16, 2012 at 2:18 AM, Rich Felker <dalias@aerifal.cx> wrote:

> On Thu, Nov 15, 2012 at 07:11:10PM -0500, Rich Felker wrote:
> > On Thu, Nov 15, 2012 at 06:37:25PM -0500, Rich Felker wrote:
> > > On Fri, Nov 16, 2012 at 12:21:11AM +0200, Paul Schutte wrote:
> > > > Hi guys,
> > > >
> > > > I am now hitting a similar problem on armel.
> > > >
> > > > I am cross-compiling "dnsmasq"
> > > >
> > > > Glibc strace:
> > > >
> > > > ---snip---
> > > > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > > > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > > > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
> > > > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > > > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > > > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > > > setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> > > >
> > > >
> > > > Musl strace:
> > > >
> > > > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > > > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > > > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> > > > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > > > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > > > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > > > setsockopt(5, SOL_SOCKET, *0xf /* SO_??? */*, [1], 4) = -1
> ENOPROTOOPT
> > > > (Protocol not available)
> > >
> > > Thanks for the report. I'll check and see if ARM has unusual
> > > definitions we're missing.
> >
> > This doesn't seem to be ARM-specific. Linux has reserved a number for
> > SO_REUSEPORT, but it's not implemented in the kernel it seems, and
> > musl is providing the value, presumably causing the app to use it and
> > think it works. I'm guessing I should just remove it, but it might be
> > possible/preferable to make setsockopt and getsockopt remap it to
> > SO_REUSEADDR internally. Ideas anyone?
>
> For now I've disabled it, matching what other libcs do on Linux.
> Changes are in current git.
>
> Rich
>

[-- Attachment #2: Type: text/html, Size: 3273 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A few issues on MIPS and now on ARMEL
  2012-11-16  1:28       ` Paul Schutte
@ 2013-04-01 17:55         ` Rich Felker
  0 siblings, 0 replies; 6+ messages in thread
From: Rich Felker @ 2013-04-01 17:55 UTC (permalink / raw)
  To: musl; +Cc: Paul Schutte

Hey Paul,

I want to give you a heads-up: this issue is likely to regress in the
next release of musl, AND in glibc, since Linux has recently added
SO_REUSEPORT, which will now work on new kernels, but fail just like
before on old kernels. I've sent an email to the maintainer of dnsmasq
informing him of the issue so hopefully it will be fixed soon. I Cc'd
the musl list so you should be able to see that email if you're
subscribed or if you check the archives.

Let me know if you have any questions.

Rich


On Fri, Nov 16, 2012 at 03:28:59AM +0200, Paul Schutte wrote:
> Thanks Rich !
> 
> It is working.
> 
> You guys are the best !
> 
> Don't know if anyone is interested, but this is the memory usage of the
> glibc binary (dynamically linked, distro supplied) :
> root      9931  0.4  0.4   4232  1020 pts/2    S+   03:23   0:00 /dnsmasq
> 
> Musl binary, statically linked:
> root      9927  0.0  0.1    328   244 pts/2    S    03:20   0:00 ./dnsmasq
> 
> RSS size down from 1020 to 244, thus 25% of original consumption.
> 
> Regards
> Paul
> 
> On Fri, Nov 16, 2012 at 2:18 AM, Rich Felker <dalias@aerifal.cx> wrote:
> 
> > On Thu, Nov 15, 2012 at 07:11:10PM -0500, Rich Felker wrote:
> > > On Thu, Nov 15, 2012 at 06:37:25PM -0500, Rich Felker wrote:
> > > > On Fri, Nov 16, 2012 at 12:21:11AM +0200, Paul Schutte wrote:
> > > > > Hi guys,
> > > > >
> > > > > I am now hitting a similar problem on armel.
> > > > >
> > > > > I am cross-compiling "dnsmasq"
> > > > >
> > > > > Glibc strace:
> > > > >
> > > > > ---snip---
> > > > > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > > > > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > > > > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
> > > > > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > > > > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > > > > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > > > > setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> > > > >
> > > > >
> > > > > Musl strace:
> > > > >
> > > > > socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
> > > > > fcntl64(5, F_GETFL)                     = 0x2 (flags O_RDWR)
> > > > > fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> > > > > setsockopt(5, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
> > > > > setsockopt(5, SOL_IP, IP_PKTINFO, [1], 4) = 0
> > > > > setsockopt(5, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > > > > setsockopt(5, SOL_SOCKET, *0xf /* SO_??? */*, [1], 4) = -1
> > ENOPROTOOPT
> > > > > (Protocol not available)
> > > >
> > > > Thanks for the report. I'll check and see if ARM has unusual
> > > > definitions we're missing.
> > >
> > > This doesn't seem to be ARM-specific. Linux has reserved a number for
> > > SO_REUSEPORT, but it's not implemented in the kernel it seems, and
> > > musl is providing the value, presumably causing the app to use it and
> > > think it works. I'm guessing I should just remove it, but it might be
> > > possible/preferable to make setsockopt and getsockopt remap it to
> > > SO_REUSEADDR internally. Ideas anyone?
> >
> > For now I've disabled it, matching what other libcs do on Linux.
> > Changes are in current git.
> >
> > Rich
> >


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-01 17:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 22:21 A few issues on MIPS and now on ARMEL Paul Schutte
2012-11-15 23:37 ` Rich Felker
2012-11-16  0:11   ` Rich Felker
2012-11-16  0:18     ` Rich Felker
2012-11-16  1:28       ` Paul Schutte
2013-04-01 17:55         ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).