| View previous topic :: View next topic |
| Author |
Message |
Pauli Haukka Guest
|
Posted: Fri May 04, 2007 6:36 pm Post subject: Is there a bug in CodeGuard ? |
|
|
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 |
|
| Back to top |
|
 |
Thomas Maeder [TeamB] Guest
|
Posted: Fri May 04, 2007 9:24 pm Post subject: Re: Is there a bug in CodeGuard ? |
|
|
"Pauli Haukka" <pauli.haukka (AT) tut (DOT) fi> 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 nasty 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? |
|
| Back to top |
|
 |
Bruce Salzman Guest
|
Posted: Sat May 05, 2007 12:07 am Post subject: Re: Is there a bug in CodeGuard ? |
|
|
"Pauli Haukka" <pauli.haukka (AT) tut (DOT) fi> wrote in message
news:463b36d5 (AT) newsgroups (DOT) borland.com...
| 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 |
|
| Back to top |
|
 |
Sergiy Kanilo Guest
|
Posted: Sat May 05, 2007 12:42 am Post subject: Re: Is there a bug in CodeGuard ? |
|
|
"Thomas Maeder [TeamB]" <maeder (AT) glue (DOT) ch> wrote in message
news:m2ejlwftfo.fsf (AT) glue (DOT) ch...
| Quote: | The only thing that comes to mind is the there is a nasty 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 |
|
| Back to top |
|
 |
Thomas Maeder [TeamB] Guest
|
Posted: Sat May 05, 2007 1:36 am Post subject: Re: Is there a bug in CodeGuard ? |
|
|
"Sergiy Kanilo" <skanilo (AT) artannlabs (DOT) com> writes:
| Quote: | "Thomas Maeder [TeamB]" <maeder (AT) glue (DOT) ch> wrote in message
news:m2ejlwftfo.fsf (AT) glue (DOT) ch...
The only thing that comes to mind is the there is a nasty 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. |
|
| Back to top |
|
 |
David Dean [CodeGear] Guest
|
Posted: Sat May 05, 2007 1:52 am Post subject: Re: Is there a bug in CodeGuard ? |
|
|
In article <463b8c92 (AT) newsgroups (DOT) borland.com>,
"Sergiy Kanilo" <skanilo (AT) artannlabs (DOT) 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
<http://blogs.codegear.com/ddean/> |
|
| Back to top |
|
 |
|