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  2015  2016  <2017 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
<== Date ==> <== Thread ==>

Subject: Re: Segmentation fault at dbConvert.c in Ubuntu 32/64 bit
From: Ralph Lange <ralph.lange@gmx.de>
To: Carsten Winkler <carsten.winkler@helmholtz-berlin.de>
Cc: EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Tue, 21 Feb 2017 09:54:20 +0100
Hi Carsten,

The default value for precision used when you comment out the lines you mention is 6.
Can you achieve the same (i.e. avoid segfaults) by setting PREC to 6 in your database?
If yes: which PREC values cause segfaults?

Cheers,
~Ralph


On Tue, Feb 21, 2017 at 9:15 AM, Carsten Winkler <carsten.winkler@helmholtz-berlin.de> wrote:
I forgot to give you the used db entry. Here it is:

record(waveform, "caLab:waveString")
{
    field(DESC, "String waveform record")
    field(NELM, 48)
    field(FTVL, "STRING")
    field (PINI, "YES")
    field (PREC, 3)
}


Am 20.02.2017 um 15:40 schrieb Carsten Winkler:
> Hi there,
>
> I always run into a  "Segmentation fault" in function "putFloatString" |
> "putDoubleString" of BASE/src/db/dbConvert.c
>
> When I comment out following lines (call of get_precision) everything is
> working again:
> 3947
> 3948
> 4157
> 4158
>
> Test system
> =================================================
> Ubunu 16.04 (64 bit)
> EPICS BASE 3.14.12.6 (64 bit)
>
>
> To check the error, I used this code:
> test.cpp
> =================================================
>
> #include <malloc.h>
> #include <cadef.h>
> //#define DOUBLE
>
> using namespace std;
>
> int main() {
>     chid chanID;
>     int iNumber = 1;
>     int timeout = 0;
>     void *pValue = 0x0;
>
>     ca_context_create(ca_enable_preemptive_callback);
> #if defined DOUBLE
>     pValue = (double*)malloc(iNumber*sizeof(double));
>     for(int i=0; i<iNumber; i++) {
>         ((double*)pValue)[i] = (double)((1+i)*3.1415926535897);
>     }
> #else
>     pValue = (float*)malloc(iNumber*sizeof(float));
>     for(int i=0; i<iNumber; i++) {
>         ((float*)pValue)[i] = (float)((1+i)*3.1415926535897);
>     }
> #endif
>     ca_create_channel("caLab:waveString", 0, 0, 50, &chanID);
>     timeout = 3000;
>     while(ca_state(chanID) != cs_conn && timeout--) {
>         epicsThreadSleep(.001);
>     }
> #if defined DOUBLE
>     ca_array_put(DBR_DOUBLE, 1, chanID, pValue);
> #else
>     ca_array_put(DBR_FLOAT, 1, chanID, pValue);
> #endif
>     ca_context_destroy();
>     free(pValue);
>     return 0;
> }
>
> g++ -I/usr/local/epics/base-3.14.12.6/include/os/Linux
> -I/usr/local/epics/base-3.14.12.6/include -O0 -g3 -Wall -c
> -fmessage-length=0 -MMD -MP -MF"test.d" -MT"test.d" -o "test.o" "test.cpp"
> g++ -L/usr/local/epics/base-3.14.12.6/lib/linux-x86_64 -o "test"
> test.o   -lCom -lca
>
> Any advice to solve this issue?
>
> Best regards
> Carsten Winkler
>
> PS Same problem in 32 bit systems
>
>
> ________________________________
>
> Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
>
> Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.
>
> Aufsichtsrat: Vorsitzender Dr. Karl Eugen Huthmacher, stv. Vorsitzende Dr. Jutta Koch-Unterseher
> Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking
>
> Sitz Berlin, AG Charlottenburg, 89 HRB 5583
>
> Postadresse:
> Hahn-Meitner-Platz 1
> D-14109 Berlin
>
> http://www.helmholtz-berlin.de
>


________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Karl Eugen Huthmacher, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de



Replies:
RE: Segmentation fault at dbConvert.c in Ubuntu 32/64 bit freddie.akeroyd
References:
Segmentation fault at dbConvert.c in Ubuntu 32/64 bit Carsten Winkler
Re: Segmentation fault at dbConvert.c in Ubuntu 32/64 bit Carsten Winkler

Navigate by Date:
Prev: Re: Segmentation fault at dbConvert.c in Ubuntu 32/64 bit Carsten Winkler
Next: RE: Segmentation fault at dbConvert.c in Ubuntu 32/64 bit freddie.akeroyd
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
Navigate by Thread:
Prev: Re: Segmentation fault at dbConvert.c in Ubuntu 32/64 bit Carsten Winkler
Next: RE: Segmentation fault at dbConvert.c in Ubuntu 32/64 bit freddie.akeroyd
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
ANJ, 21 Feb 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·