The first thing you should do is fix this error:
dbLoadRecords "db/project.db"
Can't set "wafData.INP" to "vmeInput.BINP"
Error at or before ")" in file "db/project.db" line 29
You have a syntax error in line 29 of project.db.
When your application crashed it produced a core dump file. That is good, since you can then run the gdb debugger on it. Here is how:
cd to the bin/linux-x86/myExample directory
At the Linux prompt type
gdb ../../bin/linux-x86/myExample core.xxxx
where xxxx is the number of one of the core files in that directory.
At the gdb prompt type
backtrace
That will show you exactly what function, and hopefully what line, was executing when it crashed.
Even more simply you can just put printf() statements at the areas that are likely to be causing the crash, like the call to dbGet().
Mark
________________________________
From: [email protected] [[email protected]] on behalf of ishita bhatia [[email protected]]
Sent: Friday, July 24, 2015 6:57 AM
To: EPICS Tech-Talk
Subject: Segmentation fault(core dumped) Error
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<http://127.0.0.1:5065>") error was "Connection refused"
Value=5
../online_notify.c: CA beacon (send to "127.0.0.1:5065<http://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<http://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
- References:
- Segmentation fault(core dumped) Error ishita bhatia
- Navigate by Date:
- Prev:
Segmentation fault(core dumped) Error ishita bhatia
- Next:
areaDetector and ADCore R2-3 released Mark Rivers
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Segmentation fault(core dumped) Error ishita bhatia
- Next:
areaDetector and ADCore R2-3 released Mark Rivers
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|