Crashed when pop out of a UINavigationController - uinavigationcontroller

I have several viewControllers controlled by a navigation controller.
For example, viewController A and viewController B can both push viewController C into the navigation stack and ask C to do some saving (actually means the same to C).
in the saving method of C, the last line of code is
[self.navigationController popViewControllerAnimated:YES];
But problem is,
If I push to C from A, after I save something and pop back to A, things goes well.
But if I push C to from B, after I do the same thing and pop back to B, app crashes,
with my debugging, I found that app crashed not in C's code,
but after B's viewWillAppear method, here I mean after, B correctly runs all of the codes in viewWillAppear,
but then crashes somewhere I don't know how to trace to.
and the Error is very strange to me:
2012-02-13 00:29:30.975 EasyWallet[43116:707] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByAppendingString:]: nil argument'
*** First throw call stack:
(0x344268bf 0x346761e5 0x344267b9 0x344267db 0x35d72121 0x2ce7b 0x2ba75 0x3782f9cb 0x3782eaa9
0x3782e233 0x377d2d4b 0x3438522b 0x34f16381 0x34f15f99 0x34f1a11b 0x34f19e57 0x34f11d85
0x343fab4b 0x343f8d87 0x343f90e1 0x3437c4dd 0x3437c3a5 0x30c00fcd 0x377fd743 0x2179 0x2138)
terminate called throwing an exception(gdb)
I just don't know how to fix it.

While dealing with number of viewControllers and views, it happens that frequent crashes occurs. I also had same problem when not using ARC. At that time i found the best way out is using following link to get into exact crash. The only thing is you need to carefully analyzed the result at console and should judge it better way...
http://www.cocoadev.com/DebuggingAutorelease.html

Related

Why does Progress go back to the initial screen after a session crash?

Hello all and thanks for viewing this question,
I have a program that users get access to via a login screen. Once the user's credentials have been validated on the login screen, the main program is called (from the login screen) and the login screen disappears. All good. However, if the session crashes (or I press CTRL-PAUSE), the main program is terminated and I end up at the initial login screen. I'd have assumed that after a session crash, Progress (11.4) should take me back to the OS (Windows Server 2012), but not back to the initial screen. I have tried placing QUIT in different areas of the program, but Progress still takes me back to the initial screen, while I need it to quit completely. Any thoughts would be greatly appreciated. Thanks!
It's the AVM's default behavior to rerun the startup procedure after a STOP condition has occurred that was not handled.
You can add an
ON STOP UNDO, RETURN "stopped" .
option to a DO, FOR or REPEAT block close where your "crash" happens. Then the calling procedure could check for the RETURN-VALUE of "stopped".
Assuming you are on a recent version (OpenEdge 12.x), you can also use CATCH Blocks for Progress.Lang.Stop:
CATCH stopcon AS Progress.Lang.Stop:
QUIT.
END CATCH.
I think that your use of the word "crashed" is very, very confusing. If your session actually "crashes" in the usual sense that _progres (or prowin if this is Windows) terminates, then you would not have any locked records remaining. You would also have a protrace file that would help you to identify where the issue occurs.
Incidentally, you could add error logging to the client startup to determine where the errors that QXtend cannot find are occurring:
_progres dbname -p startup.p -clientlog logname.log
You have not shared any code so I can only guess but, presumably, you are running your login program via the -p startup parameter.
Correct me if I am wrong but something along these lines:
_progres dbname -p startup.p
The startup program then runs whatever it runs to get you logged in and run the application. Maybe something like this:
/* startup.p
*/
message "(re)starting!".
pause.
run value( "login.p" ).
run value( "stuff.p" ).
message "all done".
pause.
quit.
And:
/* login.p
*/
message "hello, logging in!".
pause.
return.
Along with:
/* stuff.p
*/
message "hello, doing stuff!".
pause.
run value( "notthere.p" ).
message "hello, doing more stuff!".
pause.
return.
At some point an error occurs (you seem to want to call this a "crash"). I have arranged for a serious error to occur when stuff.p tries to "run notthere.p". So if you run my example you will see the behavior that you have described - your session "crashes", the startup procedure re-runs, and you get to the login screen again.
To change that and trap the error simply wrap a "DO ON STOP" around the RUN statements. Like this:
/* startup.p
*/
message "(re)starting!".
pause.
do on error undo, leave
on endkey undo, leave
on stop undo, leave
on quit undo, leave: /* "leave", exits this block when one of the named conditions arises */
run value( "login.p" ).
run value( "stuff.p" ).
/* we just leave because we finished normally */
end.
message "all done".
pause.
quit.
You mention QXtend so I am guessing that MFG/Pro is involved. If you cannot directly modify the MFG/Pro startup procedure (as I recall that would be "-p mfg.p") just adapt the code above to be a "shim" that runs mfg.p from within the "DO ON STOP..." block.
I believe I have found a way to quit the initial login screen when this appears as the result of a session crash, by using the the ETIME function. Thanks again, Mike for your response.

Strange ZQuery behavior

I'm using Zeos and SQLite3 DB in Delphi
ZQuery2.Close;
ZQuery2.SQL.Clear;
ZQuery2.SQL.Add('SELECT * FROM users WHERE un = ' + QuotedStr( UserName ) );
ZQuery2.Open;
OutputDebugString(PWideChar( ZQuery2.FieldDefList.CommaText )); // log : id,un,pw
OutputDebugString(PWideChar(ZQuery2.FieldByName('pw').AsString)); //causes error sometimes
the code is working but sometimes I get the following error message
Exception class EDatabaseError with message 'ZQuery2:Field'pw' not found'.
This is odd because a field of a dataset shouldn't just disappear while the app is in the middle of running, especially if other fields are still operating normally. So, I would suspect something like a memory overwrite being the cause.
Memory overwrites usually happen when something is written to the wrong place in memory, overwriting what is there, usually because of an incorrect pointer value or a so-called "buffer overrun" where the writing operation carries on beyond where is should stop. Usually, the pointer value is so wildly wrong that the OS can detect it and raise an AV, but sometimes it is less obvious.
Delphi's memory manager has a 'full debug mode' which adds special checks for this condition, see here.
I suggest you enable full debug mode as per the linked document and wait for the exception to occur.

STM32F7 hangs after system reset

I have the following problem:
STM32F7 Flash starts at 0x0800 0000. My program works fine.
Then I shift my code in FLASH at 0x0802 0000 to leave space for future bootloader. I changed my MemoryMap.xml file :
<MemorySegment start="0x08020000" name="FLASH" size="0x80000" access="ReadOnly"/>
and the corresponding flashplacement.xml file:
<ProgramSection alignment="0x100" load="Yes" name=".vectors" start=" 0x8020000"/>
and start debuging....Program works fine until an link error occurs which triggers a system restart with a call of HAL_NVIC_SystemReset.
The result is a hanging application which is not the case when my code resides at the start of FLASH (0x0800 0000)
Does anybody knows why is this happens?
Regards
/Kostas
The answer is rather easy. You cant just move memory start address. Your micro will get the stack pointer value and the reset handler routine address from the same address as usually. You need to have this boot loader already flashed( at least the vector table and the reset handler which will set the new vector table, set the app stack pointer and pass the control to your app reset handlet

Autolayout and subviews

I am using the iAd suite with storyboards from Apple, as per this link...
Apple iAd Storyboard documentation
It all works fine until I turn autolayout on. It builds fine but crashes on running. The output I get is:
2013-08-24 12:06:36.138 TabbedBanner[7272:c07] * Assertion failure in -[UIView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIView.m:5781
2013-08-24 12:06:36.139 TabbedBanner[7272:c07] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after sending -viewDidLayoutSubviews to the view controller. BannerViewController's implementation needs to send -layoutSubviews to the view to invoke auto layout.'
*** First throw call stack:
(0x1e27012 0x110ee7e 0x1e26e78 0xba4665 0xa347a 0x11226b0 0x1358fc0 0x134d33c 0x1358eaf 0x1422bd 0x8ab56 0x8966f 0x89589 0x887e4 0x883ef 0x65c9d 0x5098b 0x5194b 0x62cb5 0x63beb 0x55698 0x1700df9 0x1700ad0 0x1d9cbf5 0x1d9c962 0x1dcdbb6 0x1dccf44 0x1dcce1b 0x5117a 0x52ffc 0x2a0d 0x2935)
libc++abi.dylib: terminate called throwing an exception
(lldb)
I know it is something to do with the subviews in storyboard but I dont know how to correct this error. I am pretty new to iOS and trying to teach myself so any help is appreciated. Many Thanks
Add:
[self.view layoutIfNeeded];
to the end of this method
- (void)viewDidLayoutSubviews
inside your BannerViewController

How to use break point in asp.net?

I have created break point in my cs file.and run application.By pressing f11,it moves to next line in code.when data get fill from server to dataset,that time is moving directly to my browser(local host page).Then I am manually moving to cs file again.then it moves to catch block.That means error at the time of filling dataset,right?
If you're not able to see what exception you had or if the try-catch block is in some general area, outside of the scope that you're debugging, you might be having some kind of timeout. IIS, for example, would throw ThreadAbortException and kill your current thread if it doesn't get a http response after the time specified in web.config -> httpRunTime -> executionTimeout. Check that this is not too little (make it definitely bigger than the time it takes to fetch the slowest query result).

Resources