Re: 5.7 & 32-bit

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Stuart Henderson
On 2015/10/02 13:35, L. V. Lammert wrote:
> Hi Stuart,
>
> One final question that is bugging me - if you have a few moments to
> provide a little edumification it would be appreciated.
>
> I realize that there is a issue for the project with time and resources
> to build binary packages packages for every 32-bit flavor,

Not a big problem for i386, it takes about 22 hours to do a full
package build on the project's i386 build machines at present.

>                                                            .. but I would
> have thought building from *source* would allowt the build process to pull
> the correct time_t definition from the headers ON the 32-bit system to
> build correctly?
>
> Thanks!
>
> Lee

It uses the correct time_t definition which means the variable that
timestamps are stored in are, correctly, 64-bit. But it tries to
format it using a format string like %lu that only uses 32 bits of
the value, leaving the rest for the next part of the format string.

Demo program.

cat << EOF > a.c
#include <stdio.h>

main() {
        time_t a = 123456789123456789LL;
        printf("%lu %lu %lu\n", a, a, a);
}
EOF

On amd64 all is well:

$ make a CFLAGS=-Wformat
$ ./a
123456789123456789 123456789123456789 123456789123456789

On i386 it's not so good:

$ make a CFLAGS=-Wformat
cc -Wformat   -o a a.c
a.c: In function 'main':
a.c:5: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'time_t'
a.c:5: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'time_t'
a.c:5: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'time_t'
$ ./a
2899336981 28744523 2899336981

.....

Converted to hex so you can see where these numbers are coming from:

$ moo -b 16 123456789123456789
0x1b69b4bacd05f15

       $ moo -b 16 2899336981
       0xacd05f15

$ moo -b 16 28744523
0x1b69b4b

So you're already getting wrong values. But now consider the case when
you want to also print a string, so have a %s after these:

        time_t a = 123456789123456789LL;
        char *b = "testing...";
        printf("%lu %lu %lu %s\n", a, a, a, b);

...that is passed by address not value, but printf is 'out of sync',
it's still looking at half of the second occurrence of 'a' (0x1b69b4b)
So it tries to go and read characters from that address which is
very unlikely to be in the program's address space : boom

$ ./b
Segmentation fault (core dumped)

It's fixable, the fixes are all very simple, see the patches to icinga
in the ports tree - but it's tedious and there are a lot of them.
Logging. CGIs. Saving status data to files. So between Nagios' lack
of working reliably for me in the past (I had a few occasions where
it claimed to be running OK but wasn't actually doing checks - and
of course something important broke at the time) - and their nasty
attitude towards forks and towards the monitoring-plugins (formerly
nagios-plugins) and monitoring-exchange (formerly nagios-exchange)
people, I felt there were better ways to spend my time.

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
On Fri, 2 Oct 2015, Stuart Henderson wrote:

Stuart,

First, I have to thank you for being so patient and complete with the
information,and understand the issue with the Nagios version in Ports,
the changes that would be required to make that work with 5.7, and also
your justifiable switch to Icinga. We use Nagios for one reason - we run
on platforms from 64bit archs to Raspberry Pi, so that makes it useful
for us as a standard platform.

The part I do not grok is that nagioscore builds happily on 64-bit AND
32-bit Linux platforms, ...

Is there any way to figure out how it builds on Linux successfully with
different time_t sizes? Would that not help with other ports? I would be
happy to help in any way I can, .. including providing access to test
machines with good builds.

        Thanks!

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Amit Kulkarni-5
On Fri, Oct 2, 2015 at 4:27 PM, L. V. Lammert <[hidden email]> wrote:

> On Fri, 2 Oct 2015, Stuart Henderson wrote:
>
> Stuart,
>
> First, I have to thank you for being so patient and complete with the
> information,and understand the issue with the Nagios version in Ports,
> the changes that would be required to make that work with 5.7, and also
> your justifiable switch to Icinga. We use Nagios for one reason - we run
> on platforms from 64bit archs to Raspberry Pi, so that makes it useful
> for us as a standard platform.
>
> The part I do not grok is that nagioscore builds happily on 64-bit AND
> 32-bit Linux platforms, ...
>
> Ports is a thankless job. I guess there are way more (most probably paid?)
volunteers in Linux who maintain nagios.


> Is there any way to figure out how it builds on Linux successfully with
> different time_t sizes? Would that not help with other ports? I would be
> happy to help in any way I can, .. including providing access to test
> machines with good builds.
>
>
After reading Stuart's email I interpret that to mean that he is not
interested to help with nagios porting, hope that helps you in making a
decision.
Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
On Fri, 2 Oct 2015, Amit Kulkarni wrote:

> > Ports is a thankless job. I guess there are way more (most probably paid?)
> > volunteers in Linux who maintain nagios.
>
Not necessarily  - the codebase is exactly the same - compiling on 5.7
throws the errors previously mentioned, .. building on a 32-bit Debian
kernel [4-byte time_t] works and runs fine as does a 64-bit kernel with
an 8-byte time_t. Or, looking at the test cases above, is the problem a
32-bit kernel with an 8-byte time_t?

> After reading Stuart's email I interpret that to mean that he is not
> interested to help with nagios porting, hope that helps you in making a
> decision.
>
Not saying he is, .. the question is why the codebase complies just fine
on both 64 & 32 bit Linux systems, but not OBSD. If there were a way to
divine that secret sauce, would it not help others?

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Stuart Henderson
In reply to this post by Amit Kulkarni-5
On 2015/10/02 16:38, Amit Kulkarni wrote:
>     The part I do not grok is that nagioscore builds happily on 64-bit
>     AND
>     32-bit Linux platforms, ...
>
>
> Ports is a thankless job. I guess there are way more (most probably
> paid?) volunteers in Linux who maintain nagios.

AFAIK, Linux uses 'long' for time_t, like we used to. This is
32 bits on 32-bit platforms and 64 bits on 64-bit platforms and
matches the %lu format strings.

Background etc. in http://www.openbsd.org/papers/eurobsdcon_2013_time_t/

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
In reply to this post by L. V. Lammert
> > > Ports is a thankless job. I guess there are way more (most probably paid?)
> > > volunteers in Linux who maintain nagios.
> >
> Not necessarily  - the codebase is exactly the same - compiling on 5.7
> throws the errors previously mentioned, .. building on a 32-bit Debian
> kernel [4-byte time_t] works and runs fine as does a 64-bit kernel with
> an 8-byte time_t. Or, looking at the test cases above, is the problem a
> 32-bit kernel with an 8-byte time_t?

For a while I was giving you the benefit of the doubt.  That you
are uneducated. But now I think you are uneducatable.

Obviously Linux and OpenBSD are exactly the same.

It should just work.

If they are exactly the same, go run Linux.

> > After reading Stuart's email I interpret that to mean that he is not
> > interested to help with nagios porting, hope that helps you in making a
> > decision.
> >
> Not saying he is, .. the question is why the codebase complies just fine
> on both 64 & 32 bit Linux systems, but not OBSD. If there were a way to
> divine that secret sauce, would it not help others?

Yes.  So go divine it, get going at it already.

Stop acting so bloody entitled.   You are not a slave owner, and
open source is not a cotton farm.

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
On Fri, 2 Oct 2015, Theo de Raadt wrote:

> > Not saying he is, .. the question is why the codebase complies just fine
> > on both 64 & 32 bit Linux systems, but not OBSD. If there were a way to
> > divine that secret sauce, would it not help others?
>
> Yes.  So go divine it, get going at it already.
>
Well, ... guess you really DO have body dysmorphic disorder?

> Stop acting so bloody entitled.   You are not a slave owner, and
> open source is not a cotton farm.
>
Guess you like raising cotten? Or, did your family have a secret skin
color change?

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
> > > Not saying he is, .. the question is why the codebase complies just fine
> > > on both 64 & 32 bit Linux systems, but not OBSD. If there were a way to
> > > divine that secret sauce, would it not help others?
> >
> > Yes.  So go divine it, get going at it already.
> >
> Well, ... guess you really DO have body dysmorphic disorder?
>
> > Stop acting so bloody entitled.   You are not a slave owner, and
> > open source is not a cotton farm.
> >
> Guess you like raising cotten? Or, did your family have a secret skin
> color change?

http://www.omnitec.net/

    "Our technical expertise that goes above and beyond the resources
    typically found in an organization"

Apparently your expertise is begging for help on open source
mailing lists, and then insulting us when we say no, we won't
help do your job for you.

Get lost, Lee.  Before I figure out who some of your customers
are.  It is not right for you to give us nothing, then act like
an asshole.

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
On Fri, 2 Oct 2015, Theo de Raadt wrote:

> Apparently your expertise is begging for help on open source
> mailing lists, and then insulting us when we say no, we won't
> help do your job for you.
>
Ahh, .. I wasn't begging, better check your sources. I was trying to help
- if you don't want help, go farm cotton.

> Get lost, Lee.  Before I figure out who some of your customers
> are.  It is not right for you to give us nothing, then act like
> an asshole.
>
Feel free - at least I don't have an international reputation of being a
lunatic.

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
> > Apparently your expertise is begging for help on open source
> > mailing lists, and then insulting us when we say no, we won't
> > help do your job for you.
> >
> Ahh, .. I wasn't begging, better check your sources. I was trying to help
> - if you don't want help, go farm cotton.
>
> > Get lost, Lee.  Before I figure out who some of your customers
> > are.  It is not right for you to give us nothing, then act like
> > an asshole.
> >
> Feel free - at least I don't have an international reputation of being a
> lunatic.

When you pick a fight with one open source project, it may lead
people to believe you have other bad business practices.

Stuart said he didn't want to help you -- for free.  You didn't get
the hint, and now you feel compelled to be an asshole.


You really should stop.

We are the ones doing the world favors.  Not you.

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
On Fri, 2 Oct 2015, Theo de Raadt wrote:

> When you pick a fight with one open source project, it may lead
> people to believe you have other bad business practices.
>
Sorry, .. you picked the fight, not me - better get your story straight.

> Stuart said he didn't want to help you -- for free.  You didn't get
> the hint, and now you feel compelled to be an asshole.
>
I didn't ask him for help, .. in fact if you bothered to actually read the
email instead of acting like the lunatic you are it would be apparent.

> You really should stop.
>
Why? I didn't start this line of BS.

> We are the ones doing the world favors.  Not you.
>
So, .. you do the world a favor by being a lunatic and doing your best to
discourage other people from helping OpenBSD? No wonder you have so much
fun running the project into the ground. Sheesh.

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
In reply to this post by L. V. Lammert
FYI sluug,

Lee has been on our mailing lists arguing with people who don't
want to do his work for him.

Such discourse from a member of your community towards open source
groups is not acceptable.

Lee, you tell me when I should stop being a 'lunatic', ok?

> > Apparently your expertise is begging for help on open source
> > mailing lists, and then insulting us when we say no, we won't
> > help do your job for you.
> >
> Ahh, .. I wasn't begging, better check your sources. I was trying to help
> - if you don't want help, go farm cotton.
>
> > Get lost, Lee.  Before I figure out who some of your customers
> > are.  It is not right for you to give us nothing, then act like
> > an asshole.
> >
> Feel free - at least I don't have an international reputation of being a
> lunatic.
>
> Lee
>

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
In reply to this post by Stuart Henderson
On Fri, 2 Oct 2015, Stuart Henderson wrote:

> AFAIK, Linux uses 'long' for time_t, like we used to. This is
> 32 bits on 32-bit platforms and 64 bits on 64-bit platforms and
> matches the %lu format strings.
>
> Background etc. in http://www.openbsd.org/papers/eurobsdcon_2013_time_t/
>
Stuart,

Thanks for the information!

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
In reply to this post by L. V. Lammert
> On Fri, 2 Oct 2015, Theo de Raadt wrote:
>
> > When you pick a fight with one open source project, it may lead
> > people to believe you have other bad business practices.
> >
> Sorry, .. you picked the fight, not me - better get your story straight.
>
> > Stuart said he didn't want to help you -- for free.  You didn't get
> > the hint, and now you feel compelled to be an asshole.
> >
> I didn't ask him for help, .. in fact if you bothered to actually read the
> email instead of acting like the lunatic you are it would be apparent.
>
> > You really should stop.
> >
> Why? I didn't start this line of BS.
>
> > We are the ones doing the world favors.  Not you.
> >
> So, .. you do the world a favor by being a lunatic and doing your best to
> discourage other people from helping OpenBSD? No wonder you have so much
> fun running the project into the ground. Sheesh.
>
> Lee

OpenBSD is essentially just a research project.

It is completely unsuitable for use by "scientists" who demand we
change it for them.

Lee, I think you should go.

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
In reply to this post by L. V. Lammert
> On Fri, 2 Oct 2015, Stuart Henderson wrote:
>
> > AFAIK, Linux uses 'long' for time_t, like we used to. This is
> > 32 bits on 32-bit platforms and 64 bits on 64-bit platforms and
> > matches the %lu format strings.
> >
> > Background etc. in http://www.openbsd.org/papers/eurobsdcon_2013_time_t/
> >
> Stuart,
>
> Thanks for the information!

Yes, Lee,

Those are the slides from a talk I gave in Malta, while running the
project into the ground as you say.

Those slides talk about a science thing.

I don't think you would understand it.

It's a little bit seperated from the simply administrative world you
come from, which is entirely built on begging that other people fix
code for you.

I still encourage you to stop using OpenBSD.  It's pretty clear
noone here is going to go out of their way to help you.  So I mean,
why continue asking/begging/demanding, and suggesting that people
here are lazy or lunatic?

Does it really help anyone?

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
In reply to this post by Theo de Raadt
On Fri, 2 Oct 2015, Theo de Raadt wrote:

> FYI sluug,
>
> Lee has been on our mailing lists arguing with people who don't
> want to do his work for him.
>
> Such discourse from a member of your community towards open source
> groups is not acceptable.
>
> Lee, you tell me when I should stop being a 'lunatic', ok?
>
Why? It's pretty entertaining really, ..

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
In reply to this post by Theo de Raadt
On Fri, 2 Oct 2015, Theo de Raadt wrote:

> OpenBSD is essentially just a research project.
>
> It is completely unsuitable for use by "scientists" who demand we
> change it for them.
>
> Lee, I think you should go.
>
Why? I don't do anything a lunatic tells me, .. besides, you're too
entertaining.

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

L. V. Lammert
In reply to this post by Theo de Raadt
On Fri, 2 Oct 2015, Theo de Raadt wrote:

> I still encourage you to stop using OpenBSD.  It's pretty clear
> noone here is going to go out of their way to help you.  So I mean,
> why continue asking/begging/demanding, and suggesting that people
> here are lazy or lunatic?
>
Huh? You've been trying to do that for what, 15 years? I agree OpenBSD is
a good tool/project/whatever you want to call it.

Do you want to give back the money we have contributed? Refund the cost of
the CDs we have on the shelf since, what, 3.1?

Do you really WANT to get rid of the folks that pay your bills? Now, THAT
is a sign of a true lunatic.

> Does it really help anyone?
>
Sure it does - everybody enjoys your ranting and raving - it's
entertaining!

        Lee

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
> Do you want to give back the money we have contributed? Refund the cost of
> the CDs we have on the shelf since, what, 3.1?

Even if that is the case, it gives you NO RIGHT to keep pushing for
developers to fix shit for you.

None of your mails have arrived with a patch.  Why is that?

http://www.sluug.org/resources/presentations/

Because you are a scientists who presents talks such as
"Alpine email client", "Upgrading SuSE", and
"Gnome 3 - Love It or Hate It".



It is not right to demand other people fix bugs for you.  Stuart's
mail was pretty clear, wasn't it?  I recall he said he has little
interest in nagios.


If you want your money back, then it wasn't a contribution was it.

Reply | Threaded
Open this post in threaded view
|

Re: 5.7 & 32-bit

Theo de Raadt
In reply to this post by L. V. Lammert
> Do you want to give back the money we have contributed? Refund the cost of
> the CDs we have on the shelf since, what, 3.1?

Are you being serious here?

I give you some money, and you'll leave?


Are there really user community members like you -- who are so
freeloading -- that if push comes to shove, they'll ask for their
donations back?


Lee, you are total scum.  Keep talking on the lists if you like;
I'll let others judge you from here on out.


I think I know how my 20 years of dedication is seen by others.


12