EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Scalcout data corruption on darwin-x86 with x86_64 arch class
From: "J. Lewis Muir" <jlmuir@anl.gov>
To: EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Thu, 18 Aug 2011 13:22:30 -0500
I'm having what appears to be a data corruption problem with the
scalcout record on darwin-x86 with the x86_64 architecture class.

I load the attached scalcout-corrupt.db in a soft IOC like this:

  dbLoadRecords("scalcout-corrupt.db","P=ioc23:")

The database just has a stringin record and 10 scalcout records
that all use the SSCANF function to parse the VAL field of the
stringin record to obtain an integer value (1000 in this case).

Then, in a Bash shell, I do this:

  $ caget ioc23:RealTime{0,1,2,3,4,5,6,7,8,9}.{VAL,SVAL}
  ioc23:RealTime0.VAL            1.40733e+14
  ioc23:RealTime0.SVAL           140733193389032.000
  ioc23:RealTime1.VAL            1000
  ioc23:RealTime1.SVAL           1000.00000000
  ioc23:RealTime2.VAL            1.40733e+14
  ioc23:RealTime2.SVAL           140733193389032.000
  ioc23:RealTime3.VAL            3.00648e+10
  ioc23:RealTime3.SVAL           30064772072.000
  ioc23:RealTime4.VAL            1.40733e+14
  ioc23:RealTime4.SVAL           140733193389032.000
  ioc23:RealTime5.VAL            1000
  ioc23:RealTime5.SVAL           1000.00000000
  ioc23:RealTime6.VAL            1.40733e+14
  ioc23:RealTime6.SVAL           140733193389032.000
  ioc23:RealTime7.VAL            1000
  ioc23:RealTime7.SVAL           1000.00000000
  ioc23:RealTime8.VAL            4.29497e+09
  ioc23:RealTime8.SVAL           4294968296.000
  ioc23:RealTime9.VAL            1000
  ioc23:RealTime9.SVAL           1000.00000000

I expect all of the VAL and SVAL fields to have the value 1000,
but obviously they don't.  Some of them are completely wrong.

If I use the i386 architecture class, it works fine.

If I use the x86_64 architecture class, but change the '%d' to
'%f' in the SSCANF function, it works fine.

Environment:
* Processor: 2.3 GHz Intel Core i7
* Memory: 8 GB
* OS: Mac OS X 10.6.8
* EPICS Base 3.14.12.1 (+ Known Problems patches)
* EPICS host architecture: darwin-x86
* EPICS architecture class: x86_64
* SynApps calc 2-8
* GCC 4.2.1

Any ideas?  Can anyone reproduce this problem for darwin-x86
with the x86_64 architecture class?  What about linux-x86_64?

Thanks,

Lewis

-- 
J. Lewis Muir
Software Engineer
IMCA-CAT
#
# Demonstrates scalcout data corruption on 64-bit IOC (darwin-x86 with x86_64
# architecture class; EPICS Base 3.14.12.1 + Known Problems patches).  Works
# OK with i386 architecture class IOC.  Works OK with x86_64 architecture
# class if use '%f' instead of '%d'.
#
# Parameters:
#   P  PV prefix (e.g. ioc23:)
#

record(stringin, "$(P)ReadRealTime") {
  field(VAL, "!MS 1000")
  field(FLNK, "$(P)RealTime0")
  field(PINI, "YES")
}

record(scalcout, "$(P)RealTime0") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime1")
}

record(scalcout, "$(P)RealTime1") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime2")
}

record(scalcout, "$(P)RealTime2") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime3")
}

record(scalcout, "$(P)RealTime3") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime4")
}

record(scalcout, "$(P)RealTime4") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime5")
}

record(scalcout, "$(P)RealTime5") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime6")
}

record(scalcout, "$(P)RealTime6") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime7")
}

record(scalcout, "$(P)RealTime7") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime8")
}

record(scalcout, "$(P)RealTime8") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
  field(FLNK, "$(P)RealTime9")
}

record(scalcout, "$(P)RealTime9") {
  field(INAA, "$(P)ReadRealTime.VAL NPP MS")
  field(CALC, "SSCANF(AA,'!MS %d')")
}

Replies:
Re: Scalcout data corruption on darwin-x86 with x86_64 arch class Andrew Johnson

Navigate by Date:
Prev: Re: EPICS BOY saying EPICS PV is disconnected even though to can be read through the terminal with no issues Kasemir, Kay
Next: Re: Scalcout data corruption on darwin-x86 with x86_64 arch class Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: CAJ host name quirk Re: EPICS BOY ... Matej Sekoranja
Next: Re: Scalcout data corruption on darwin-x86 with x86_64 arch class Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019