* * *

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

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE WORKAROUND!!!!
« Reply #75 on: May 03, 2010, 12:25:55 pm »
Ok in my best english 8)

When you enable wireless network on your pda, you see 2 arrows that are moving on the caption bar telling you that your pda is trying to establish a link to the/a wireless network. then there is no problem, even when the arrows are gone (your pda could not make a wireless network connection) . But when the arrows don't move anymore (a link has been established) the lazarus wince application will crash/disappear.

Asking me
It just look a wrong pointer operation.

Regards Chris
« Last Edit: March 15, 2014, 06:20:47 pm by chrgra »

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #76 on: May 08, 2010, 07:48:08 pm »
Felipemdc, Zaher,

do you both have some hints to make progress with this issue?

A think you both also like a stable wince version for al kinds of pda's.

Regards Chris

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3537
Re: Lazarus+FPC application bad crash on WinCE
« Reply #77 on: May 08, 2010, 08:34:22 pm »
Hello,

Yes, the solution is doing a search to find which modification of the FPC compiler caused the break. The search should test multiple FPC versions until we find which one broke it.

FPC 2.2.0 is trunk revision 8339
between this revision and revision 11490 a number of revisions were merged into FPC 2.2.1 to finally form FPC 2.2.2

The SVN Directory which we should use is: http://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/fixes_2_2/

The first step for you would be installing TortoiseSVN (Google for it) and use it to checkout the fixes_2_2 latest revision: http://svn.freepascal.org/svn/fpc/branches/fixes_2_2

After you have checkedout the latest revision then we can start testing multiple revisions of this branch. We can build a batch file which will create the cross compiler and then you can create executables with it.

Keep a Lazarus snapshot with FPC 2.2.0 installed somewhere, because we need FPC 2.2.0 to build fixes_2_2

The first revisions to test should be 8339 to make sure it works and 11490 to make sure it doesn't work and then we can start further tests.

I'll research about how to create this batch file, but for now you can already download fixes_2_2

thanks,

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #78 on: June 08, 2010, 01:50:01 pm »
Felipe,

Last month I've been very busy with refactoring my garden :D and selling my sailing yacht :'(t
so I did not have time to do anything.
Did you alread create the batch files, so I can support again to solve this issue?

Regards
Chris gradussen

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3537
Re: Lazarus+FPC application bad crash on WinCE
« Reply #79 on: June 10, 2010, 05:55:26 am »
Yes, I have found. It is a little tricky, but seams to work:

1> First get the fixes_2_2 in the adequate revision as said before

2> Now edit the file fixes_2_2\packages\Makefile.fpc

Look for the line which start with: dirs_wince=winceunits fcl-web tcl fftw ...

Now edit it to be: dirs_wince=winceunits fcl-web

Also edit the dirst= line to be:

dirs=fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json fcl-process unzip regexpr chm winceunits

This is necessary because some packages will fail to build for WinCE. Althought I am not 100% sure it is needed, maybe my setup has something wrong ...

3> Now recreate all makefiles. Go to the command line cmd.exe, enter the fixes_2_2 directory and issue the command:

PATH=C:\Programas\Lazarus24\fpc\2.2.0\bin\i386-win32\
fpcmake -Tall -r

4> Add the following build.bat batch file to your fixes_2_2 directory, fix the paths to match yours and run it:

Code: [Select]
PATH=C:\Programas\Lazarus24\fpc\2.2.0\bin\i386-win32\
cd compiler
mkdir ..\bin\
mkdir ..\bin\units
make cycle CPU_TARGET=arm OS_TARGET=wince
cd..
make packages CPU_TARGET=arm OS_TARGET=wince PP=C:\Programas\fpc_fixes_2_2\compiler\ppcrossarm.exe OPT="-FUC:\Programas\fpc_fixes_2_2\bin\units"

:: Install
copy compiler\*.exe bin\
copy rtl\units\arm-wince\*.* bin\units\

pause

5> Now you should have a new FPC in the fixes_2_2\bin directory and the units in fixes_2_2\units

6> You can configure this new compiler and rebuilt the LCL for arm-wince with it. You may need to add the path to the units using -FuC:\fixes_2_2\units or something like that.

crab

  • Newbie
  • Posts: 1
Re: Lazarus+FPC application bad crash on WinCE
« Reply #80 on: November 25, 2010, 11:26:12 pm »
I see a crash case in my application.
I think when system busy or an application run with high priority then FreePascal app is crashed.
I tried with 3 type (Application, Program and Console application) and crash still appears.

You can try with simple app

program Project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Windows, Classes
  { you can add units after this };

{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}

begin
   repeat
     Sleep(1000);
   utils False;
end.
       
This program is for test only, when it run nothing appear but you can know it is running by try delete program file from storage. If you can not delete it, it means it running other it crash.

After run this program, try turn on, off wifi, run some other program or make incoming call (this will make program crash) you can see FreePascal crashs

I try on HTC HD2, WindowMobile 6, Lazarus-0.9.29-28334-fpc-2.5.1-20101119

I don't know why but I think compiler has problem, not Lazarus.

Please, help me solve this issue.

Hi all,
my name is Alberto, I'm a programmer from Italy.

I've developed a telephone client application for WinCE using Lazarus(0.9.28.2)+FPC(2.2.4-2.4.0)+KOL/MCK(2.80.3-2.88)
Everything is working good with the beautiful KOL components but... sometimes application crash with SIGILL (using gdb).
No problem with WinCE emulator (Windows Mobile 6 PRO version 5.2.1235, Windows Mobile 6.1 PRO version 5.2.20757)

So I create a smaller program to reproduce it (KOLtest).

I'm testing it on a ASUS P552w Windows Mobile 6.1 PRO version 5.2.19965.
The small KOLtest is a form with a button and an edit box.
Run it thru gdb or directly, it's the same.
1- Click on the KOLtest button
2- click on the network icon, toggle WIFI, exit
3- goto 1
after toggling WIFI on/off  for four-five times, the application crash with no errors, after a little O.S. hanging it just disappear, on gdb I have SIGILL or SIGSEGV at different point.

I tried with FPC 2.2.4 or 2.4.0, KOL/MCK 2.80.3 or SVN trunk 2.88.
Could it be a bug on FPC compiler or KOL/MCK?
I don't know how to fix it...

Any help would be really appreciated, I'm getting (quite) mad about it!
Many thanks
bye

Alberto


DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: Lazarus+FPC application bad crash on WinCE
« Reply #81 on: November 26, 2010, 07:23:18 am »
Quote
I don't know why but I think compiler has problem,
I think the compiler has a problem if it manages to compile your code without errors...

Code: [Select]
begin
   repeat
     Sleep(1000);
   utils False; // should not compile
end.

Gr.
Dirk.

klim

  • Newbie
  • Posts: 1
Re: Lazarus+FPC application bad crash on WinCE
« Reply #82 on: March 06, 2014, 09:45:15 am »
Hi all, anybody has got this problem fixed?
We have some Wince (WM) Devices with exactly this kind of problem.

This device hangs with the simplest lazarus program when turning wifi off and on.
Here the test program:
Quote
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  counter := counter+1;
  Label1.Caption:= IntToStr(counter);
end;

Device
  • Manufacturer: Bartec/Motorola
    Model: MC9090G
    OS Version: 05.02.19590
    OEM Version: 01.09.0000
    Windows Mobile 6.1 Classic CE OS 5.2.19590 (Build 19590.1.1.5)
    Processor PXA270-624MHz

Dev environment
  •     Build: WinCE/ARM
  •     FPC: 2.6.2


The same executable from the test program above is working fine on a MC9090 with WinCE5.

This device is much worse. The same test program crashes without turning wifi off and on, it crashes within a few seconds.

Device
  • Manufacturer: Bartec/Motorola
    Model: MC92N0 (MC9200 series)
    OEM Name: MC92N0G
    OS: Windows Embedded Handheld 6.5 (6.5.3) Classic (CE OS 5.2.29162)

Dev environment
  •     Build: WinCE/ARM
  •     FPC: 2.6.2


Too bad, that the mantis entry regarding this problem was closed with the comment:  unable to reproduce (http://mantis.freepascal.org/view.php?id=15773)



[/list][/list]

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #83 on: March 14, 2014, 11:28:17 pm »
Too Sad,

I've 2 mobile mc7094.
I believe one does not crash,
The one at home on this moment still does te same as I stated in 2010.

Maybe I can check tomorrow the differences in the configuration

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: Lazarus+FPC application bad crash on WinCE
« Reply #84 on: March 15, 2014, 09:40:38 am »
lazarus 0.924 with fpc version 2.2.0 works fine:)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lazarus+FPC application bad crash on WinCE
« Reply #85 on: March 15, 2014, 10:45:18 am »
Well, if nobody does a search [1] for the change in FPC that caused the problem, I don't think it's likely the bug will be fixed.

On the other hand, if that old Laz+FPC version work fine for your wince applications... well, I can see why one wouldn't bother ;)

[1] Similar to the one described here
http://forum.lazarus.freepascal.org/index.php/topic,8498.msg45893.html#msg45893
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

chrgra

  • Jr. Member
  • **
  • Posts: 69
Re: POSSIBLE WORKAROUND!!!!! Lazarus+FPC application bad crash on WinCE
« Reply #86 on: March 15, 2014, 06:28:26 pm »
POSSIBLE WORKAROUND!!!

In another post with the same issue (application close/ shutdown).
The poster told that using upx solved the issue.
I tried it on my app for the symbol motorola (which runs on two almost exactly the same devices (i cannot find the difference, but spbackup really told me the roms are different)) and it looks like stable.

Now I will put it in my test environment at work and test further!!!!!

I used upx391w
« Last Edit: March 15, 2014, 06:30:48 pm by chrgra »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus