Recent

Author Topic: Lazarus+FPC application bad crash on WinCE  (Read 107708 times)

Al Berto

  • New Member
  • *
  • Posts: 16
Re: Lazarus+FPC application bad crash on WinCE
« Reply #15 on: March 03, 2010, 12:51:29 pm »
Sorry for the long delay, I'm full of work here and never found a free moment to test Lazarus.

Ok I downloaded the last Lazarus-0.9.29-23824-fpc-2.4.0-20100303-win32.exe and Lazarus-0.9.29-23824-fpc-2.4.0-20100303-cross-arm-wince-win32.exe and now I see your modifications to winceobject.inc.
I rebuild only the LCL with -dDEBUG_AppProcessMessages, run my application, it still crashes but no log found.
If I put DbgAppendToFile on my project source after inizialization it correctly creates the 1.log file with test information.
Then, just to try, I put a Beep instruction on procedure TWinCEWidgetSet.AppProcessMessages and rebuilt LCL, but I hear no sound (it should be a symphony!) so I suspect the building process is not using the rebuilt LCL. That could be the reason why I can't see your log file.

What am I missing?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #16 on: March 03, 2010, 05:57:57 pm »
How did you rebuild your application? Did you just hit "run" ? I normally use "Build All", that should work.

Do you have multiple Lazarus directories?

One solution might be deleting all LCL compiled files, try deleting the folder lazarus/lcl/units then rebuild your LCL and rebuild your application and try again.

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #17 on: March 04, 2010, 08:31:28 pm »
Hi Al berto and Felippemdc,

I've rewritten an old application (2 years old) And suddenly I had the same issues after testing on a real device. I have been looking for weeks and know I'm convinced that it is not mine bad programming technique, because even a small form in kol, fpgui and 'normal' lazarus will crash on wince.

Now I'm going to install the 09.29 branch, but if it will work with kol....

To be continued

Chris Gradussen


chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #18 on: March 04, 2010, 10:07:05 pm »
tested with an simple memo application on

   09.29 snapshot and fpc 2.4.1   FAIL >:D
   09.28  with fpc 2.2.4 FAIL >:D
   09.26.2  with fpc 2.2.2 FAIL >:D
   09.26 with fpc 2.2.2 FAIL >:D
   
   09.24 WITH fpc 2.2.0 SUCCEED (but kol-ce with 09.24 is not possible?) O:-)

Now i'm going to test 09.29-23836 snapshot with fpc 2.4.0 FAIL >:D

So it looks like fpc for wince is stable only on version 2.2.0

I hope this wil help to backtrace the issue
Regards Chris Gradussen
   

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: Lazarus+FPC application bad crash on WinCE
« Reply #19 on: March 04, 2010, 10:09:35 pm »
On what point does it fail ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Al Berto

  • New Member
  • *
  • Posts: 16
Re: Lazarus+FPC application bad crash on WinCE
« Reply #20 on: March 05, 2010, 09:21:11 am »
Hi Felipe

at last I succeded in building LCL in the right way.
What am I missing? In Configure "Build Lazarus" window I have to set the CPU to arm and OS to wince. I have to manually write them in the edit boxes and beware, not WinCE but wince, otherwise LCL building fails.

So at last, this is the 1.log file I get:

:> [AppProcessMessages] WaitHandleCount=0
: MsgWaitForMultipleObjects retval=258
:< [AppProcessMessages]

repeated many times, always the same.

I'm using Lazarus 0.9.29-23836

Hope it helps.


chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #21 on: March 05, 2010, 07:27:29 pm »
Marc,

Failure means

on a symbol mc70 (mobile 5) or an windows mobile phone (mobile 6.1) a simple application crashes after change of wireless network (enabling or disabling, with a resume you got a reenabling of the network). Not the action is the cause, but the change of network state (disconnected or connected).


With a kol application it takes more time to create/get the error. I think due to the size of te kol application??

Lazarus 09.24 with fpc 2.2.0 works correct. I got the issues after rewriting an old application. That 'old' application worked correct and was written with a snapshot of end 2007. I think it was a snapshot of 09.26 with fpc 2.2.0 but it is just a wild guess.

I hope this can help to get wince usable again.

Regards Chris Gradussen


felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #22 on: March 06, 2010, 02:48:10 am »
So at last, this is the 1.log file I get:

:> [AppProcessMessages] WaitHandleCount=0
: MsgWaitForMultipleObjects retval=258
:< [AppProcessMessages]

Please make it crash and post the last lines of the file. If it crashes in the middle of the routine like we expect, it should print only part of this sequence in the last time it prints.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #23 on: March 06, 2010, 03:24:42 am »
   09.29 snapshot and fpc 2.4.1   FAIL >:D
   09.28  with fpc 2.2.4 FAIL >:D
   09.26.2  with fpc 2.2.2 FAIL >:D
   09.26 with fpc 2.2.2 FAIL >:D
   
   09.24 WITH fpc 2.2.0 SUCCEED (but kol-ce with 09.24 is not possible?) O:-)

Good job! The bad part here is that this open the door to the problem being in either Lazarus or FPC, but I bet that Lazarus because from 2.2.0 to 2.2.2 was no big changed.

I managed to get a DIFF between how the crashing file was with 0.9.24 and what it is now, there is not much difference and nothing that would make it crash ...

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/wince/winceobject.inc?root=lazarus&r1=11133&r2=23678&pathrev=23678

So I am betting that the problem is in FPC, or something completely unrelated in Lazarus which causes the crash ...

The best thing would be to test the Latest Lazarus code with FPC 2.2.0, I'll check if it compiles

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #24 on: March 06, 2010, 03:43:26 am »
SVN Lazarus doesn't compile with FPC 2.2.0 but you could try to comment out all stuff which doesn't compile and see if works and doesn't crash this way. This would prove the problem is in the compiler.

Another thing to test would be in the file lcl/lresources.pp comment the line that says
{$define UseRes}

maybe this will fix it if it is a resources error.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #25 on: March 06, 2010, 03:55:39 am »
Actually too much changed, using latest SVN Lazarus with FPC 2.2.0 is suicide ... a better solution is using an older SVN Lazarus to test this, more specifically LCL between 0.9.24 and 0.9.26 with FPC 2.2.0

Lazarus 0.9.24 is approximately SVN 12750
Lazarus 0.9.26 is approximately SVN 16881

You could test SVN 16881 with FPC 2.2.0

You can install Lazarus 0.9.24 + Lazarus->arm-wince in a separete directory from Source Forge to get the FPC 2.2.0 cross-compiler. Don't use this IDE, just have it for the compiler.

You can then either use a SVN Lazarus in the appropriate version, or use a Lazarus 0.9.26 and use the Environment Options to set your compiler to lazarus0924/fpc/2.2.0/bin/i386-win32/fpc.exe and the same for the make.exe, rebuild your LCL and create a test app.

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #26 on: March 06, 2010, 08:49:21 am »
felipeemdc,

building lazarus 09.26.2 with fpc 2.2.0 is to difficult for me. I have to disable lines in dbgrid . WS32WsControls, Win32WSExtDlgs and therefore i lose te control of what I'm doing and the compiler does not link anymore because  windres.exe cannot exe 'cpp' again. I know it is a c++ file extension, but where I have to look for this error....  But in the real case the above is not interesting, because the target is to get wince stable again :)

Something else interesting to make debug  more simple is using the emulator. The application will not crash, just hang.

Howto
1) start your application, for example with a memo component to see that it does not accept input anymore.
2) Start a suspend. You can do this for example with fdcsoft Taskmanager v3.1. In this taskmanager select menu/actions/suspend
3) wait a few seconds. startup again the emulator (with networking enabled) and you will see that your application does not accept input anymore. If the application is larger or you use by the way a networking function (from winsock or lnet), it will really crash.

I hope this helps!!!

Now I have to go to work....
Regards Chris Gradussen

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #27 on: March 06, 2010, 12:27:27 pm »
2) Start a suspend. You can do this for example with fdcsoft Taskmanager v3.1. In this taskmanager select menu/actions/suspend

It would be great! If I can reproduce it, then I can fix it.

By this Taskmanager do you mean installing this software: http://www.dotfred.net/TaskMgr.htm

?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #28 on: March 06, 2010, 12:41:12 pm »
and the compiler does not link anymore because  windres.exe cannot exe 'cpp' again. I know it is a c++ file extension, but where I have to look for this error....  But in the real case the above is not interesting, because the target is to get wince stable again :)

cpp isn't C++, it's the pre-compiler from C/C++ which is also used to pre-compile windows resource files *.rc

Just comment out any reference to resources in your application, usually {$R MyResource.rc} and it should link,

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Lazarus+FPC application bad crash on WinCE
« Reply #29 on: March 06, 2010, 12:58:40 pm »
The first time I tried rev12750 the form wouldn't show, and then I started testing multiple versions, then I tested rev12750 again and it worked normally after resuming.

Further, I tested the latest SVN revision and it also works =/

So no, I am not actually capable of reproducing your problem with this Task Manager, it just works in my emulator.

Which emulator version are you using? Maybe this is also a factor.

Or maybe you have more then just a memo in your application.
« Last Edit: March 06, 2010, 02:22:55 pm by felipemdc »

 

TinyPortal © 2005-2018