Board index » cppbuilder » Is there a bug in CodeGuard ?

Is there a bug in CodeGuard ?


2007-05-04 09:36:52 PM
cppbuilder70
CodeGuard gives me following errors messages:
4.5.2007 16:13:53 started a CodeGuard(tm) process: Laivanupotus.exe(1396)
Bad parameter in process: Laivanupotus.exe(1396) - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
A bad file or pipe stream (0x3277D7A8) has been passed to the function.
0x0042B530 Call to fgetc(0x3277D7A8)
0x004224D6 - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
0x0041E601 - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#366
0x0041E4CD - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#346
0x0041215A - f:\program
files\borland\bds\4.0\include\dinkumware\streambuf#103
0x00411C56 - f:\program
files\borland\bds\4.0\include\dinkumware\string#572
0x0040D861 - f:\program
files\borland\bds\4.0\include\dinkumware\string#612
And jumps this file:
// fstream standard header
template<>inline bool _Fgetc(char& _Byte, _Filet *_File)
{ // get a char element from a C stream
int _Meta;
if ((_Meta = fgetc(_File)) == EOF) // *** POINTS THIS LINE ***
return (false);
else
{ // got one, convert to char
_Byte = (char)_Meta;
return (true);
-----------------------------------------------------------------------
Error is caused by getline( tiedosto, pelaajannimi_ ) call in the code
below.
pelaajanimi_ is private string variable of class Pelaaja.
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
...
bool Pelaaja::lueTiedot()
{
ifstream tiedosto( laivatiedosto_.c_str() );
if( tiedosto ){
getline( tiedosto, pelaajannimi_ );
...
Do you have any idea what causes this error ?
I makes impossible to use CodeGuard for debugging.
~Pauli
 
 

Re:Is there a bug in CodeGuard ?

"Pauli Haukka" < XXXX@XXXXX.COM >writes:
Quote
CodeGuard gives me following errors messages:

4.5.2007 16:13:53 started a CodeGuard(tm) process: Laivanupotus.exe(1396)
Bad parameter in process: Laivanupotus.exe(1396) - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
A bad file or pipe stream (0x3277D7A8) has been passed to the function.
0x0042B530 Call to fgetc(0x3277D7A8)
0x004224D6 - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
0x0041E601 - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#366
0x0041E4CD - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#346
0x0041215A - f:\program
files\borland\bds\4.0\include\dinkumware\streambuf#103
0x00411C56 - f:\program
files\borland\bds\4.0\include\dinkumware\string#572
0x0040D861 - f:\program
files\borland\bds\4.0\include\dinkumware\string#612


And jumps this file:

// fstream standard header

template<>inline bool _Fgetc(char& _Byte, _Filet *_File)
{ // get a char element from a C stream
int _Meta;
if ((_Meta = fgetc(_File)) == EOF) // *** POINTS THIS LINE ***
return (false);
else
{ // got one, convert to char
_Byte = (char)_Meta;
return (true);
-----------------------------------------------------------------------

Error is caused by getline( tiedosto, pelaajannimi_ ) call in the code
below.
pelaajanimi_ is private string variable of class Pelaaja.
SCNR: I love Finnish variable names; have you considered applying
rot13 to enhance their readability? :-)
Quote
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
...
bool Pelaaja::lueTiedot()
{
ifstream tiedosto( laivatiedosto_.c_str() );
if( tiedosto ){
getline( tiedosto, pelaajannimi_ );
...

Do you have any idea what causes this error ?
The only thing that comes to mind is the there is a {*word*193} bug
somewhere else in your program that causes this. Or a CodeGuard bug,
but since CodeGuard has probably been tested by more people than your
code ...
Can you reproduce the problem if you reduce the program to a <50 line
main() function containing the code given above?
 

Re:Is there a bug in CodeGuard ?

"Pauli Haukka" < XXXX@XXXXX.COM >wrote in message
Quote
CodeGuard gives me following errors messages:

4.5.2007 16:13:53 started a CodeGuard(tm) process:
Laivanupotus.exe(1396)
Bad parameter in process: Laivanupotus.exe(1396) - f:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
A bad file or pipe stream (0x3277D7A8) has been passed to the
function.
0x0042B530 Call to fgetc(0x3277D7A8)
I ran into that as well. Go to Tools|CodeGuard Configuration|Function
Options and uncheck Invalid handle/resource parameters for the _fgetc
function.
--
Bruce
 

{smallsort}

Re:Is there a bug in CodeGuard ?

"Thomas Maeder [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
The only thing that comes to mind is the there is a {*word*193} bug
somewhere else in your program that causes this. Or a CodeGuard bug,
but since CodeGuard has probably been tested by more people than your
code ...
Can you reproduce the problem if you reduce the program to a <50 line
main() function containing the code given above?
#include <fstream>
#include <string>
int main()
{
std::ifstream file( "test.txt" );
std::string line;
std::getline( file, line );
return 0;
}
causes
Bad parameter in process: Project1.exe(2224) - c:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
A bad file or pipe stream (0x3279C0F8) has been passed to the function.
0x00409A98 Call to fgetc(0x3279C0F8)
0x004095C2 - c:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
0x0040846D - c:\program
files\borland\bds\4.0\include\dinkumware\fstream#366
0x004037FA - c:\program
files\borland\bds\4.0\include\dinkumware\streambuf#97
0x00403662 - c:\program
files\borland\bds\4.0\include\dinkumware\streambuf#114
0x00402426 - c:\program
files\borland\bds\4.0\include\dinkumware\string#574
0x0040170D - c:\program
files\borland\bds\4.0\include\dinkumware\string#612
if you compile using BDS2006 with "All Codeguard options on'
Strange enough, but there are no codeguard messages if file does not exist.
Cheers,
Serge
 

Re:Is there a bug in CodeGuard ?

"Sergiy Kanilo" < XXXX@XXXXX.COM >writes:
Quote
"Thomas Maeder [TeamB]" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>The only thing that comes to mind is the there is a {*word*193} bug
>somewhere else in your program that causes this. Or a CodeGuard bug,
>but since CodeGuard has probably been tested by more people than your
>code ...

>Can you reproduce the problem if you reduce the program to a <50 line
>main() function containing the code given above?

#include <fstream>
#include <string>
int main()
{
std::ifstream file( "test.txt" );
std::string line;
std::getline( file, line );
return 0;
}

causes

Bad parameter in process: Project1.exe(2224) - c:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
A bad file or pipe stream (0x3279C0F8) has been passed to the function.
0x00409A98 Call to fgetc(0x3279C0F8)
Wow; I stand corrected. This is a good bug report for Quality Central,
if it's not already there.
 

Re:Is there a bug in CodeGuard ?

In article < XXXX@XXXXX.COM >,
"Sergiy Kanilo" < XXXX@XXXXX.COM >wrote:
Quote
#include <fstream>
#include <string>
int main()
{
std::ifstream file( "test.txt" );
std::string line;
std::getline( file, line );
return 0;
}

causes

Bad parameter in process: Project1.exe(2224) - c:\program
files\borland\bds\4.0\include\dinkumware\fstream#23
A bad file or pipe stream (0x3279C0F8) has been passed to the function.
0x00409A98 Call to fgetc(0x3279C0F8)
0x004095C2 - c:\program
Please enter this into QC.
--
-David Dean
CodeGear C++ QA Engineer
<blogs.codegear.com/ddean/>