ARM DFSR\ISFR register - exception

I'm writing an exception handler and I'd like to make use of the FSR ( fault status registers)
I'm using Cortex-A9 , L1\L2 and MMU on , OS is nucleus.
I'm generating different exceptions but it seems that DFSR\ISFR do not change their value after the exception occurred. is there a need to enable this functionality or FSR should be captured by default ?
Ran

Related

usefulness of tdie with java exceptions inTalend

I want to know what is the usefulness of tdie comparing to Java exceptions in talend knowing that when an exception occur tdie exit the job and is passing the error to tlogcatcher .The same thing can be done by java exceptions (they also can be received by tlogcatcher and they exit the job ).
So why java exceptions are not enough for logging so we use tdie?/what is the limits of java exceptions.
I don't use tDie after a component exception (like Component-->oncomponenterror-->tDie . As you stated, the java exception is caught : if you put a tDie, you'll only have 2 lines logged instead of just one.
I use tDie to put an end to a job if a condition is not met : for example , I can test the number of lines inserted in a DB, if it is 0 , I call tDie to end the job (with tDBOutput--if-->tDie , with a test on number of lines inserted inside the if condition).
This is more like a functional error than a technical one that I want to catch in this case.

File component's [consumer.]bridgeErrorHandler in conjunction with startingDirectoryMustExist

I have a route (with Camel 2.23.1) like:
from("file://not.existing.dir?autoCreate=false&startingDirectoryMustExist=true&consumer.bridgeErrorHandler=true")
.onException(Exception.class)
.handled(true)
.log(LoggingLevel.ERROR, "...exception text...")
.end()
.log(LoggingLevel.INFO, "...process text...")
...
(I tried it with just &bridgeErrorHandler, too, since according to the latest doc the consumer. prefix seems to be not necessary any longer.)
According to the doc of startingDirectoryMustExist:
| startingDirectoryMustExist | [...] Will thrown an exception if the directory doesn’t exist. |
the following exception is thrown:
org.apache.camel.FailedToCreateRouteException: Failed to create route route1:
Route(route1)[[From[file://not.existing.dir?autoCreate=false...
because of Starting directory does not exist: not.existing.dir
...
but, despite of the doc and the description of [consumer.]bridgeErrorHandler it's propagated to the caller, i.e neither "exception text" nor "process text" are printed.
There is a unit test FileConsumerBridgeRouteExceptionHandlerTest that covers consumer.bridgeErrorHandler, so I think this works basically. Can it be that [consumer.]bridgeErrorHandler doesn't work in conjunction with the exception thrown by startingDirectoryMustExist?
Do I have to write my own [consumer.]exceptionHandler as mentioned in this answer to "Camel - Stop route when the consuming directory not exists"?
There also a post on the mailing list from 2014 that reports similar behaviour with startingDirectoryMustExist and consumer.bridgeErrorHandler.
UPDATE
After TRACEing and debugging through the code I found that the exception is propagated as follows:
FileEndpoint.createConsumer()
throw new FileNotFoundException(...);
--> RouteService.warmUp()
throw new FailedToCreateRouteException(...)
--> DefaultCamelContext.doStart()
(re)throw e
--> ServiceSupport.start()
(re)throw e
I couldn't find any point where bridgeErrorHandler comes into play.
Setting breakpoints on BridgeExceptionHandlerToErrorHandler's constructor and all of its handleException() methods doesn't stop at any of them.
Am I still missing something?
You should use the directoryMustExist option instead, then you can have the error during polling, which is where the bridge error handler can be triggered. The startingDirectoryMustExist option is checked during creating the consumer and therefore before the polling and where the bridge error handler operates.
See also the JIRA ticket: https://issues.apache.org/jira/browse/CAMEL-13174

catching classes that do not inherit from BaseException is not allowed

I'm making a custom plugin to query a database for user info to aide customer support. My backend is slack.
Everytime I start the bot command I'm greeted with:
Computer says nooo. See logs for details:
catching classes that do not inherit from BaseException is not allowed
I'm not sure if this is warning me that I'm attempting to catch an exception that isn't a BaseClass in my code or if an unknown exception was raised and caught elsewhere outside of my plugin.
To debug I tried:
try:
do_the_thing()
except (TypeError, ValueError) as e:
return('Something went wrong.')
I also tried:
try:
do_the_thing()
except Exception as e:
return('Something went wrong.')
And I still get the errbot admonition. Note that the command still runs and does the right thing where there is no exception raised by do_the_thing().
It means that:
Somewhere in your code you have an except ... statement where the exception ... (or one of the exceptions in the sequence ...) is not a subclass of BaseException, and
An exception is being thrown that is caught by that except ... statement.
The TypeError can be raised only when an exception is actually thrown because the names you give to except ... must be evaluated for their current values at that time; just because TypeError referenced a particular class at one point in the program's execution doesn't mean it won't be changed later to reference another object (though that would be admittedly perverse).
The Python interpreter should be giving you a full traceback of the exception; the first thing you need to do is find this. It could be occurring in one of two situations. (This is for single-threaded programs; I'm assuming your program is not multithreaded.)
During the execution of your program, in which case the program will be terminated by the exception, or
During finalization of objects (in their __del__(self) functions) in which case the error will be printed to stderr.
In both cases there should be a stack trace, not just the error message; I've confirmed that at least on Python ≥3.4 a stack trace is printed out for case 2.
You then need to follow this stack trace to see where the problem lies. Remember that the names you give to except ... are variables (even things like TypeError) that can be reassigned, so that you could conceivably be dealing with a (perverse) situation like:
TypeError = False
try:
...
except TypeError:
...
But more likely it will be something obvious such as:
class MyException: # Doesn't inherit from Exception
...
try:
...
except MyException:
...
There is one special case you need to be aware of: if you are seeing messages to stderr (case "2. During finalization," above) printed out as your program exits that means that the exception was thrown during cleanup as the interpreter shuts down, where random variables throughout the program may have already been set to None as part of the cleanup process. But in this case your program should still exit successfully.

Win 8.1 App crashes on user device - How to debug?

last week I published my first Windows 8.1 app on the Windows Store. So far everything works fine but now two user reported that the app crashes immediately when being launched.
Additionally I discovered that there is a CrashDump listed in the Reports/Quality section of the Dashboard. I dowloaded the CrashDump and tried to find the source of the problem using WinDbg by following this instruction: http://blogs.msdn.com/b/ntdebugging/archive/2014/01/13/debugging-a-windows-8-1-store-app-crash-dump.aspx
I was able to follow the instruction almost up to the end but then the sos library is not found:
0:006> .sympath SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols
...
0:006> .exr -1
ExceptionAddress: 769eb1d7 (combase+0x000fb1d7)
ExceptionCode: c000027b
ExceptionFlags: 00000001
NumberParameters: 2
Parameter[0]: 03f3f32c
Parameter[1]: 00000001
0:006> !error c000027b
Error code: (NTSTATUS) 0xc000027b (3221226107) - Anwendungsinterne Ausnahme.
0:006> .ecxr
eax=03f3f030 ebx=00000000 ecx=00000000 edx=00000000
esi=03f3f360 edi=03f3f030 eip=769eb01f esp=03f3f314
ebp=03f3f3bc iopl=0 nv up ei pl nz ac po nc cs=001b
ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000212
combase+0xfb01f: 769eb01f 6a03 push 3
0:006> knL
*** Stack trace for last set context - .thread/.cxr resets it
...
0:006> dt 03f3f32c combase!_STOWED_EXCEPTION_INFORMATION_HEADER*
0x05f182e4
+0x000 Size : 0x28
+0x004 Signature : 0x53453032
0:006> .formats 0x53453032
Evaluate expression:
Hex: 53453032
Decimal: 1397043250
Octal: 12321230062
Binary: 01010011 01000101 00110000 00110010
Chars: SE02
Time: Wed Apr 09 13:34:10 2014
Float: low 8.46917e+011 high 0
Double: 6.90231e-315
0:006> dt -a1 03f3f32c combase!_STOWED_EXCEPTION_INFORMATION_V2*
[0] # 03f3f32
---------------------------------------------
0x05f182e4
+0x000 Header : _STOWED_EXCEPTION_INFORMATION_HEADER
+0x008 ResultCode : 80131500
+0x00c ExceptionForm : 0y01
+0x00c ThreadId : 0y000000000000000000010001100101 (0x465)
+0x010 ExceptionAddress : 0x76943bff Void
+0x014 StackTraceWordSize : 4
+0x018 StackTraceWords : 0xa
+0x01c StackTrace : 0x04c6c010 Void
+0x010 ErrorText : 0x76943bff "趍ﯰ???" +0x
+0x020 NestedExceptionType : 0x314f454c
+0x024 NestedException : 0x05f1be44 Void
0:006> !error 80131500
Error code: (HRESULT) 0x80131500 (2148734208) - <Unable to get error code text>
0:006> dpS 0x04c6c010 La 7697a9f1 combase!RoOriginateLanguageException+0x3b [d:\blue_gdr\com\combase\winrt\error\error.cpp # 1083]
63da3bc6 mscorlib_ni+0x9b3bc6
63e41976 mscorlib_ni+0xa51976
63e415c1 mscorlib_ni+0xa515c1
5b72f9df System_Runtime_WindowsRuntime_ni+0x1f9df
5b72f965 System_Runtime_WindowsRuntime_ni+0x1f965
6372de66 mscorlib_ni+0x33de66
5b72f934 System_Runtime_WindowsRuntime_ni+0x1f934
5b6bff16 Windows_UI_ni+0x9ff16
64492a36 clr!COMToCLRDispatchHelper+0x28
0:006> !sos.pe
The call to LoadLibrary(sos) failed, Win32 error 0n2
"The system cannot find the file specified."
Please check your debugger configuration and/or network access.
0:006> .loadby sos clr
The call to LoadLibrary(c:\symbols\clr.dll\52E0B78469b000\sos) failed, Win32 error 0n126
"The system cannot find the file specified."
Please check your debugger configuration and/or network access.
I does not have experience with this kind of debugging and without the instruction I would not have known any of the commands that I had to use in WinDbg.
Does anyone have an idea how to go on from here?
I have uploaded the CrashDump to my OneDrive. Would be great if anyone with more experience could have a look at it:
http://1drv.ms/1gZzrRK
Is it somehow possible to get additional information from the users who reported the crash to the support? Can they extract a crash dump / error report from their systems?
Is there any possibility to supply a changed version to these users to check if these changes influence the problem?
Thank you very much!
In order to get more insight into what your app is doing when it's running on users' devices, you could add logging of some kind. Local logging to file is an option, but a poor one, since you have to let your user dig into hidden files to retreive your application log. It might be acceptable though, depending on your scenario. In that case you might want to look at this logging sample for Windows Store Apps that uses EWT to log.
Alternatives would be using some kind of logging framework. I haven't got any experience in any of those so I couldn't tell you which one to use.
As for getting a changed version to your user: simply build an app-package locally, put it on OneDrive and send them a link to it. They can sideload the app themselves (although it requires running a Powershell script and logging in with a live-account). I've used this approach with several clients and it's workable.

How to manage exceptions when using gtkada

When I'm using gtkada and my GUI is running, no exception is managed and the program always crashes. The message is
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
A test code is as follows:
with GLib; use GLib;
with Gtk.Label; use Gtk.Label;
with Gtk.Window; use Gtk.Window;
with Gtk.Frame; use Gtk.Frame;
with Gtk.Button; use Gtk.Button;
with Gtk.Widget; use Gtk.Widget;
with Gtk.Handlers;
with Gtk.Main;
procedure gui_test_4 is
Window : Gtk_Window;
Label : Gtk_Label;
Frame : Gtk_Frame;
Button_S : Gtk_Button;
General_Error : exception;
package Handlers is new Gtk.Handlers.Callback (Gtk_Widget_Record);
package Return_Handlers is
new Gtk.Handlers.Return_Callback (Gtk_Widget_Record, Boolean);
function Delete_Event (Widget : access Gtk_Widget_Record'Class)
return Boolean is
begin
return False;
end Delete_Event;
procedure Destroy (Widget : access Gtk_Widget_Record'Class) is
begin
Gtk.Main.Main_Quit;
end Destroy;
procedure Clicked (Widget : access Gtk_Widget_Record'Class) is
begin
raise General_Error;
exception
when General_Error =>
null;
end Clicked;
begin
Gtk.Main.Init;
Gtk.Window.Gtk_New (Window);
Set_Default_Size (Window, 200, 200);
Gtk.Window.Set_Title (Window, "GUI_Test_4");
Gtk_New (Frame);
Add (Window, Frame);
Gtk_New (Button_S, "Try");
Add (Frame, Button_S);
Return_Handlers.Connect
( Window,
"delete_event",
Return_Handlers.To_Marshaller (Delete_Event'Access)
);
Handlers.Connect
( Window,
"destroy",
Handlers.To_Marshaller (Destroy'Access)
);
Handlers.Connect
( Button_S,
"clicked",
Handlers.To_Marshaller (Clicked'Access)
);
Show_All (Window);
Show (Window);
Gtk.Main.Main;
end gui_test_4;
When the button is pressed, an exception is raised, but it should be managed in the same procedure, but instead of that, the complete program crashes.
Any idea how to solve this problem?
Thanks
Looks like a job for the debugger to me.
In the comments it was mentioned that others are able to successfully run and build this same code. That could mean that your version of GTKAda has issues. It could instead mean that there's a real bug in there, but how/if it expresses depends on what garbage values happened to be loaded into what memory areas when the program starts up.
You might start off by making sure you have the latest version of GTKAda. But after that, fire up the debugger and try to see where its crashing. Note that in Ada programs often crashes happen during package elaboration before the first line of code in your main even gets called. If you are using Gnat you can step through the elaboration process in GDB as well though. With other compilers, you may have to find some elaboration code to try to put breakpoints into to catch it early enough.