db plug in for ca client returns incomplete channel name from ca_name(chid)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Medium
|
Jeff Hill |
Bug Description
From John Sinclair:
Is the following a bug or a feature?
The following code behaves differently depending where it is run.
As a stand-alone application, it runs correctly.
When it runs as a thread on a soft IOC, it does not. A comment below
listed as "HERE'S THE PROBLEM" indicates the incorrect behavior.
=======
This block simply creates a thread
=======
static char g_arg1[255+1], g_arg2[255+1], g_arg3[255+1];
long epicsShareAPI func(
char *arg1,
char *arg2,
char *arg3
) {
epicsThreadId id;
strncpy( g_arg1, arg1, 255 );
g_arg1[255] = 0;
strncpy( g_arg2, arg2, 255 );
g_arg2[255] = 0;
strncpy( g_arg3, arg3, 255 );
g_arg3[255] = 0;
id = epicsThreadCreate( "A Thread",
epicsThreadP
epicsThreadG
aThread, NULL );
return 0;
}
=======
Here's the thread
=======
static void aThread (
void *arg
) {
int stat;
chid id;
enum ca_preemptive_
ca_disable_
ca_enable_
};
stat = ca_context_create ( ca_enable_
stat = ca_search( "pv.LOLO", &id );
if ( stat != ECA_NORMAL ) {
printf( "ca_search failed\\n" );
goto err_return;
}
stat = ca_pend_io( 5.0 );
if ( stat != ECA_NORMAL ) {
printf( "ca_pend_io failed\\n" );
goto err_return;
}
===
HERE'S THE PROBLEM
===
printf( "Name is [%s]\\n", ca_name(id) );
===
ca_name returns "pv" instead of "pv.LOLO"
===
===
However, id is correct. It does map to pv.LOLO.
(This conclusion is based on other code)
===
return;
err_return:
printf( "Error\\n" );
}
=======
Original Mantis Bug: mantis-148
http://
fixed in R3.14.7