- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: problem with opening file in a process when sy...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2003 11:48 PM
08-05-2003 11:48 PM
problem with opening file in a process when system is loaded
We have a strange behaviour of the system:
it happens taht sometimes we get errno 2 (file not exist) when trying to read the configuration file of a process.
Still the file is present and I restart the process and it works ok.
It seems that this happens when the load is high (many processes running).
Here is the code:
TG_BUS::TG_BUS(byte1 *p1p_file, tg_idDic p2_idDic, byte4 p4_lMem)
{
const byte1* ka_funcName = "TG_BUS::TG_BUS";
m1p_bus = 0;
cout << ka_funcName << " p1p_file" << ":" << p1p_file << ":" << endl << flush ;
cout << ka_funcName << " errno avant" << ":" << errno << ":" << endl << flush ;
ifstream lc_file(p1p_file);
if (lc_file == NULL)
{
cout << ka_funcName << " errno" << ":" << errno << ":" << endl << flush ;
cout << ka_funcName << " !lc_file" << ":" << !lc_file << ":" << endl << flush ;
cout << ka_funcName << " lc_file .rdstate()" << ":" << lc_file.rdstate() << ":" << endl << flush ;
cout << ka_funcName << " ios_base::badbit" << ":" << ios_base::badbit << ":" << endl << flush ;
cout << ka_funcName << " ios_base::eofbit" << ":" << ios_base::eofbit << ":" << endl << flush ;
cout << ka_funcName << " ios_base::failbit" << ":" << ios_base::failbit << ":" << endl << flush ;
cout << ka_funcName << " ios_base::goodbit" << ":" << ios_base::goodbit << ":" << endl << flush ;
throw(TgExcepSys(p1p_file, ENOENT, 0));
// TG_ERROR("TG_BUS: fichier absent");
}
m4_lMem = max(p4_lMem,k4_busLHeader);
m1p_bus = new byte1[m4_lMem];
if (!m1p_bus)
{
m4_lMem = 0;
TgExcepSysExit("", ENOMEM, 0);
// TG_ERROR("plus de mem");
}
initHead(p2_idDic);
(*this) = TG_BUS(lc_file, p2_idDic, p4_lMem);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2003 12:09 AM
08-06-2003 12:09 AM
Re: problem with opening file in a process when system is loaded
Could you check the syslog / dmesg if you get any error messages ?
Robert-Jan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2003 01:30 AM
08-06-2003 01:30 AM
Re: problem with opening file in a process when system is loaded
throw(TgExcepSys(p1p_file, ENOENT, 0));
Looks like you've hard-coded the error to ENOENT when perhaps its something else? Is the value of errno as printed by the above code actually set to 2?
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2003 04:14 AM
08-06-2003 04:14 AM
Re: problem with opening file in a process when system is loaded
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2003 04:15 AM
08-06-2003 04:15 AM
Re: problem with opening file in a process when system is loaded
And I gave directives to check the syslog when it happens again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2003 01:25 AM
08-07-2003 01:25 AM
Re: problem with opening file in a process when system is loaded
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2003 12:51 AM
08-08-2003 12:51 AM
Re: problem with opening file in a process when system is loaded
* Install the latest libc and C++ library patches
* If that doesn't help, try to replace the ifstream constructor call with standard C open() or fopen() calls. Once you're sure the open succeeded you can construct an ifstream object from the FILE*. The reason I suggest this is because its possible the C++ library is losing the value of errno through some other action - I don't think C++ guarantees that errno is every set correctly after a library call.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2003 03:02 AM
08-29-2003 03:02 AM
Re: problem with opening file in a process when system is loaded
Unfortunately this constructor ifstream(int fd) is not available on other systems (like Linux, AIX) and it is now conditional code for HPUX.
It is to early to tell that the problem is really solved; I wait for production reaction and if it's fine I 'll give you 10 points Steven!
:-)
regards
Laurent