EPICS Controls 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  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [aSub] using external libraries
From: Eric Norum <[email protected]>
To: Pavel Masloff <[email protected]>
Cc: EPICS Tech Talk <[email protected]>
Date: Sun, 13 May 2012 14:10:17 -0700
No, you need only register the init and process functions.  Registering is needed to allow EPICS to find the function address given the name.

From the error messages it might be be that:
- your library routine is inappropriately freeing memory associated with some pointer that you've passed
or
- your code or library routine is accessing memory beyond that which it should.


On May 13, 2012, at 1:35 PM, Pavel Masloff wrote:

Hello,


I'm attempting to use an external library in the subroutine of an aSub record. Do I have to register all the library's functions and variables(in addition to aSubinit and aSubprocess)?
The IOC crashes during the completion of the aSub process subroutine:


*** glibc detected *** ../../bin/linux-x86/waveform: double free or corruption (out): 0x08d816b0 ***
======= Backtrace: =========
/lib/libc.so.6[0x3595a5]
/lib/libc.so.6(cfree+0x59)[0x3599e9]
../../bin/linux-x86/waveform[0x804bba7]
../../bin/linux-x86/waveform[0x804a6af]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/librecIoc.so.3.14[0xb71dde]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14(dbProcess+0x11d)[0x4d4a0d]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14(dbScanPassive+0x4b)[0x4d54db]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14(dbScanFwdLink+0x90)[0x4d5580]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14(recGblFwdLink+0x28)[0x4e88d8]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/librecIoc.so.3.14[0xb89866]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14(dbProcess+0x11d)[0x4d4a0d]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14(dbPutField+0x667)[0x4d5317]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14(db_put_field+0x171)[0x4e6391]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/librsrvIoc.so.3.14[0x11aaeb]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/librsrvIoc.so.3.14(camessage+0xd3)[0x118a33]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/librsrvIoc.so.3.14(camsgtask+0x191)[0x115ec1]
/root/applications/epics/R3-14-12-1/base/lib/linux-x86/libCom.so.3.14[0x15366b]
/lib/libpthread.so.0[0xc8f832]
/lib/libc.so.6(clone+0x5e)[0x3c1e0e]
======= Memory map: ========
00110000-0011e000 r-xp 00000000 fd:00 716657     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/librsrvIoc.so.3.14
0011e000-0011f000 rwxp 0000d000 fd:00 716657     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/librsrvIoc.so.3.14
0011f000-0016d000 r-xp 00000000 fd:00 716118     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libCom.so.3.14
0016d000-00170000 rwxp 0004d000 fd:00 716118     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libCom.so.3.14
00170000-00171000 rwxp 00170000 00:00 0
001c0000-001c2000 r-xp 00000000 fd:00 716397     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libregistryIoc.so.3.14
001c2000-001c3000 rwxp 00001000 fd:00 716397     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libregistryIoc.so.3.14
002ba000-002bb000 r-xp 002ba000 00:00 0          [vdso]
002e3000-002ee000 r-xp 00000000 fd:00 716574     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libasIoc.so.3.14
002ee000-002ef000 rwxp 0000b000 fd:00 716574     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libasIoc.so.3.14
002ef000-002f0000 rwxp 002ef000 00:00 0
002f0000-0042f000 r-xp 00000000 fd:00 1566503    /lib/libc-2.5.so
0042f000-00430000 --xp 0013f000 fd:00 1566503    /lib/libc-2.5.so
00430000-00432000 r-xp 0013f000 fd:00 1566503    /lib/libc-2.5.so
00432000-00433000 rwxp 00141000 fd:00 1566503    /lib/libc-2.5.so
00433000-00436000 rwxp 00433000 00:00 0
004c6000-004fa000 r-xp 00000000 fd:00 716545     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14
004fa000-004fc000 rwxp 00033000 fd:00 716545     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbIoc.so.3.14
004fc000-004fd000 rwxp 004fc000 00:00 0
006df000-0073c000 r-xp 00000000 fd:00 716282     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libca.so.3.14
0073c000-0073f000 rwxp 0005c000 fd:00 716282     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libca.so.3.14
00770000-00775000 r-xp 00000000 fd:00 716949     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libsoftDevIoc.so.3.14
00775000-00776000 rwxp 00004000 fd:00 716949     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libsoftDevIoc.so.3.14
007f8000-00803000 r-xp 00000000 fd:00 1492649    /lib/libgcc_s-4.1.2-20080825.so.1
00803000-00804000 rwxp 0000a000 fd:00 1492649    /lib/libgcc_s-4.1.2-20080825.so.1
00af5000-00b0f000 r-xp 00000000 fd:00 1566497    /lib/ld-2.5.so
00b0f000-00b10000 r-xp 00019000 fd:00 1566497    /lib/ld-2.5.so
00b10000-00b11000 rwxp 0001a000 fd:00 1566497    /lib/ld-2.5.so
00b4f000-00b67000 r-xp 00000000 fd:00 716354     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbStaticIoc.so.3.14
00b67000-00b68000 rwxp 00017000 fd:00 716354     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbStaticIoc.so.3.14
00b68000-00b69000 rwxp 00b68000 00:00 0
00b6a000-00b8b000 r-xp 00000000 fd:00 716839     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/librecIoc.so.3.14
00b8b000-00b8d000 rwxp 00020000 fd:00 716839     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/librecIoc.so.3.14
00c3f000-00c42000 r-xp 00000000 fd:00 716866     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libmiscIoc.so.3.14
00c42000-00c43000 rwxp 00002000 fd:00 716866     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libmiscIoc.so.3.14
00c5b000-00c80000 r-xp 00000000 fd:00 1492646    /lib/libm-2.5.so
00c80000-00c81000 r-xp 00024000 fd:00 1492646    /lib/libm-2.5.so
00c81000-00c82000 rwxp 00025000 fd:00 1492646    /lib/libm-2.5.so
00c84000-00c86000 r-xp 00000000 fd:00 1566509    /lib/libdl-2.5.so
00c86000-00c87000 r-xp 00001000 fd:00 1566509    /lib/libdl-2.5.so
00c87000-00c88000 rwxp 00002000 fd:00 1566509    /lib/libdl-2.5.so
00c8a000-00c9e000 r-xp 00000000 fd:00 1566275    /lib/libpthread-2.5.so
00c9e000-00c9f000 r-xp 00013000 fd:00 1566275    /lib/libpthread-2.5.so
00c9f000-00ca0000 rwxp 00014000 fd:00 1566275    /lib/libpthread-2.5.so
00ca0000-00ca2000 rwxp 00ca0000 00:00 0
00cb9000-00cc0000 r-xp 00000000 fd:00 1566505    /lib/librt-2.5.so
00cc0000-00cc1000 r-xp 00006000 fd:00 1566505    /lib/librt-2.5.so
00cc1000-00cc2000 rwxp 00007000 fd:00 1566505    /lib/librt-2.5.so
00d26000-00d55000 r-xp 00000000 fd:00 1471787    /usr/lib/libreadline.so.5.1
00d55000-00d59000 rwxp 0002f000 fd:00 1471787    /usr/lib/libreadline.so.5.1
00d59000-00d5a000 rwxp 00d59000 00:00 0
00ef1000-00ef4000 r-xp 00000000 fd:00 716610     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbtoolsIoc.so.3.14
00ef4000-00ef5000 rwxp 00003000 fd:00 716610     /root/applications/epics/R3-14-12-1/base/lib/linux-x86/libdbtoolsIoc.so.3.14
00ef5000-00ef6000 rwxp 00ef5000 00:00 0
06c78000-06d58000 r-xp 00000000 fd:00 1470863    /usr/lib/libstdc++.so.6.0.8
06d58000-06d5c000 r-xp 000df000 fd:00 1470863    /usr/lib/libstdc++.so.6.0.8
06d5c000-06d5d000 rwxp 000e3000 fd:00 1470863    /usr/lib/libstdc++.so.6.0.8
06d5d000-06d63000 rwxp 06d5d000 00:00 0
06f5f000-06f9f000 r-xp 00000000 fd:00 1473781    /usr/lib/libncurses.so.5.5
06f9f000-06fa7000 rwxp 00040000 fd:00 1473781    /usr/lib/libncurses.so.5.5
06fa7000-06fa8000 rwxp 06fa7000 00:00 0
08048000-0804d000 r-xp 00000000 fd:00 756053     /root/applications/epics/R3-14-12-1/apps/WF/bin/linux-x86/waveform
0804d000-0804e000 rw-p 00005000 fd:00 756053     /root/applications/epics/R3-14-12-1/apps/WF/bin/linux-x86/waveform
08cf2000-08d9e000 rw-p 08cf2000 00:00 0          [heap]
b742d000-b74a8000 rw-p b742d000 00:00 0
b74a8000-b74a9000 ---p b74a8000 00:00 0
b74a9000-b7529000 rw-p b74a9000 00:00 0
b7529000-b752a000 ---p b7529000 00:00 0
b752a000-b75ab000 rw-p b752a000 00:00 0
b75ab000-b77ab000 r--p 00000000 fd:00 1489920    /usr/lib/locale/locale-archive
b77ab000-b77ac000 ---p b77ab000 00:00 0
b77ac000-b77ec000 rw-p b77ac000 00:00 0
b77ec000-b77ed000 ---p b77ec000 00:00 0
b77ed000-b780d000 rw-p b77ed000 00:00 0
b780d000-b780e000 ---p b780d000 00:00 0
b780e000-b784e000 rw-p b780e000 00:00 0
b784e000-b784f000 ---p b784e000 00:00 0
b784f000-b78cf000 rw-p b784f000 00:00 0
b78cf000-b78d0000 ---p b78cf000 00:00 0
b78d0000-b7950000 rw-p b78d0000 00:00 0
b7950000-b7951000 ---p b7950000 00:00 0
b7951000-b79d1000 rw-p b7951000 00:00 0
b79d1000-b79d2000 ---p b79d1000 00:00 0
b79d2000-b7a52000 rw-p b79d2000 00:00 0
b7a52000-b7a53000 ---p b7a52000 00:00 0
b7a53000-b7ad3000 Aborted

--
Best regards,


Pavel Maslov, MS
Controls Engineer at Pulsed power Lab
Efremov Institute for Electro-Physical Apparatus
St. Petersburg, Russia

Mobile: +7 (951) 672 22 19
Landline: +7 (812) 461 01 01


-- 
Eric Norum
[email protected]





References:
[aSub] using external libraries Pavel Masloff

Navigate by Date:
Prev: Re: [CA][waveform] how to NELM? Pavel Masloff
Next: Re: RE: Problem installing CA for QT manta santosh aditya santosh_aditya
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: [aSub] using external libraries Pavel Masloff
Next: cPCI express Urša Rojec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·