Discussion:
bds2006 bcc32 "hangs" using cpu
(too old to reply)
dhoke
2008-06-16 15:56:46 UTC
Permalink
If this still happens with bds2007 bcc32, somebody might wish to report it.
(I haven't bothered to put it in a project to see if there's different
behaviour with IDE compilation.)

The following program source when compiled as simply

bcc32 bcchang_b.cpp
-or-
bcc32 bcchang_b.c

(appropriately) reports errors, then continues to consume CPU beyond my
level of patience to wait for it to stop. (I gave it > 2 minutes.) (With
errors corrected in original context, entire program compiles and links in <
5 seconds for me [after OS has tools in filesystem cache].)

The first error message is slightly different between .c and .cpp versions,
but both runaway with CPU after error messages reported.

========================
#include <stdio.h>

void dump(char *p_p, int n)
{
// int i, j, n_copy = n, n2 ;
int i, n_copy = n ;
char *p = p_p ;
// n2 = 0 ;
for( ; n_copy ; )
{
for(i=0 ; n _copy i < 8 ; i++)
// for(i=0 ; n_copy && i < 8 ; i++)
{
printf("%02x ", *p++) ;
n_copy-- ;
}
printf(" ") ;
for(i=0 ; n_copy && i < 8 ; i++)
{
printf("%02x ", *p+++) ;
// printf("%02x ", *p++) ;
n_copy-- ;
}
printf("\n") ;
}
}

========================
Bob Gonder
2008-06-16 19:44:36 UTC
Permalink
Post by dhoke
If this still happens with bds2007 bcc32, somebody might wish to report it.
(I haven't bothered to put it in a project to see if there's different
behaviour with IDE compilation.)
Yes, it hangs TCE2006 IDE as well as the commandline.
Does not hang the BCB 5.51 version.
Post by dhoke
for( ; n_copy ; )
{
for(i=0 ; n _copy i < 8 ; i++)
// for(i=0 ; n_copy && i < 8 ; i++)
Note that this is a malformed condition.
A simplified hanging version...
all loops and printf seem to be required.

#include <stdio.h>

void dump(int n)
{
for( ; n ; )
{
for(i=0 ; n i < 8 ; i++)
{}
printf(" ") ;
for(i=0 ; n && i < 8 ; i++)
{}
}
}
David Dean [CodeGear]
2008-06-16 21:03:33 UTC
Permalink
Post by Bob Gonder
A simplified hanging version...
all loops and printf seem to be required.
#include <stdio.h>
void dump(int n)
{
for( ; n ; )
{
for(i=0 ; n i < 8 ; i++)
{}
printf(" ") ;
for(i=0 ; n && i < 8 ; i++)
{}
}
}
Please enter this in QC and I will promote it. I have duplicated it.
--
David Dean (CodeGear)
Lead C++ QA Engineer
Bob Gonder
2008-06-17 18:17:45 UTC
Permalink
Post by David Dean [CodeGear]
Please enter this in QC and I will promote it. I have duplicated it.
QC 63407
David Dean [CodeGear]
2008-06-17 19:26:33 UTC
Permalink
Post by Bob Gonder
QC 63407
Promoted.
--
David Dean (CodeGear)
Lead C++ QA Engineer
Loading...