Error log not flushed before dbReadTest exits

Bug #1419879 reported by Richard Fearn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Invalid
Undecided
Unassigned
3.14
Fix Released
Undecided
Unassigned

Bug Description

dbReadTest gives rather unhelpful output for one of my db files:

$ dbReadTest db/dbExample1.db
For input file db/dbExample1.db$

Adding:

  errlogFlush();

at the end of the main function in dbReadTest.c results in more output:

$ dbReadTest db/dbExample1.db
For input file db/dbExample1.dbBad character '$' in record name "$(user):aiExample"
Record "$(user):aiExample" is of unknown type "ai"
Error at or before ")" in file "db/dbExample1.db" line 1
filename="../dbReadTest.c" line number=77
from dbReadDatabase
$

Not sure if this is the right solution, but it helps...

summary: - EPICS log not being flushed at end of dbReadTest
+ Error log not flushed before dbReadTest exits
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

I'm marking this bug as 3.14 series as it seems that dbReadTest is removed before 3.15.0.1. This removal my be a seperate issue.

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

Instead for errlogFlush() can you try epicsExit()? The exit handler for errlog should flush the message buffer.

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

I can't make dbReadTest lose parts of an error message, but I see no reason why it couldn't. Adding epicsExit(0) after dbFreeBase() does noticeable increases the runtime.

Changed in epics-base:
status: New → Invalid
Revision history for this message
Richard Fearn (richardfearn) wrote :

> I'm marking this bug as 3.14 series as it seems that dbReadTest is removed before 3.15.0.1. This removal my be a seperate issue.

Yes, it was removed here: http://bazaar.launchpad.net/~epics-core/epics-base/3.15/revision/12271

Revision history for this message
Richard Fearn (richardfearn) wrote :

> Instead for errlogFlush() can you try epicsExit()? The exit handler for errlog should flush the message buffer.

Yeah, that also seems to guarantee that the errors are displayed:

$ dbReadTest db/dbExample1.db
For input file db/dbExample1.dbfilename="../dbLexRoutines.c" line number=240
No such file or directory dbRead opening file db/dbExample1.db
filename="../dbReadTest.c" line number=77
from dbReadDatabase

Revision history for this message
Richard Fearn (richardfearn) wrote :

> I can't make dbReadTest lose parts of an error message, but I see no reason why it couldn't.

Do you agree there is a problem? I noticed you marked this bug as invalid...

Then again the whole issue may not matter much if the program has been removed in 3.15.

> Adding epicsExit(0) after dbFreeBase() does noticeable increases the runtime.

It does. But slow and useful is better than fast and unhelpful :-)

Revision history for this message
Ralph Lange (ralph-lange) wrote :

The bug is correctly marked 'invalid' for the main trunk of development, as the test program showing the bug has been removed.
It is still there, marked 'new', for the 3.14 branch.

Orderly shutdown of the IOC takes noticeably longer.
You can also experience that effect comparing typing 'exit' on an iocShell with a simple ^C.

Revision history for this message
Richard Fearn (richardfearn) wrote :

> The bug is correctly marked 'invalid' for the main trunk of development, as the test program showing the bug has been removed.
It is still there, marked 'new', for the 3.14 branch.

Ah, thanks! I didn't realise it could have a different status for each EPICS version. (Haven't used Launchpad much before.)

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

After some thought, the correctness of epicsExit() isn't worth the reduction in speed. So I just added errlogFlush() as you suggest. Also pulled in a patch dbPvdLib.c to fix this error, which I see when running dbReadTest.

> epicsMutex pthread_mutex_destroy failed: error Device or resource busy

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.