I have a windows service where I create another appdomains. In the newly
created AppDomain, I make use of a C library. If I issue an Abort(1) within
this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How could I
prevent my main AppDomain to stop when the other stopped?Thanks a lot,José 7 2355
Jose,
Unfortunately, in C, the abort function will terminate the process that
it is running in. If it does this, then I don't think that there is a
workaround for it. You will have to run this separately in another process
and marshal any calls/values back to you.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:eL****************@TK2MSFTNGP12.phx.gbl... I have a windows service where I create another appdomains. In the newly created AppDomain, I make use of a C library. If I issue an Abort(1)
within this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How could I prevent my main AppDomain to stop when the other stopped?Thanks a lot,José
Harrrrg,
Let's say I make a modification to this legacy library and install a "signal
handler" that will send, through a delegate, information that an exception
occured.
Is there a way to unload the AppDomain where the C code is loaded without
having my main domain to miserably terminate?
José
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl... Jose,
Unfortunately, in C, the abort function will terminate the process
that it is running in. If it does this, then I don't think that there is a workaround for it. You will have to run this separately in another
process and marshal any calls/values back to you.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message news:eL****************@TK2MSFTNGP12.phx.gbl... I have a windows service where I create another appdomains. In the
newly created AppDomain, I make use of a C library. If I issue an Abort(1) within this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How could
I prevent my main AppDomain to stop when the other stopped?Thanks a
lot,José
Hi Jose,
*abort* terminates the whole process. So all application domains on it will
be terminated. What you can do is to install signal handler for SIGABRT
signal. Hopefully you can do it form managed code with P/Invloke.
So maybe you will install that handler form the same application domain that
you want to terminate.
If it is a GUI you can call Application.Exit. If it is not.... I don't
know... you have choices...
Ultimately you can call AppDomain.CurrentDomain.Unload.
HTH
B\rgds
100
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:eL****************@TK2MSFTNGP12.phx.gbl... I have a windows service where I create another appdomains. In the newly created AppDomain, I make use of a C library. If I issue an Abort(1)
within this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How could I prevent my main AppDomain to stop when the other stopped?Thanks a lot,José
Jose,
This would work much better. If you have your C code changed so that it
issues an error code of some sort, instead of calling abort, that would be
optimal. Then, from the managed side, you can decide what to do when it
fails.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:us**************@tk2msftngp13.phx.gbl... Harrrrg,
Let's say I make a modification to this legacy library and install a
"signal handler" that will send, through a delegate, information that an exception occured. Is there a way to unload the AppDomain where the C code is loaded without having my main domain to miserably terminate?
José
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:%2****************@TK2MSFTNGP09.phx.gbl... Jose,
Unfortunately, in C, the abort function will terminate the process that it is running in. If it does this, then I don't think that there is a workaround for it. You will have to run this separately in another process and marshal any calls/values back to you.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message news:eL****************@TK2MSFTNGP12.phx.gbl... I have a windows service where I create another appdomains. In the newly created AppDomain, I make use of a C library. If I issue an Abort(1) within this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How
could I prevent my main AppDomain to stop when the other stopped?Thanks a lot,José
I did this directly in the C Library (just as a quick test).
This sounds now much better. I'm able to unload the appDomain directly
within the faulty AppDomain.
I'm also able to reload it again from the main AppDomain.
HOWEVER!!!!
I always get a popup message when the dll containing the C code terminates:
Visual C++ Runtime Library
Runtime Error!
This application has requested the Runtime to terminate it in an unusual
way.
And the Service locks until I press OK...
Is there a way to prevent such a message to be thrown?
======= C code snippet =========
// JOJ
signal(SIGABRT, inthandler);
signal(SIGFPE, inthandler);
signal(SIGILL, inthandler);
signal(SIGSEGV, inthandler);
// JOJ
....
....
void
inthandler (int arg)
{
// JOJ: Write info to local memory log and call our delegate to inform
about the problem
......
(*ExitRamitPtr)(9999);
return;
}
"100" <10*@100.com> wrote in message
news:e8**************@tk2msftngp13.phx.gbl... Hi Jose, *abort* terminates the whole process. So all application domains on it
will be terminated. What you can do is to install signal handler for SIGABRT signal. Hopefully you can do it form managed code with P/Invloke.
So maybe you will install that handler form the same application domain
that you want to terminate. If it is a GUI you can call Application.Exit. If it is not.... I don't know... you have choices... Ultimately you can call AppDomain.CurrentDomain.Unload.
HTH B\rgds 100 "José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message news:eL****************@TK2MSFTNGP12.phx.gbl... I have a windows service where I create another appdomains. In the
newly created AppDomain, I make use of a C library. If I issue an Abort(1)
within this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How could
I prevent my main AppDomain to stop when the other stopped?Thanks a
lot,José
Got it. Need to call
_set_error_mode(_OUT_TO_STDERR);
Thanks for your great help!
José
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl... I did this directly in the C Library (just as a quick test).
This sounds now much better. I'm able to unload the appDomain directly within the faulty AppDomain. I'm also able to reload it again from the main AppDomain.
HOWEVER!!!! I always get a popup message when the dll containing the C code
terminates: >>>> Visual C++ Runtime Library Runtime Error! This application has requested the Runtime to terminate it in an
unusual way. >>>> And the Service locks until I press OK...
Is there a way to prevent such a message to be thrown?
======= C code snippet ========= // JOJ signal(SIGABRT, inthandler); signal(SIGFPE, inthandler); signal(SIGILL, inthandler); signal(SIGSEGV, inthandler); // JOJ
... ... void inthandler (int arg) { // JOJ: Write info to local memory log and call our delegate to inform about the problem ...... (*ExitRamitPtr)(9999); return; }
"100" <10*@100.com> wrote in message news:e8**************@tk2msftngp13.phx.gbl... Hi Jose, *abort* terminates the whole process. So all application domains on it will be terminated. What you can do is to install signal handler for SIGABRT signal. Hopefully you can do it form managed code with P/Invloke.
So maybe you will install that handler form the same application domain that you want to terminate. If it is a GUI you can call Application.Exit. If it is not.... I don't know... you have choices... Ultimately you can call AppDomain.CurrentDomain.Unload.
HTH B\rgds 100 "José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message news:eL****************@TK2MSFTNGP12.phx.gbl... I have a windows service where I create another appdomains. In the newly created AppDomain, I make use of a C library. If I issue an Abort(1) within this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How
could I prevent my main AppDomain to stop when the other stopped?Thanks a lot,José
Great! :-)
B\rgds
100
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:ua****************@tk2msftngp13.phx.gbl... Got it. Need to call _set_error_mode(_OUT_TO_STDERR);
Thanks for your great help!
José "José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message news:%2******************@TK2MSFTNGP09.phx.gbl... I did this directly in the C Library (just as a quick test).
This sounds now much better. I'm able to unload the appDomain directly within the faulty AppDomain. I'm also able to reload it again from the main AppDomain.
HOWEVER!!!! I always get a popup message when the dll containing the C code terminates: >>>> Visual C++ Runtime Library Runtime Error! This application has requested the Runtime to terminate it in an
unusual way. >>>>
And the Service locks until I press OK...
Is there a way to prevent such a message to be thrown?
======= C code snippet ========= // JOJ signal(SIGABRT, inthandler); signal(SIGFPE, inthandler); signal(SIGILL, inthandler); signal(SIGSEGV, inthandler); // JOJ
... ... void inthandler (int arg) { // JOJ: Write info to local memory log and call our delegate to inform about the problem ...... (*ExitRamitPtr)(9999); return; }
"100" <10*@100.com> wrote in message news:e8**************@tk2msftngp13.phx.gbl... Hi Jose, *abort* terminates the whole process. So all application domains on it will be terminated. What you can do is to install signal handler for
SIGABRT signal. Hopefully you can do it form managed code with P/Invloke.
So maybe you will install that handler form the same application
domain that you want to terminate. If it is a GUI you can call Application.Exit. If it is not.... I don't know... you have choices... Ultimately you can call AppDomain.CurrentDomain.Unload.
HTH B\rgds 100 "José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message news:eL****************@TK2MSFTNGP12.phx.gbl... > I have a windows service where I create another appdomains. In the newly > created AppDomain, I make use of a C library. If I issue an Abort(1) within > this library, it simply hard stop my main AppDomain!!!!!!!!!!!!How could I > prevent my main AppDomain to stop when the other stopped?Thanks a lot,José > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Markus Breuer |
last post by:
I have a question about oracle commit and transactions. Following scenario:
Process A performs a single sql-INSERT into a table and commits the
transaction. Then he informs process B (ipc) to...
|
by: MatthewRoberts |
last post by:
Howdy All,
I am having difficulty with two-way communication across AppDomains in
an attempt to dynamically script applications. Everything works as
expected, except when using ByRef parameters....
|
by: xixi |
last post by:
i have db2 udb v8.1 on windows 64 bit 2003 server, after db2 server
start , i found this in the db2diag.log, is this error?
2004-05-05-15.28.30.780000 Instance:DB2 Node:000...
|
by: José Joye |
last post by:
I have a library written in C (I do not have the source) and having some
callbacks exported. It is currently not that stable and write to stdout and
stderr
:-((
The idea I have is to wrap it with...
|
by: José Joye |
last post by:
I have a windows service where I create another appdomains. In the newly
created AppDomain, I make use of a C library. If I issue an Abort(1) within
this library, it simply hard stop my main...
| |
by: Wal Turner |
last post by:
Hi there. There are various snippets on forums regarding issues with
AppDomain.Unload and how it just doesnt work.
Fortunately, I got it working with the base case, after much fiddling.
Consider...
|
by: pradeep_TP |
last post by:
Hi all,
I am using IIS 5.0 and this question is regarding working of ASP.net worker
process. I have only one web application right now on my web server. This
means that only one AppDomain will...
|
by: ray |
last post by:
I have a client that doesn't want Access to automatically repair into a
backup file if it crashes (and it crashes only on very rare occasions).
My (sketchy) understanding is that this is a...
|
by: José Joye |
last post by:
I'm currently trying to load an instance of a given class within a secondary
appDomain and access it from within my main AppDomain.
Everything is fine and working if the class in the second...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |