Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: side-effect of malloc() in startup file
From: "Peregrine M. McGehee" <peregrine@lanl.gov>
To: tech-talk@aps.anl.gov
Date: Wed, 24 Jul 2002 16:20:22 -0600
Has anyone ever seen...

Usage of malloc() in startup file causes tShell to crash
during iocInit on data access violation. Channel access
is still running.

Commenting out of the iocInit call in the startup file and 
entering it by hand at the console works, however! The
death of tShell persists even with a taskDelay(600), or
10 seconds, just before the iocInit call so this is not a
timing issue.

This occurs on the following IOC (PPC; EPICS R3.13.5; vxWorks 5.4).
Similar code for a different application runs successfully on
another IOC (same arch and OS) so I suspect it's something local.

Specifically, this 

utilsubst = malloc(200)
# kludge
# ulilsubst = "SYS=reallylongname, INST=reallylongname")
sprintf(utilsubst, "SYS=%s, INST=%s", SYS, INST)
dbLoadRecords("../../db/snsUtilEnviron.db",
utilsubst)                                                                               

causes the following at iocInit:

Starting iocInit
value = 0 = 0x0
data access
Exception current instruction address: 0x0015f644
Machine Status Register: 0x0000b030
Data Access Register: 0x17a0842f
Condition Register: 0x44200082
Data storage interrupt Register: 0x0000b030

18eee8
data access
Exception current instruction address: 0x0015f644
Machine Status Register: 0x0000b030
Data Access Register: 0x17a0842f
Condition Register: 0x24200082
Data storage interrupt Register: 0x0000b030

- Peregrine
-- 
Peregrine M. McGehee	peregrine@lanl.gov	(505) 667-3273
Sloan Digital Sky Survey / Spallation Neutron Source
MS H820, Los Alamos National Laboratory, Los Alamos, NM 87545

Replies:
Re: side-effect of malloc() in startup file Peregrine M. McGehee

Navigate by Date:
Prev: Re: ISEG VHQ204L Driver J. Frederick Bartlett (bartlett@fnal.gov)
Next: seq-1.9.6-beta redux Laznovsky, Michael
Index: 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017 
Navigate by Thread:
Prev: Tornado-2 arp-table Bernd Schoeneburg
Next: Re: side-effect of malloc() in startup file Peregrine M. McGehee
Index: 1994  1995  1996  1997  1998  1999  2000  2001  <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·