FAQ
This is a bug report for perl from jpabuyer@tecnoera.com,
generated with the help of perlbug 1.33 running under perl v5.6.1.


-----------------------------------------------------------------
[Please enter your report here]

I was programming perl, and suddenly noticed that my program was not doing what it was supposed to do, so I starded debugging with -d, and notice that when debugging the program actually did what it was supposed to do. So I started deleting some lines that I thought didn't have to do with the problem, and I reduced the program to this:

----------------------
#!/usr/bin/perl

print "lala";

while(1){
print ".";
sleep 1;
};
---------------------

normally, this program seems to do nothing, though it should print "lala." and then print "." every second later. The weird thing is that in debug mode it works fine:

[root@blackbird sapte]# ./report.pl

[did nothing]

[root@blackbird sapte]#
[root@blackbird sapte]#
[root@blackbird sapte]# perl -d report.pl
Default die handler restored.

Loading DB routines from perl5db.pl version 1.07
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(report.pl:3): print "lala";
DB<1> c
lala......main::(report.pl:5): while(1){
DB<1>

DB<1> q
[root@blackbird sapte]#

please inform me what's up with this because I need to fishish my program for this weekend :-(

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=high
---
Site configuration information for perl v5.6.1:

Configured by jpabuyer at Tue May 29 14:40:50 CLT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=linux, osvers=2.2.19, archname=i686-linux
uname='linux blackbird.tecnoera.com 2.2.19 #7 thu may 3 21:40:53 clt 2001 i686 unknown '
config_args='-de'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing'
ccversion='', gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil
libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:


---
@INC for perl v5.6.1:
/usr/local/lib/perl5/5.6.1/i686-linux
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
.

---
Environment for perl v5.6.1:
HOME=/root
LANG=en_US
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/bin:/bin:/usr/X11R6/bin:/usr/local/bin:/opt/bin:/usr/X11R6/bin:/home/jpabuyer/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin:/home/jpabuyer/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
PERL_BADLANG (unset)
SHELL=/bin/bash

Search Discussions

  • Jeff Pinyan at May 29, 2001 at 8:35 pm
    On May 29, root said:
    print "lala";

    while(1){
    print ".";
    sleep 1;
    };
    STDOUT it buffered by default. Turn off buffering by setting $| to 1.

    $| = 1;
    print "." and sleep 1 while 1;

    --
    Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
    Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
    Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
    Acacia Fraternity, Rensselaer Chapter. Brother #734
    ** I need a publisher for my book "Learning Perl's Regular Expressions" **
  • Juan Pablo Abuyeres at May 29, 2001 at 8:38 pm
    Thank you man :)
    On Tue, 29 May 2001, Jeff Pinyan wrote:

    On May 29, root said:
    print "lala";

    while(1){
    print ".";
    sleep 1;
    };
    STDOUT it buffered by default. Turn off buffering by setting $| to 1.

    $| = 1;
    print "." and sleep 1 while 1;
  • Michael G Schwern at May 30, 2001 at 9:34 am

    On Tue, May 29, 2001 at 04:33:33PM -0400, Jeff Pinyan wrote:
    On May 29, root said:
    print "lala";

    while(1){
    print ".";
    sleep 1;
    };
    STDOUT it buffered by default. Turn off buffering by setting $| to 1.
    Should the debugger be interfering with STDOUT's buffering?


    --

    Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/
    Perl6 Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
    I represent GOD you fuck!
    http://www.unamerican.com/
  • Ronald J Kimball at May 30, 2001 at 1:25 pm

    On Wed, May 30, 2001 at 07:47:17AM +0100, Michael G Schwern wrote:
    On Tue, May 29, 2001 at 04:33:33PM -0400, Jeff Pinyan wrote:
    On May 29, root said:
    print "lala";

    while(1){
    print ".";
    sleep 1;
    };
    STDOUT it buffered by default. Turn off buffering by setting $| to 1.
    Should the debugger be interfering with STDOUT's buffering?
    I recall reading on p5p that whenever there's a read on STDIN, the STDOUT
    buffer is automatically flushed first.

    Ronald
  • Nick Ing-Simmons at May 30, 2001 at 1:33 pm

    Ronald J Kimball writes:
    On Wed, May 30, 2001 at 07:47:17AM +0100, Michael G Schwern wrote:
    On Tue, May 29, 2001 at 04:33:33PM -0400, Jeff Pinyan wrote:
    On May 29, root said:
    print "lala";

    while(1){
    print ".";
    sleep 1;
    };
    STDOUT it buffered by default. Turn off buffering by setting $| to 1.
    Should the debugger be interfering with STDOUT's buffering?
    I recall reading on p5p that whenever there's a read on STDIN, the STDOUT
    buffer is automatically flushed first.
    Indeed that is what is supposed to happen - I seem to remember
    adding to perlio.c to "make it so".

    --
    Nick Ing-Simmons
    who is looking for a new job see http://www.ni-s.u-net.com/
  • Michael G Schwern at May 30, 2001 at 1:37 pm

    On Wed, May 30, 2001 at 01:27:07PM +0000, Nick Ing-Simmons wrote:
    Should the debugger be interfering with STDOUT's buffering?
    I recall reading on p5p that whenever there's a read on STDIN, the STDOUT
    buffer is automatically flushed first.
    Indeed that is what is supposed to happen - I seem to remember
    adding to perlio.c to "make it so".
    Hmmm. Still, the debugger reading debugging commands shouldn't effect
    the program, but this doesn't sound like its easy to fix.

    --

    Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/
    Perl6 Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
    <Skrewtape> I've heard that semen tastes different depending on diet. Is that
    true?
    <Skrewtape> Hello?
    <Schwern> Skrewtape: Hang on, I'm conducting research.
  • Peter Scott at May 30, 2001 at 3:40 pm

    At 09:24 AM 5/30/2001 -0400, Ronald J Kimball wrote:
    I recall reading on p5p that whenever there's a read on STDIN, the STDOUT
    buffer is automatically flushed first.
    Exactly. Otherwise everyone and his dog would be asking why

    print "Frobble? [y/n] ";
    chomp($frobble = <STDIN>);

    didn't do what they wanted.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 29, '01 at 8:31p
activeMay 30, '01 at 3:40p
posts8
users7
websiteperl.org

People

Translate

site design / logo © 2018 Grokbase