EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Segmentation fault(core dumped) Error
From: ishita bhatia <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Fri, 24 Jul 2015 17:27:44 +0530
Hello,
I have created a device support to fetch data from waveform record and this waveform record gets input from asyn record. When I run ioc I get error as Segmentation fault(core dumped).
kindly suggest how to resolve this error.

[srk@srk VME]$ cd iocBoot/iocmyExample/
[srk@srk iocmyExample]$ ./st.cmd
#!../../bin/linux-x86/myExample
## You may have to change myExample to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet("ARCH","linux-x86")
epicsEnvSet("IOC","iocmyExample")
epicsEnvSet("TOP","/home/srk/VME")
epicsEnvSet("ASYN","/home/srk/EPICS/R3.14.12.1/synApps_5_7/support/asyn-4-21")
epicsEnvSet("CALC","/home/srk/EPICS/R3.14.12.1/synApps_5_7/support/calc-3-2")
epicsEnvSet("EPICS_BASE","/home/srk/EPICS/R3.14.12.1/base")
cd /home/srk/VME
## Register all support components
dbLoadDatabase "dbd/myExample.dbd"
myExample_registerRecordDeviceDriver pdbbase
## initialize port for test serial
drvAsynSerialPortConfigure("L2","/dev/ttyS0",0,0,0)
asynSetOption("L2",-1,"baud","19200")
asynSetOption("L2",-1,"bits","8")
asynSetOption("L2",-1,"parity","none")
asynSetOption("L2",-1,"stop","1")
asynSetOption("L2",-1,"clocal","Y")
## Load record instances
dbLoadTemplate "db/userHost.substitutions"
dbLoadRecords "db/dbSubExample.db", "user=srkHost"
dbLoadRecords "db/project.db"
Can't set "wafData.INP" to "vmeInput.BINP"
Error at or before ")" in file "db/project.db" line 29
## Set this to see messages from mySub
#var mySubDebug 1
## Run this to trace the stages of iocInit
#traceIocInit
cd /home/srk/VME/iocBoot/iocmyExample
iocInit
Starting iocInit
############################################################################
## EPICS R3.14.12.1 $Date: Tue 2011-04-26 15:36:19 -0500$
## EPICS Base built Oct  7 2014
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncExample, "user=srkHost"
../online_notify.c: CA beacon (send to "127.0.0.1:5065") error was "Connection refused"

Value=5
../online_notify.c: CA beacon (send to "127.0.0.1:5065") error was "Connection refused"

Value=5
epics> 
Value=5

Value=5

Value=5

Value=5
../online_notify.c: CA beacon (send to "127.0.0.1:5065") error was "Connection refused"

Value=5

Value=5

Value=5

Value=5

Value=5

Value=5

Value=5

Value=5

Value=5

Value=5
Segmentation fault (core dumped)
[srk@srk iocmyExample]$ 



db file is as follows:

record(asyn, vmeInput) {
  field(SCAN, "1 second")
  field(DTYP, "asynRecordDevice")
  field(FLNK, "wafData")
  field(PORT, "L2")
  field(TMOD, "Write/Read")
  field(IFACE, "asynOctet")
  field(AOUT, "ST03@U#PKT01!")
  field(OFMT, "ASCII")
  field(NRRD, "80")
  field(IFMT, "Hybrid")
  field(BAUD, "19200")
  field(PRTY, "None")
  field(DBIT, "8")
  field(SBIT, "1")
  field(CNCT, "Connect")
  field(ENBL, "Enable")
}

record(waveform, wafData) {
  field(SCAN, "Passive")
  field(DTYP, "wafsupport")
  field(INP, "vmeInput.BINP")
  field(NELM, "72")
  field(FTVL, "CHAR")
  field(FLNK, "forwardlink")
}

record(ai, analogInput) {
  field(SCAN, ".1 second")
  field(DTYP, "aisupport")
}

DEVICE SUPPORT I have created is as follows:

#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <math.h>
#include <stdlib.h>

#include "alarm.h"
#include "cvtTable.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include "aiRecord.h"
#include "waveformRecord.h"
#include "epicsExport.h"

//static int v=1;
static int v=2,y=3,z; 
//long n;
//char myptr[72];
//struct DBADDR *paddr;

static long read_aiValue();
//static long read_aiValue1();
static long read_waveform();

// structure for ai

struct
 {
long   number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_aiValue;
DEVSUPFUN special_linconv;
}
devmyai = {
6,
NULL,
NULL,
NULL,
NULL,
read_aiValue,
NULL};
epicsExportAddress(dset,devmyai);


//------------STRUCTURE FOR WAVEFORM---------
struct
{
long   number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_waveform;
}
devmywaveform = {
     5,
     NULL,
     NULL,
              NULL,
     NULL,
              read_waveform};
epicsExportAddress(dset,devmywaveform);


static long read_aiValue(pai)
struct aiRecord *pai;
{
//static int v=2,y=3,z;
pai->val=(v+y);
z=(v+y);
printf("\nValue=%d\n",z);
return(2);

}


static long read_waveform(pwaf)
struct waveformRecord *pwaf;
{
long int n;
char myptr[100];
struct dbAddr *paddr;
//long status,n;
n = pwaf->nelm;
paddr = dbGetPdbAddrFromLink(&pwaf->inp);
dbGet(paddr,pwaf->ftvl,(void *)myptr,0,&n,NULL);
        //printf("\nstatus=%s\n",myptr);
return 0;
}

Please help me with this error.
Thanks in advance


Replies:
RE: Segmentation fault(core dumped) Error Mark Rivers

Navigate by Date:
Prev: Re: IOC command from another termianl Vikram Bhagat
Next: RE: Segmentation fault(core dumped) Error Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: IOC command from another termianl Vikram Bhagat
Next: RE: Segmentation fault(core dumped) Error Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·