Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

DevString Forwarded Attribute: is it possible? #512

Closed
alexElettra opened this issue Jan 10, 2019 · 1 comment
Closed

DevString Forwarded Attribute: is it possible? #512

alexElettra opened this issue Jan 10, 2019 · 1 comment
Labels

Comments

@alexElettra
Copy link

alexElettra commented Jan 10, 2019

Hello,
I have created a very simple ds with pogo 9.4.5: it has only one FwdAttr, compile: ok,
db config of __root_att with the string_scalar attribute of TangoTest.
At the very first read of the FwdAttr I get a seg fault:

 (gdb) bt
#0  0xb76eb424 in __kernel_vsyscall ()
#1  0xb6757681 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xb675aab2 in *__GI_abort () at abort.c:92
#3  0xb679124d in __libc_message (do_abort=2, fmt=0xb6868e58 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#4  0xb679b341 in malloc_printerr (action=<value optimized out>, str=0x6 <Address 0x6 out of bounds>, ptr=0x975f8b0) at malloc.c:6266
#5  0xb679c5be in munmap_chunk (p=<value optimized out>) at malloc.c:3540
#6  0xb698c741 in operator delete(void*) () from /usr/lib/libstdc++.so.6
#7  0xb698c79d in operator delete[](void*) () from /usr/lib/libstdc++.so.6
#8  0xb7348b34 in Tango::Attribute::set_value (this=0x978f2c0, p_data=0x975f8b0, x=1, y=0, release=true) at ../../../../lib/cpp/server/attrsetval.cpp:746
#9  0xb7348d0b in Tango::Attribute::set_value_date_quality (this=0x978f2c0, p_data=0x975f8b0, t=..., qual=Tango::ATTR_VALID, x=1, y=0, release=<value optimized out>)
    at ../../../../lib/cpp/server/attrsetval.cpp:1947
#10 0xb741f770 in void Tango::FwdAttribute::set_local_attribute<Tango::DevVarStringArray>(Tango::DeviceAttribute&, Tango::DevVarStringArray*&) () from /usr/local/tango-9.2.5a/lib/libtango.so.9
#11 0xb741bdbc in Tango::FwdAttr::read (this=0x9771998, dev=0x9771e70, attr=...) at ../../../../lib/cpp/server/fwdattrdesc.cpp:380
#12 0xb73a7107 in Tango::Device_3Impl::read_attributes_no_except (this=0x9771e70, names=..., aid=..., second_try=true, idx=...) at ../../../../lib/cpp/server/device_3.cpp:541
#13 0xb73b7c22 in Tango::Device_4Impl::read_attributes_4 (this=0x9771e70, names=..., source=Tango::CACHE_DEV, cl_id=...) at ../../../../lib/cpp/server/device_4.cpp:727
#14 0xb75b57fe in _0RL_lcfn_6fe2f94a21a10053_c3000000 (cd=0xa7a66914, svnt=0x97722a4) at tangoSK.cpp:5510
#15 0xb6f4d748 in omniCallHandle::upcall(omniServant*, omniCallDescriptor&) () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#16 0xb75c144e in Tango::_impl_Device_4::_dispatch (this=0x97722a0, _handle=...) at tangoSK.cpp:5966
#17 0xb75c7c32 in Tango::_impl_Device_5::_dispatch (this=0x97722a0, _handle=...) at tangoSK.cpp:7478
#18 0xb6f3857a in omni::omniOrbPOA::dispatch(omniCallHandle&, omniLocalIdentity*) () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#19 0xb6f16916 in omniLocalIdentity::dispatch(omniCallHandle&) () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#20 0xb6f73bc1 in omni::GIOP_S::handleRequest() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#21 0xb6f759f5 in omni::GIOP_S::dispatcher() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#22 0xb6f70b97 in omni::giopWorker::execute() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#23 0xb6f0bb5d in omniAsyncWorker::real_run() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#24 0xb6f0bfcb in omniServerWorkerInfo::run() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#25 0xb6f0d0da in omniAsyncPoolServer::workerRun(omniAsyncWorker*) () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#26 0xb6f0c4cb in omniAsyncWorker::mid_run() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#27 0xb6f0c7cb in omniAsyncWorkerInfo::run() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#28 0xb756e2ae in Tango::create_PyPerThData (info=...) at ../../../../lib/cpp/server/utils.cpp:3234
#29 0xb6f0c7b9 in omniAsyncWorkerInfo::run() () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#30 0xb6f0d1b2 in omniAsyncWorker::run(void*) () from /usr/local/omniorb-4.2.1/lib/libomniORB4.so.2
#31 0xb6a43687 in omni_thread_wrapper () from /usr/local/omniorb-4.2.1/lib/libomnithread.so.4
#32 0xb671896e in start_thread (arg=0xa7a67b70) at pthread_create.c:300
#33 0xb68003fe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
(gdb) f 8
#8  0xb7348b34 in Tango::Attribute::set_value (this=0x978f2c0, p_data=0x975f8b0, x=1, y=0, release=true) at ../../../../lib/cpp/server/attrsetval.cpp:746
746					SAFE_DELETE(p_data);
(gdb) p *p_data
$14 = (Tango::DevString) 0x9772738 "ValueOfStringScalar"

If I try with a DevDouble root attribute the ds with the FwdAttr works well.
Where am I wrong?
In the docs I do not see any warning about DevString forwarded attributes...

Thank you in advance,
Alessandro

@bourtemb bourtemb added the bug label Jan 10, 2019
@bourtemb
Copy link
Member

Hi Alessandro,

Thank you very much for the detailed bug report. It is indeed easy to reproduce.
It seems the problem occurs with DevString RW attributes.
It does not seem to happen with DevString Read Only attributes or DevString Write Only attributes.
The case you encountered is currently not tested by the test suite which is currently testing the following root attributes types when reading a forwarded attribute:

  • DevShort RW
  • DevString Write Only
  • DevDouble Spectrum Write Only
  • DevString Image RW

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants