View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0021208FPCFCLpublic2012-02-01 18:022012-02-06 10:13
Reporterwillians cleyton 
Assigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product VersionProduct Build 
Target VersionFixed in Version2.7.1 
Summary0021208: Example androidlcl does not run when you add a DataSource
DescriptionI managed to compile the example folder androidlcl - lazarus, install and run the Android emulator with no problems.

But when I add a DataSource in the example (image DataSource.JPG) and when I run the Android emulator appears the error described in the attached file adb_logcat.txt.

Any idea what might be happening?

Additional InformationI used the VM available at: http://sourceforge.net/projects/p-tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/ [^]
TagsNo tags attached.
FPCOldBugId0
Fixed in Revision20267
Attached Fileszip file icon LazarusAndroid.zip [^] (127,105 bytes) 2012-02-01 18:02

- Relationships
related to 0020726resolvedThomas Schatzl FPC Basic support for Android 
has duplicate 0021207resolvedJoost van der Sluis Lazarus Example androidlcl does not run when you add a DataSource 

-  Notes
(0056276)
Felipe Monteiro de Carvalho (developer)
2012-02-03 07:55
edited on: 2012-02-03 07:56

DataSource is from FPC, not Lazarus.

Maybe someone from FPC has any idea why the DataSource would crash with runtime error 202 in Android?

It would be good if someone could test it in any other arm system, maybe it crashes in all ARM CPUs.

@cleyton: It would be good if you could try to resolve the addresses of the stacktrace from the error into line numbers. I don't know how to do it, however, and it might be impossible without rebuilding FPC if it crashes in side the FCL.

(0056281)
Marco van de Voort (manager)
2012-02-03 11:21
edited on: 2012-02-03 11:22

Datasource is not really OS/arch dependent, though of course its always possible to do an unaligned load.

And adding a tdatasource doesn't mean the exception is in the datasource code.

Anyway, with such little information and a lazarus specific example, I don't think we can do much with it.

(0056286)
willians cleyton (reporter)
2012-02-03 11:53

I do not know if it helps,

Using any component that has a unit in the USES clause db causes the same error. For example, I added a TDbf and the same error appears.

Even without adding any components, adding only db in the USES clause the same error appears.

So I think the problem relates to the unit db.
(0056287)
Marco van de Voort (manager)
2012-02-03 12:30
edited on: 2012-02-03 12:33

Strange. Unit db does not have any initialization code

Maybe related to resources or so? db uses dbconst which contains resourcestrings, or fmtbcd which has a big initialization section.

Could you try to use "fmtbcd" and "dbconst", to see which one duplicates the problem?

fmtbcd seems to be hardcoded in using extended. Likely candidate.

(0056293)
willians cleyton (reporter)
2012-02-03 19:15

I retraced the tests.

 The problem happens only with the UNIT fmtbcd.

 Is there any idea how to solve this problem?
(0056311)
Ludo Brands (developer)
2012-02-04 08:07

> It would be good if someone could test it in any other arm system, maybe it crashes in all ARM CPUs.


Ran a small program using fmtbcd without any problem on an arm netbook running debian sid (armv5tejl). Compiler 2.6.0-1 from debian sid repository.
(0056312)
Felipe Monteiro de Carvalho (developer)
2012-02-04 08:19
edited on: 2012-02-04 08:19

@Ludo: Maybe it only crashes in arm libraries. Android applications are libraries, not executables. Could you check that? A simple library with an exported function + fmtbcd in the uses clause, then a program which calls it?

Here is fmtbcd:

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/fmtbcd.pp?view=markup [^]

The initialization doesn't seam to have changed since january 19th 2011

(0056313)
Ludo Brands (developer)
2012-02-04 09:40

Putting fmtbcd in a dll reproduces the crash. Traced into the initialization routine and the call to system_fpc_stackcheck is done immediately before any user code is executed (ie, in the code for 'initialization').
(0056316)
Ludo Brands (developer)
2012-02-04 10:57
edited on: 2012-02-04 12:01

Created a simple library without any uses and it crashes in the same way when the library is compiled with -Ct. Without -Ct there is no problem.

I copied fmtbcd.pp to the test lib directory and changed line 46 to {$r+,q+,s-} to turn off stack checking. Recompiled without -Ct and fmtbcd works correctly from a library.

Edit: seems to be known problem. See http://free-pascal-general.1045716.n5.nabble.com/Stack-checking-in-dynamic-libraries-td2825832.html. [^]
Seems the only solution for the time being is above workaround (turn off stack checking).

(0056564)
Felipe Monteiro de Carvalho (developer)
2012-02-06 10:12

I removed s+ from fmtbcd in rev 20267

On the bad side this does not help much until issue 20726 is implemented.
(0056565)
Felipe Monteiro de Carvalho (developer)
2012-02-06 10:13

Oh, yes, and thanks a lot ludo =)

- Issue History
Date Modified Username Field Change
2012-02-01 18:02 willians cleyton New Issue
2012-02-01 18:02 willians cleyton File Added: LazarusAndroid.zip
2012-02-01 18:02 willians cleyton Widgetset => CustomDrawn
2012-02-03 07:53 Felipe Monteiro de Carvalho Project Lazarus => FPC
2012-02-03 07:55 Felipe Monteiro de Carvalho Note Added: 0056276
2012-02-03 07:56 Felipe Monteiro de Carvalho Note Edited: 0056276
2012-02-03 07:56 Felipe Monteiro de Carvalho Status new => acknowledged
2012-02-03 07:56 Felipe Monteiro de Carvalho FPCOldBugId => 0
2012-02-03 07:56 Felipe Monteiro de Carvalho Category Custom Drawn => FCL
2012-02-03 07:56 Felipe Monteiro de Carvalho Product Version 0.9.30.3 (SVN) =>
2012-02-03 11:21 Marco van de Voort Note Added: 0056281
2012-02-03 11:22 Marco van de Voort Note Edited: 0056281
2012-02-03 11:53 willians cleyton Note Added: 0056286
2012-02-03 12:30 Marco van de Voort Note Added: 0056287
2012-02-03 12:30 Marco van de Voort Status acknowledged => assigned
2012-02-03 12:30 Marco van de Voort Assigned To => Felipe Monteiro de Carvalho
2012-02-03 12:32 Marco van de Voort Note Edited: 0056287
2012-02-03 12:33 Marco van de Voort Note Edited: 0056287
2012-02-03 19:15 willians cleyton Note Added: 0056293
2012-02-04 08:07 Ludo Brands Note Added: 0056311
2012-02-04 08:19 Felipe Monteiro de Carvalho Note Added: 0056312
2012-02-04 08:19 Felipe Monteiro de Carvalho Note Edited: 0056312
2012-02-04 08:19 Felipe Monteiro de Carvalho Relationship added related to 0020726
2012-02-04 09:40 Ludo Brands Note Added: 0056313
2012-02-04 10:57 Ludo Brands Note Added: 0056316
2012-02-04 10:58 Ludo Brands Note Edited: 0056316
2012-02-04 12:01 Ludo Brands Note Edited: 0056316
2012-02-06 10:12 Felipe Monteiro de Carvalho Fixed in Revision => 20267
2012-02-06 10:12 Felipe Monteiro de Carvalho Status assigned => resolved
2012-02-06 10:12 Felipe Monteiro de Carvalho Fixed in Version => 2.7.1
2012-02-06 10:12 Felipe Monteiro de Carvalho Resolution open => fixed
2012-02-06 10:12 Felipe Monteiro de Carvalho Note Added: 0056564
2012-02-06 10:13 Felipe Monteiro de Carvalho Status resolved => feedback
2012-02-06 10:13 Felipe Monteiro de Carvalho Resolution fixed => reopened
2012-02-06 10:13 Felipe Monteiro de Carvalho Note Added: 0056565
2012-02-06 10:13 Felipe Monteiro de Carvalho Status feedback => resolved
2012-02-06 10:13 Felipe Monteiro de Carvalho Resolution reopened => fixed
2012-05-14 15:46 Felipe Monteiro de Carvalho Relationship added has duplicate 0021207



MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker