Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
5bff35e9
Commit
5bff35e9
authored
Jan 06, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Попытка решить проблеммы с SIGSEGV при выходе из программы.
parent
4a406f56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
31 deletions
+46
-31
tests_with_sm.sh
extensions/ModbusMaster/tests/tests_with_sm.sh
+3
-2
UniSetActivator.cc
src/ObjectRepository/UniSetActivator.cc
+25
-24
UniSetManager.cc
src/ObjectRepository/UniSetManager.cc
+10
-4
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+8
-1
No files found.
extensions/ModbusMaster/tests/tests_with_sm.sh
View file @
5bff35e9
...
...
@@ -8,7 +8,8 @@ cd ../../../Utilities/Admin/
./uniset2-start.sh
-f
./exist |
grep
-q
UNISET_PLC/Controllers
||
exit
1
cd
-
./uniset2-start.sh
-
g
./tests-with-sm
$*
--
--confile
mbmaster-test-configure.xml
--e-startup-pause
10
\
./uniset2-start.sh
-
f
./tests-with-sm
$*
--
--confile
mbmaster-test-configure.xml
--e-startup-pause
10
\
--mbs-name
MBSlave1
--mbs-type
TCP
--mbs-inet-addr
127.0.0.1
--mbs-inet-port
20048
--mbs-my-addr
0x01
\
--mbs-askcount-id
SVU_AskCount_AS
--mbs-respond-id
RespondRTU_S
--mbs-respond-invert
1
\
--mbs-filter-field
mbs
--mbs-filter-value
1
--ulog-add-levels
any
--mbs-filter-field
mbs
--mbs-filter-value
1
# --ulog-add-levels any --dlog-add-levels any
src/ObjectRepository/UniSetActivator.cc
View file @
5bff35e9
...
...
@@ -140,9 +140,19 @@ void UniSetActivator::init()
UniSetActivator
::~
UniSetActivator
()
{
if
(
orbthr
)
{
orbthr
->
stop
();
if
(
orbthr
->
isRunning
()
)
orbthr
->
join
();
delete
orbthr
;
orbthr
=
0
;
}
if
(
!
procterm
)
{
ulogsys
<<
myname
<<
"(destructor): ..."
<<
endl
<<
flush
;
ulogsys
<<
myname
<<
"(destructor): ..."
<<
endl
<<
flush
;
if
(
!
omDestroy
)
oaDestroy
();
...
...
@@ -152,16 +162,6 @@ UniSetActivator::~UniSetActivator()
gActivator
.
reset
();
}
if
(
orbthr
)
{
orbthr
->
stop
();
if
(
orbthr
->
isRunning
()
)
orbthr
->
join
();
delete
orbthr
;
orbthr
=
0
;
}
#if 0
try
{
...
...
@@ -220,7 +220,7 @@ void UniSetActivator::oaDestroy(int signo)
}
catch
(...){}
}
}
try
{
ulogsys
<<
myname
<<
"(stop):: shutdown orb... "
<<
endl
;
...
...
@@ -241,15 +241,6 @@ void UniSetActivator::oaDestroy(int signo)
}
catch(...){}
#endif
/*
if( orbthr )
{
delete orbthr;
orbthr = 0;
}
*/
}
// waittermMutex.unlock();
}
// ------------------------------------------------------------------------------------------
...
...
@@ -261,7 +252,7 @@ void UniSetActivator::oaDestroy(int signo)
* Иначе все ресурсы основного потока передаются для обработки приходящих сообщений (и она не выходит)
*
*/
void
UniSetActivator
::
run
(
bool
thread
)
void
UniSetActivator
::
run
(
bool
thread
)
{
ulogsys
<<
myname
<<
"(run): создаю менеджер "
<<
endl
;
...
...
@@ -502,7 +493,7 @@ void UniSetActivator::terminated( int signo )
if
(
gActivator
)
{
UniSetActivator
::
set_signals
(
false
);
gActivator
.
reset
();
//
gActivator.reset();
}
sigset
(
SIGALRM
,
SIG_DFL
);
...
...
@@ -524,7 +515,7 @@ void UniSetActivator::normalexit()
void
UniSetActivator
::
normalterminate
()
{
if
(
gActivator
)
ucrit
<<
gActivator
->
getName
()
<<
"(default exception terminate):
Никто не выловил исключение!!!
Good bye."
<<
endl
<<
flush
;
ucrit
<<
gActivator
->
getName
()
<<
"(default exception terminate):
Unkown exception..
Good bye."
<<
endl
<<
flush
;
// abort();
// std::exception_ptr p = std::current_exception();
...
...
@@ -544,6 +535,16 @@ void UniSetActivator::term( int signo )
try
{
ulogsys
<<
myname
<<
"(term): вызываем sigterm()"
<<
endl
;
if
(
orbthr
)
{
orbthr
->
stop
();
if
(
orbthr
->
isRunning
()
)
orbthr
->
join
();
delete
orbthr
;
orbthr
=
0
;
}
sigterm
(
signo
);
s_term
.
emit
(
signo
);
ulogsys
<<
myname
<<
"(term): sigterm() ok."
<<
endl
;
...
...
src/ObjectRepository/UniSetManager.cc
View file @
5bff35e9
...
...
@@ -47,8 +47,11 @@ class MPush: public unary_function< const std::shared_ptr<UniSetManager>& , bool
{
try
{
m
->
push
(
msg
);
m
->
broadcast
(
msg
);
if
(
m
)
{
m
->
push
(
msg
);
m
->
broadcast
(
msg
);
}
return
true
;
}
catch
(...){}
...
...
@@ -68,8 +71,11 @@ class OPush: public unary_function< const std::shared_ptr<UniSetObject>& , bool>
{
try
{
o
->
push
(
msg
);
return
true
;
if
(
o
)
{
o
->
push
(
msg
);
return
true
;
}
}
catch
(...){}
return
false
;
...
...
src/ObjectRepository/UniSetObject.cc
View file @
5bff35e9
...
...
@@ -783,7 +783,14 @@ void UniSetObject::callback()
if
(
waitMessage
(
msg
)
)
processingMessage
(
&
msg
);
}
catch
(...){}
catch
(
Exception
&
ex
)
{
ucrit
<<
ex
<<
endl
;
}
catch
(
std
::
exception
&
ex
)
{
ucrit
<<
ex
.
what
()
<<
endl
;
}
}
// ------------------------------------------------------------------------------------------
void
UniSetObject
::
processingMessage
(
UniSetTypes
::
VoidMessage
*
msg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment