Thanq u i am clarified
On Mon, Jan 5, 2009 at 10:31 PM, <avr-libc-dev-requ...@nongnu.org> wrote: > Send AVR-libc-dev mailing list submissions to > avr-libc-dev@nongnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.nongnu.org/mailman/listinfo/avr-libc-dev > or, via email, send a message with subject or body 'help' to > avr-libc-dev-requ...@nongnu.org > > You can reach the person managing the list at > avr-libc-dev-ow...@nongnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of AVR-libc-dev digest..." > > > Today's Topics: > > 1. RE: bug in rand()/random()/do_rand()/do_random( ) (Mikal Hart) > 2. RE: bug in rand()/random()/do_rand()/do_random( ) > (Weddington, Eric) > 3. RE: bug in rand()/random()/do_rand()/do_random( ) (Mikal Hart) > 4. RE: bug in rand()/random()/do_rand()/do_random( ) > (Weddington, Eric) > 5. RE: bug in rand()/random()/do_rand()/do_random( ) (Mikal Hart) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 4 Jan 2009 18:37:53 -0600 > From: "Mikal Hart" <mh...@sundial.com> > Subject: RE: [avr-libc-dev] bug in > rand()/random()/do_rand()/do_random( ) > To: "'Weddington, Eric'" <ewedding...@cso.atmel.com>, "'Joerg Wunsch'" > <joerg_wun...@uriah.heep.sax.de>, <AVR-libc-dev@nongnu.org> > Message-ID: <005e01c96ecd$d9f62cb0$8de286...@com> > Content-Type: text/plain; charset="us-ascii" > > Thanks much for the quick replies, Joerg and Eric, > > Not being a Linux user myself, I forwarded your follow up questions to the > original thread and got some replies (see > http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227218077/52#52). > > The most informative reply came from "Veronica" who reports that she sees > the failure with this configuration: > > Ubuntu 8.10 (Intrepid Ibex) > avr-libc 1:1.6.2-1 > avr-gcc 1:4.3.0-2 > Maintainer: Ubuntu MOTU Developers > Linux main 2.6.27-11-generic #1 SMP Fri Dec 19 16:29:35 UTC 2008 x86_64 > GNU/Linux > > but when she installs the following files from debian sid, it fixes the > problem: > > binutils-avr_2.18-4_amd64.deb > avr-libc_1.6.2.cvs20080610-2_all.deb > gcc-avr_4.3.2-1_amd64.deb > > Answering other specific points and questions: > > Eric, I understand that you should ordinarily seed to get reasonable > randomness, but I intentionally avoided doing so in this case to better > compare the behaviors of the varying implementations of rand() and random() > > Joerg, I agree that it is quite interesting that the very first number > supplied by (unseeded) random() is 0. > > Does it seem like it's a problem with the 4.3.0 compiler? Would you still > recommend I file a bug report at savannah.nongnu.org? > > Regards, > > Mikal > > -----Original Message----- > From: avr-libc-dev-bounces+mhcom=sundial....@nongnu.org > [mailto:avr-libc-dev-bounces+mhcom <avr-libc-dev-bounces%2Bmhcom>= > sundial....@nongnu.org] On Behalf Of > Weddington, Eric > Sent: Saturday, January 03, 2009 5:41 PM > To: Joerg Wunsch; AVR-libc-dev@nongnu.org > Subject: RE: [avr-libc-dev] bug in rand()/random()/do_rand()/do_random( ) > > > > > -----Original Message----- > > From: > > avr-libc-dev-bounces+eweddington=cso.atmel....@nongnu.org > > [mailto:avr-libc-dev-bounces+eweddington<avr-libc-dev-bounces%2Beweddington> > =cso.atmel....@nongnu. > > org] On Behalf Of Joerg Wunsch > > Sent: Saturday, January 03, 2009 4:22 PM > > To: AVR-libc-dev@nongnu.org > > Subject: Re: [avr-libc-dev] bug in > > rand()/random()/do_rand()/do_random( ) > > > > As Mikal Hart wrote: > > > > > > That would also be an indication that the issue has been fixed long > > since, but the Ubuntu users are apparently using a way old version of > > avr-libc (probably since their package maintainer lags quite a couple > > of years behind). > > > > In the arduino forum thread, a user reported using Suse with avr-libc > 1.6.1: > <http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227218077/15> > > So it's not a terribly old version. > > > _______________________________________________ > AVR-libc-dev mailing list > AVR-libc-dev@nongnu.org > http://lists.nongnu.org/mailman/listinfo/avr-libc-dev > > > > > > ------------------------------ > > Message: 2 > Date: Sun, 4 Jan 2009 19:47:15 -0700 > From: "Weddington, Eric" <ewedding...@cso.atmel.com> > Subject: RE: [avr-libc-dev] bug in > rand()/random()/do_rand()/do_random( ) > To: "Mikal Hart" <mh...@sundial.com>, "Joerg Wunsch" > <joerg_wun...@uriah.heep.sax.de>, <AVR-libc-dev@nongnu.org> > Message-ID: > <258ddd1f44b6ed4aafd4370847cf58d504d19...@csomb01.corp.atmel.com> > Content-Type: text/plain; charset="us-ascii" > > > > > -----Original Message----- > > From: Mikal Hart [mailto:mh...@sundial.com] > > Sent: Sunday, January 04, 2009 5:38 PM > > To: Weddington, Eric; 'Joerg Wunsch'; AVR-libc-dev@nongnu.org > > Subject: RE: [avr-libc-dev] bug in > > rand()/random()/do_rand()/do_random( ) > > > > Does it seem like it's a problem with the 4.3.0 compiler? > > Would you still > > recommend I file a bug report at savannah.nongnu.org? > > So far the evidence that you present points somehow to a problem with > 4.3.0, since this user said it works with 4.3.2. There are known problems > with 4.3.0 (for the AVR target) so I'm not totally surprised that 4.3.2 > would fix it. > > Because there are known problems with 4.3.0, I would not bother with filing > a bug report with the avr-libc project, or the gcc project. But you just > might be aware of this issue for the arduino community. Joerg and I do not > frequent the arduino community forums or mailing lists. > > And perhaps in the future, it would be best if we could re-write rand(), > random(), and do_rand() in assembly for avr-libc so this issue with the > compiler won't happen again. ;-) > > Eric > > > > > ------------------------------ > > Message: 3 > Date: Sun, 4 Jan 2009 21:37:49 -0600 > From: "Mikal Hart" <mh...@sundial.com> > Subject: RE: [avr-libc-dev] bug in > rand()/random()/do_rand()/do_random( ) > To: "'Weddington, Eric'" <ewedding...@cso.atmel.com>, "'Joerg Wunsch'" > <joerg_wun...@uriah.heep.sax.de>, <AVR-libc-dev@nongnu.org> > Message-ID: <006201c96ee6$fbe4a950$f3adfb...@com> > Content-Type: text/plain; charset="us-ascii" > > > So far the evidence that you present points somehow to a problem with > 4.3.0, since this user said it works with 4.3.2. There are known problems > with 4.3.0 (for the AVR target) so I'm not totally surprised that 4.3.2 > would fix it. > > The only thing that makes me uneasy is that I don't see exactly where the > defective compiler comes into play. Perhaps it is just my lack of > understanding of how things work in the Linux domain, but it seems to me > that the bug must surely be in the avr-libc binary. Is that binary being > created with the system compiler? My understanding (likely incorrect) was > that Arduino users install a package that includes a precompiled avr-libc, > in which case it would seem that the local compiler version would not come > into direct play. If, however, the avr-libc is indeed compiled as a part > of > the install process, then I see clearly how a problem compiler could be the > culprit. > > Thanks for the guidance and keep up the good work! :) > > Regards, > > Mikal > > -----Original Message----- > From: Weddington, Eric [mailto:ewedding...@cso.atmel.com] > Sent: Sunday, January 04, 2009 8:47 PM > To: Mikal Hart; Joerg Wunsch; AVR-libc-dev@nongnu.org > Subject: RE: [avr-libc-dev] bug in rand()/random()/do_rand()/do_random( ) > > > > > -----Original Message----- > > From: Mikal Hart [mailto:mh...@sundial.com] > > Sent: Sunday, January 04, 2009 5:38 PM > > To: Weddington, Eric; 'Joerg Wunsch'; AVR-libc-dev@nongnu.org > > Subject: RE: [avr-libc-dev] bug in > > rand()/random()/do_rand()/do_random( ) > > > > Does it seem like it's a problem with the 4.3.0 compiler? > > Would you still > > recommend I file a bug report at savannah.nongnu.org? > > So far the evidence that you present points somehow to a problem with > 4.3.0, > since this user said it works with 4.3.2. There are known problems with > 4.3.0 (for the AVR target) so I'm not totally surprised that 4.3.2 would > fix > it. > > Because there are known problems with 4.3.0, I would not bother with filing > a bug report with the avr-libc project, or the gcc project. But you just > might be aware of this issue for the arduino community. Joerg and I do not > frequent the arduino community forums or mailing lists. > > And perhaps in the future, it would be best if we could re-write rand(), > random(), and do_rand() in assembly for avr-libc so this issue with the > compiler won't happen again. ;-) > > Eric > > > > > > ------------------------------ > > Message: 4 > Date: Sun, 4 Jan 2009 21:00:43 -0700 > From: "Weddington, Eric" <ewedding...@cso.atmel.com> > Subject: RE: [avr-libc-dev] bug in > rand()/random()/do_rand()/do_random( ) > To: "Mikal Hart" <mh...@sundial.com>, "Joerg Wunsch" > <joerg_wun...@uriah.heep.sax.de>, <AVR-libc-dev@nongnu.org> > Message-ID: > <258ddd1f44b6ed4aafd4370847cf58d504d19...@csomb01.corp.atmel.com> > Content-Type: text/plain; charset="us-ascii" > > > > > -----Original Message----- > > From: Mikal Hart [mailto:mh...@sundial.com] > > Sent: Sunday, January 04, 2009 8:38 PM > > To: Weddington, Eric; 'Joerg Wunsch'; AVR-libc-dev@nongnu.org > > Subject: RE: [avr-libc-dev] bug in > > rand()/random()/do_rand()/do_random( ) > > > > > So far the evidence that you present points somehow to a > > problem with > > 4.3.0, since this user said it works with 4.3.2. There are > > known problems > > with 4.3.0 (for the AVR target) so I'm not totally surprised > > that 4.3.2 > > would fix it. > > > > The only thing that makes me uneasy is that I don't see > > exactly where the > > defective compiler comes into play. > > Avr-libc is compiled with avr-gcc. The random functions in avr-libc are > written in C, hence the generated code is dependent on the avr-gcc compiler. > Avr-gcc 4.3.0 has code generation problems that are known. Avr-gcc 4.3.2 > fixes those code generation problems. So it is a matter of what version of > avr-gcc was used to compile avr-libc. > > Is that any clearer? > > > > > ------------------------------ > > Message: 5 > Date: Sun, 4 Jan 2009 23:46:56 -0600 > From: "Mikal Hart" <mh...@sundial.com> > Subject: RE: [avr-libc-dev] bug in > rand()/random()/do_rand()/do_random( ) > To: "'Weddington, Eric'" <ewedding...@cso.atmel.com>, "'Joerg Wunsch'" > <joerg_wun...@uriah.heep.sax.de>, <AVR-libc-dev@nongnu.org> > Message-ID: <006701c96ef9$0750d5e0$15f281...@com> > Content-Type: text/plain; charset="us-ascii" > > I understand that avr-libc is compiled by avr-gcc and that a defective > avr-gcc could possibly lead to a flawed copy of the library binary -- at > least the stuff written in C like random(). But here's the thing. When I > install my Arduino package for Windows, I get a precompiled copy of > avr-libc, so it (presumably) doesn't matter that the package also contains > the bad compiler -- and in fact it does include the "bad" 4.3.0 version -- > I'm still getting the "good" library. This is just speculation here, but > I'm guessing that that means the Windows avr-libc must have been compiled > with a different compiler (4.3.2?) than the one distributed alongside it > (4.3.0) in the Arduino package. > > In Linux-land, the paradigm is different. Unlike Windows, the Arduino > Linux > package doesn't supply either avr-gcc or avr-libc. Instead, it requires > the > user to procure these from "elsewhere", and this leads to the problem we > have been discussing. Perhaps we need to change this to match Windows for > consistency's sake if nothing else. > > Many thanks again for your replies and clear explanation. > > Mikal > > > > -----Original Message----- > From: Weddington, Eric [mailto:ewedding...@cso.atmel.com] > Sent: Sunday, January 04, 2009 10:01 PM > To: Mikal Hart; Joerg Wunsch; AVR-libc-dev@nongnu.org > Subject: RE: [avr-libc-dev] bug in rand()/random()/do_rand()/do_random( ) > > > > > -----Original Message----- > > From: Mikal Hart [mailto:mh...@sundial.com] > > Sent: Sunday, January 04, 2009 8:38 PM > > To: Weddington, Eric; 'Joerg Wunsch'; AVR-libc-dev@nongnu.org > > Subject: RE: [avr-libc-dev] bug in > > rand()/random()/do_rand()/do_random( ) > > > > > So far the evidence that you present points somehow to a > > problem with > > 4.3.0, since this user said it works with 4.3.2. There are > > known problems > > with 4.3.0 (for the AVR target) so I'm not totally surprised > > that 4.3.2 > > would fix it. > > > > The only thing that makes me uneasy is that I don't see > > exactly where the > > defective compiler comes into play. > > Avr-libc is compiled with avr-gcc. The random functions in avr-libc are > written in C, hence the generated code is dependent on the avr-gcc > compiler. > Avr-gcc 4.3.0 has code generation problems that are known. Avr-gcc 4.3.2 > fixes those code generation problems. So it is a matter of what version of > avr-gcc was used to compile avr-libc. > > Is that any clearer? > > > > > > ------------------------------ > > _______________________________________________ > AVR-libc-dev mailing list > AVR-libc-dev@nongnu.org > http://lists.nongnu.org/mailman/listinfo/avr-libc-dev > > > End of AVR-libc-dev Digest, Vol 74, Issue 2 > ******************************************* > _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev