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: ioc crashing while using asyn & modbus
From: Mark Rivers <rivers@cars.uchicago.edu>
To: Eric Norum <eric@norum.ca>, Gary Croke <gcroke@jlab.org>
Cc: EPICS Tech-Talk <tech-talk@aps.anl.gov>
Date: Wed, 12 Jul 2017 22:51:51 +0000
The code at line 252 is:

    status = pioPvt->pasynOctet->flush(pioPvt->octetPvt,pasynUser);

Since it appears to be getting the access violation at that line, and not in the flush() routine it suggests that something is wrong with one or more of the following pointers.
pioPvt
pioPvt->pasynOctet
pioPvt->octetPvt
pasynUser

You can probably examine these with gdb when it crashes.  If that does not work you can print their values on each call (using %p format) just before line 252 to see if one or more is NULL.

Before this crash occurred had there been device timeouts?

Mark

________________________________
From: Eric Norum [eric@norum.ca]
Sent: Wednesday, July 12, 2017 3:11 PM
To: Gary Croke
Cc: Mark Rivers
Subject: Re: ioc crashing while using asyn & modbus

What’s the code at line 252 doing?  I don’t have the source for asyn 4.31 handy to check.  Aysn 4.30 has a call to to the Octet flush method there.
Is there anything else at all in this IOC?  If so, could you strip it down as far as possible to ensure that it’s not some other code corrupting the stack or something like that.  I’ve got quite a few IOCs running the MODBUS code and haven’t seen any problems.
On Jul 12, 2017, at 1:00 PM, Gary Croke <gcroke@jlab.org<mailto:gcroke@jlab.org>> wrote:

Hi Mark,

Thanks for quick response.  Here's the output from gdb at the fault, and the output of the bt command:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb1d45b70 (LWP 16755)]
0x001562d0 in writeRead (pasynUser=0x817839c, write_buffer=0x8178b04 "\004\003\f-", write_buffer_len=6, read_buffer=0x8178d5c "\003\070C\216ñÅC\217\221L", read_buffer_len=10, timeout=2,
   nbytesOut=0xb1d451bc, nbytesIn=0xb1d451b8, eomReason=0xb1d451b4) at ../../asyn/interfaces/asynOctetSyncIO.c:252
252     status = pioPvt->pasynOctet->flush(pioPvt->octetPvt,pasynUser);
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.192.el6.i686 libgcc-4.4.7-17.el6.i686 libstdc++-4.4.7-17.el6.i686 ncurses-libs-5.7-4.20090207.el6.i686 readline-6.0-4.el6.i686
(gdb) bt
#0  0x001562d0 in writeRead (pasynUser=0x817839c, write_buffer=0x8178b04 "\004\003\f-", write_buffer_len=6, read_buffer=0x8178d5c "\003\070C\216ñÅC\217\221L", read_buffer_len=10,
   timeout=2, nbytesOut=0xb1d451bc, nbytesIn=0xb1d451b8, eomReason=0xb1d451b4) at ../../asyn/interfaces/asynOctetSyncIO.c:252
#1  0x001ac3b0 in doModbusIO (pPlc=<value optimized out>, slave=10, function=3, start=3117, data=0x8176b78, len=4) at ../drvModbusAsyn.c:1730
#2  0x001ae6da in readPoller (pPlc=0x81789c0) at ../drvModbusAsyn.c:1322
#3  0x0030c7ea in start_routine (arg=0x817a340) at ../../../src/libCom/osi/os/posix/osdThread.c:385
#4  0x0032ebc9 in start_thread () from /lib/libpthread.so.0
#5  0x00491dee in clone () from /lib/libc.so.6
(gdb)

--
Eric Norum
eric@norum.ca<mailto:eric@norum.ca>





References:
ioc crashing while using asyn & modbus Gary Croke
Re: ioc crashing while using asyn & modbus Mark Rivers
Re: ioc crashing while using asyn & modbus Gary Croke

Navigate by Date:
Prev: Re: How to compile only for a target architecture Andrew Johnson
Next: Re: ioc crashing while using asyn & modbus 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
Navigate by Thread:
Prev: Re: ioc crashing while using asyn & modbus Gary Croke
Next: Re: ioc crashing while using asyn & modbus Torsten Bögershausen
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, 13 Jul 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·