NodeJS sometimes exist after runtime error but sometimes not - loopbackjs

I'm using loopback 3 which based on expressJS. I noticed that sometimes the nodeJS app exit when runtime error occurs but sometimes just showing the error but not exit and the app continue functioning.
Can someone explain in what types of runtime errors the entire app terminates and what type not?

I suggest to check your code carefully, it looks like you missed "await" for a promise somewhere. Generally, all errors should be caught by the error handler (if we are token about requests processing)

Related

C++/Qt application exits without any inidication

Well, I am writing a small application using C++, Qt and some libraries. Some computation is executed when hitting a UI button.
Now I found that after around one minute the application exits reproducibly and reliably without any visible reason. The error seems not happen statistically but deterministically. I guess there is some bug triggering the crash but I can not find any hint where/why this is happening.
Honestly I have never seen such a crash during the last decade, normally I get even a small indication what happened.
I am using GCC 11.3, GDB, Qt Creator on Kubuntu 22.10 Linux. I built a debug executeable and run it. This is what I checked:
Run using debugger, Qt creator console says "...app has finished with exit code 0."
Run without debugger, Qt creator console says "...app crashed."
Run on bash it only says "Getötet" (which is german and means "killed")
No error related application console output or dialogs are generated
Logging component (which logs all signals, intercept-able C++ exit calls, Qt output and more) does not log anything unexpected
Application does not exit by main()-return (debugger break-point is not triggered and corresponding log trace isn't generated)
No signal dialog (like SIGTERM and SIGABRT) is shown
No assertion seems to be triggered (would generate output and would halt the debugger)
I enabled break-on-abort but nothing happens
I enabled break-on-C++-exception but nothing happens
I searched my code for exit calls (especially with a return code of 0) but there is no such call.
After all I have no idea how to debug the issue other than cluttering my entire application with debug messages and check for missing prints.
Any idea what could happening here and why I don't get even the slightest indication for the error reason?
Is there a way to track down the issue using GDB?
I will try the exit break-point...
You should set a breakpoint on the exit_group and exit system calls, like so:
(gdb) catch syscall exit_group
(gdb) catch syscall exit
But I have doubts since my logging component is using on_exit() to capture exits.
There are many ways for an application to exit without passing through exit and without executing any on_exit-registered functions.
Here are some:
_exit(0)
syscall(SYS_exit, 0)
syscall(SYS_exit_group, 0)
Ok, solution was pretty easy. It wasn't any leak or memory error. Also it wasn't an exit call of any kind.
Reason was basically an internal buffer that could grow beyond the size of physically installed memory under some circumstances. That triggered the OS' OOM-Killer process.
Problem didn't produce any immediate error indication but it could have been tracked down by monitoring system resources and by checking the kernel log (that contained corresponding "oom-kill" and "oom_reaper" messages).

CLIPS system halted and not continuing to execute

I am integrating CLIPS expert system following APG docs, Thanks for the great docs, I am successful at integrating CLIPS to my C++ project, My Application runs continuously and feed the Facts to CLIPS system using EnvAssert method and invoke EnvRun, everything works fine until i receive this error.
[PRNTUTIL7] Attempt to divide by zero in / function.
[DRIVE1] This error occurred in the join network
Problem resides in associated join
Of pattern #1 in rule RULE-1
[PRCCODE4] Execution halted during the actions of defrule RULE-2.
Once i receive this error, further Assert is working but Run seems not working, but i am sure there are definite matching rules are available but still no rules are fired on next Run.
I understood the error and i can fix it, but i cannot understand the behavior. So i tested it in CLIPS console, there when the error was reported consecutive Run seems working as i expected, but not in case of my application, i want to know the underlying difference.
Ref pseudo-code of Application :
<code to create and initialize CLIPS environment>
EnvReset()
While(true)
{
<my code to get facts>
EnvAsset(Fact)
EnvRun(-1)
<my code to receive the generated result facts>
}
Note: I dont call RESET before every RUN.
Fixes for resetting the error flags for API calls have been checked into the subversion repository on sourceforge: https://sourceforge.net/p/clipsrules/code/HEAD/tree/branches/

System stop responding and throws yami i/o error

I need suggestion about YAMI library . I have a system which receives Json string from external interface and parse that received string and send that message to internal ip address for the required action.
The exchange of messages within the internal ip address has been taken care by Yami library. everything works fine but occasionally it displays yam i/o error and system doesn't response unless it is restarted.
The whole software is written in C++ and C and development os is fedora 11.
I have tried to investigate the problem but I am bit clueless as I have not found much help on internet and my testing method doesn't work.
its strange that system works for few hours and then crash . For example If I leave system idle for half an hour and then try to send message via external interface it crashes producing yami i/o error or even while sending continuos command it crashes.
Any help or suggestion will be of great help.
Thanks and regards,
Sam
It looks like this exception is from a core::io_error result which is translated to a runtime exception by details::translate_result_to_exception(). Most of this error originates from the source code in yami/posix in your case.
What you have to do now is figure out where the error originates and ultimately the source of the issue. You should be able to get a rough idea from what happens in your code when the error occurs (are you creating a new connection, sending data, receiving data, etc...).
If that doesn't yield any obvious results I would probably create a test project using the yami source code instead of the library file so I would be able to trace into the yami code to where the error originates from.

Intraweb class not found at runtime

I've beenworking with the IntraWeb framework on Borland C++Builder. Sometimes it happens that an application crashes because of a strange uncaught exception:
An unhandled application error has occured within My IntraWeb Application.
...
Error message raised by the application: Class TIWTimer not found
This happens when a new session is started. For example, by entering the address in a browser.
Also, the message appears in the classic IntraWeb error web page
The class that cannot be found is either TIWTimer or TIWButton but I think this is irrelevant.
The problem seems to occur randomly and sometimes goes away with a rebuild, but other times it will go away by rewriting the code or starting from a new project.
So, the question is, how come the link error is not found at link-time?
Why does it occur at all, since those classes belong to the standard IW library?
Has anyone had the same issue?
How can it be solved?
Use Intraweb XII in C++Builder XE2, it has good improvement and bug fixes.
in this version you can assign urls to forms, for example:
myhost/login.htm or myhost/login.aspx
for more information see this

c++ Service is stopping with error "this application has requested the runtime to terminate it an unusual way"

I have a c++ NTservice which is being accessed by SAP modules through rfc calls. Now this service is getting stopped with a message that "this application has requested the runtime to terminate it an unusual way" and then showing some IE script error that points to url "res://C:\WINDOWS\System32\mmcndmgr.dll/views.htm" -- I am getting this error very rarely and unexpectedly.
I have no clue why this error is coming, please anyone can guide me about the details and how to correct it if possible
(Windows xp, service is created in MSVC 2005)
Thanks,
Anil
That error message (at least usually) means you had an uncaught exception. You could start by adding a try/catch(std::exception const &e)/catch(...) to your ServiceMain, in an attempt at catching the exception and if it is a derivative of std::exception, printing out its what() to see what it has to say for itself...
That's the very unhelpful message that displays when your executable has crashed. Almost anything could be wrong.
Run your executable through a debugger and wait for the problem to occur. You can then try to find out more information about it.
In particular I'd check the service's documentation and make sure that your SAP modules are using the RFC calls correctly.