QNX6.1 Cross Development Kit- slinger & ds problem

We have the new release of the 6.1 Cross development tools and one of the
developers is having an issue with slinger & ds.

Any comments on this one folks???

We are using ‘ds’ to store values for our web page which is served by
‘slinger’. We have a C program that registers a variable in ds called
VME_SLOT_Number and then sets the value to “9”. The C program can read the
ds value and see “9”. Slinger tries to read the value with a #qnxvar SSI
tag. The tag always returns nothing. However, just trying to read the
value with slinger causes some corruption in the ds data. The C program is
no longer able to read the value from ds. The ds_get() call fails with an
invalid argument.

Was the QNX 6.1 slinger re-compiled/linked with the fixed QNX 6.1 libds.a?

Robert Ahlers
SYSTEM DEVELOPMENT ENGINEERING

GE TOSHIBA AUTOMATION SYSTEMS
1501 Roanoke Blvd, Rm 244
Salem, VA 24153, USA
Phone: 540-387-7571, DC 278-7571
Fax: 540-387-7061, DC 278-7061
Email: robert.ahlers@indsys.ge.com

Dennis Morehart <demorehart@earthlink.net> wrote:

We are using ‘ds’ to store values for our web page which is served by
‘slinger’. We have a C program that registers a variable in ds called
VME_SLOT_Number and then sets the value to “9”. The C program can read the
ds value and see “9”. Slinger tries to read the value with a #qnxvar SSI
tag. The tag always returns nothing. However, just trying to read the
value with slinger causes some corruption in the ds data. The C program is
no longer able to read the value from ds. The ds_get() call fails with an
invalid argument.

Are you specifying the DS_PERM flag when calling ds_create()? The failure
you mention from ds_get() doesn’t seem to match the list of return values
possible. Which error does the ds_get() return:

EBADF Invalid file descriptor dsdes.
EMSGSIZE The buffer isn’t big enough for the data.
ESRCH The variable doesn’t exist in the data server.

Was the QNX 6.1 slinger re-compiled/linked with the fixed QNX 6.1 libds.a?

Yes, Slinger would have to be recompiled for the 6.1 release when we moved to Dinkum
libs.

-Adam
amallory@qnx.com

Our C program remained running and we did not use DS-PERM. We have tried
DS-PERM with the same results.

ds_get() fails with a errno of 22 EINVAL

Dennis

“Operating System for Tech Supp” <os@qnx.com> wrote in message
news:9mgdv5$rmt$1@nntp.qnx.com

Dennis Morehart <> demorehart@earthlink.net> > wrote:
We are using ‘ds’ to store values for our web page which is served by
‘slinger’. We have a C program that registers a variable in ds called
VME_SLOT_Number and then sets the value to “9”. The C program can read
the
ds value and see “9”. Slinger tries to read the value with a #qnxvar
SSI
tag. The tag always returns nothing. However, just trying to read the
value with slinger causes some corruption in the ds data. The C program
is
no longer able to read the value from ds. The ds_get() call fails with
an
invalid argument.

Are you specifying the DS_PERM flag when calling ds_create()? The failure
you mention from ds_get() doesn’t seem to match the list of return values
possible. Which error does the ds_get() return:

EBADF Invalid file descriptor dsdes.
EMSGSIZE The buffer isn’t big enough for the data.
ESRCH The variable doesn’t exist in the data server.

Was the QNX 6.1 slinger re-compiled/linked with the fixed QNX 6.1
libds.a?

Yes, Slinger would have to be recompiled for the 6.1 release when we moved
to Dinkum
libs.

-Adam
amallory@qnx.com

Anybody looking into this?

“Dennis Morehart” <demorehart@earthlink.net> wrote in message
news:9mgscl$iq0$1@inn.qnx.com

Our C program remained running and we did not use DS-PERM. We have tried
DS-PERM with the same results.

ds_get() fails with a errno of 22 EINVAL

Dennis

“Operating System for Tech Supp” <> os@qnx.com> > wrote in message
news:9mgdv5$rmt$> 1@nntp.qnx.com> …
Dennis Morehart <> demorehart@earthlink.net> > wrote:
We are using ‘ds’ to store values for our web page which is served by
‘slinger’. We have a C program that registers a variable in ds called
VME_SLOT_Number and then sets the value to “9”. The C program can
read
the
ds value and see “9”. Slinger tries to read the value with a #qnxvar
SSI
tag. The tag always returns nothing. However, just trying to read
the
value with slinger causes some corruption in the ds data. The C
program
is
no longer able to read the value from ds. The ds_get() call fails
with
an
invalid argument.

Are you specifying the DS_PERM flag when calling ds_create()? The
failure
you mention from ds_get() doesn’t seem to match the list of return
values
possible. Which error does the ds_get() return:

EBADF Invalid file descriptor dsdes.
EMSGSIZE The buffer isn’t big enough for the data.
ESRCH The variable doesn’t exist in the data server.

Was the QNX 6.1 slinger re-compiled/linked with the fixed QNX 6.1
libds.a?

Yes, Slinger would have to be recompiled for the 6.1 release when we
moved
to Dinkum
libs.

-Adam
amallory@qnx.com

Dennis Morehart <demorehart@earthlink.net> wrote:

Anybody looking into this?

ds_get() fails with a errno of 22 EINVAL

I can’t seem to recreate the problem. Is there anyway you can send
or post a test case that recreates this? Simply having the error value
isn’t much help if there is a corruption problem (or race condition).

If you wish you can email the support@qnx.com with you plan # if you
desire a more formal method of support.

-Adam
amallory@qnx.com

This code according to the developers demonstrates the problem.

Dennis Morehart
GE Indutrial Systems



\

ds Test Page

The value of "VME_SLOT_Number" is .

\ \ \ #include #include #include #include #include #include #include #include

#define VAR_LEN 60
int verbose=0;

// Usage data for use function
#ifdef __USAGE
%C [-v c l] varname [value]
Where:
-v Verbose.
-q quiet
-c Create variable
-f Set flags to DS_PERM (use with -c)
-l looptime Display variable every looptime seconds 0=single pass
#endif


int main(int argc, char **argv)
{
int c;
char varname[VAR_LEN+1];
char value[VAR_LEN+1];
int create=0, quiet = 0;
int looptime=0;
ds_t data_server;
char flag=0;

// Set default values
strcpy (varname, “”);
strcpy (value, “”);


// parse arguments
while( ( c = getopt( argc, argv, “fvqcl:” )) != -1 )
{
switch( c )
{
case ‘v’:
verbose++;
break;
case ‘q’:
quiet++;
break;
case ‘c’:
create=1;
break;
case ‘f’:
flag = DS_PERM;
break;
case ‘l’:
looptime=atoi (optarg);
break;
default :
if (!quiet)
printf ("\nInvalid argument %s\n", optarg);
exit (-1);
}
}
if (argv[optind] == NULL)
{
if (!quiet)
printf ("\nNo variable name given %s\n", argv[1]);
exit (-1);
}
strcpy (varname, argv[optind]);

if (argv[optind+1] != NULL)
strcpy (value, argv[optind+1]);


// Connect to the data server
if ((data_server= ds_register ( )) == -1)
{
if (!quiet)
printf ("\nUnable to open data server. Error:%s \n",strerror(errno));
exit (-1);
}
if (verbose)
printf ("\nConnected to Data server");

if (create) // Create the variable
{
if ((ds_create ( data_server, varname, flag ,0 )) == -1)
{
if (!quiet)
printf ("\nUnable to create data server name %s. Error:%s\n", varname,
strerror(errno));
exit (-1);
}
if (verbose)
printf ("\nCreated variable %s", varname);
}

if (strlen (value)) // Set the variable
{
if ((ds_set( data_server, varname, value, strlen(value))) == -1)
{
if (!quiet)
printf ("\nUnable to set data server name %s. Error: %s\n", varname,
strerror(errno));
exit (-1);
}
if (verbose)
printf ("\nSet Variable %s to %s", varname, value);
}

while (1)
{
if ((ds_get(data_server,varname,value, VAR_LEN )) == -1)
{
if (!quiet)
printf ("\nUnable to get data server name %s. Error: %s\n", varname,
strerror(errno));
exit (-1);
}
if (!quiet)
printf ("\nData Server Variable %s = %s", varname, value);
else
printf ("%s", value);

if (looptime==0)
break;

sleep (looptime);

}
}