View Issue Details

IDProjectCategoryView StatusLast Update
0025686LazarusWidgetsetpublic2016-04-06 13:36
Reportersamuel herzogAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformarmOSandroidOS Version
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0025686: Regression: Android Application crashes when clicking onto a button.
DescriptionI have a little demo project.

It works fine if I compile it with a fpc version from May 2013.
If I compile it with a more recent version, the application crashes when clicking onto a button.

Q: how to determ the version of my fpc-folders?
Additional InformationI/ActivityManager( 77): START {act=android.intent.action.MAIN cat=[android.int
ent.category.LAUNCHER] flg=0x10200000 cmp=com.pascal.project1/.LCLActivity} from
 pid 172
W/WindowManager( 77): Failure taking screenshot for (180x300) to layer 21005
D/dalvikvm( 719): Not late-enabling CheckJNI (already on)
I/ActivityManager( 77): Start proc com.pascal.project1 for activity com.pascal
.project1/.LCLActivity: pid=719 uid=10040 gids={3003, 1015}
I/dalvikvm( 719): Turning on JNI app bug workarounds for target SDK version 8..
.
W/NetworkManagementSocketTagger( 77): setKernelCountSet(10040, 1) failed with
errno -2
I/Process ( 77): Sending signal. PID: 719 SIG: 3
I/dalvikvm( 719): threadid=3: reacting to signal 3
I/dalvikvm( 719): Wrote stack traces to '/data/anr/traces.txt'
I/lclapp ( 719): Trying to load liblclapp.so
D/dalvikvm( 719): Trying to load lib /data/data/com.pascal.project1/lib/liblcla
pp.so 0x412a0740
D/dalvikvm( 719): Added shared lib /data/data/com.pascal.project1/lib/liblclapp
.so 0x412a0740
I/lclapp ( 719): JNI_OnLoad called
I/lclapp ( 719): Reading our Activity Class
I/lclapp ( 719): JNI_OnLoad finished
I/lclapp ( 719): LCLOnCreate called by LCLActivity.onCreate
I/Process ( 77): Sending signal. PID: 719 SIG: 3
I/dalvikvm( 719): threadid=3: reacting to signal 3
I/dalvikvm( 719): Wrote stack traces to '/data/anr/traces.txt'
I/lclapp ( 719): [TCDWSCustomForm.ShowHide] First form layout adjustment lOldD
PI=96 lNewDPI=240 lOldFormWidth=355 lNewFormWidth=100
V/PhoneStatusBar( 129): setLightsOn(true)
I/Process ( 77): Sending signal. PID: 719 SIG: 3
I/dalvikvm( 719): threadid=3: reacting to signal 3
I/dalvikvm( 719): Wrote stack traces to '/data/anr/traces.txt'
D/gralloc_goldfish( 719): Emulator without GPU emulation detected.
I/lclapp ( 719): [LCLOnConfigurationChanged] i=0 lOldDPI=240 lNewDPI=240 lOldF
ormWidth=100 lNewFormWidth=480
D/dalvikvm( 719): GC_FOR_ALLOC freed 52K, 3% free 9087K/9347K, paused 76ms
I/dalvikvm-heap( 719): Grow heap (frag case) to 10.267MB for 1390096-byte alloc
ation
D/dalvikvm( 719): GC_CONCURRENT freed 1K, 3% free 10443K/10759K, paused 5ms+5ms

I/Process ( 77): Sending signal. PID: 719 SIG: 3
I/dalvikvm( 719): threadid=3: reacting to signal 3
I/dalvikvm( 719): Wrote stack traces to '/data/anr/traces.txt'
W/InputManagerService( 77): Starting input on non-focused client com.android.i
nternal.view.IInputMethodClient$Stub$Proxy@415916e0 (uid=10013 pid=172)
I/ActivityManager( 77): Displayed com.pascal.project1/.LCLActivity: +2s815ms
W/NetworkManagementSocketTagger( 77): setKernelCountSet(10013, 0) failed with
errno -2
F/libc ( 719): Fatal signal 11 (SIGSEGV) at 0x614c540e (code=1)
I/DEBUG ( 34): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *
**
I/DEBUG ( 34): Build fingerprint: 'generic/sdk/generic:4.0.4/MR1/302030:eng/
test-keys'
I/DEBUG ( 34): pid: 719, tid: 719 >>> com.pascal.project1 <<<
I/DEBUG ( 34): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 614c540
e
I/DEBUG ( 34): r0 4835f560 r1 00000018 r2 00000118 r3 614c540f
I/DEBUG ( 34): r4 0000003d r5 0000005f r6 00000004 r7 435a14fc
I/DEBUG ( 34): r8 bef30664 r9 435a14f0 10 47ef0fc6 fp bef302ac
I/DEBUG ( 34): ip bef302b0 sp bef30258 lr 480a2534 pc 614c540e cpsr 200
00030
I/DEBUG ( 34): d0 ffffffe0c202f680 d1 ffffffef3f800000
I/DEBUG ( 34): d2 0000000000000006 d3 000000003f000000
I/DEBUG ( 34): d4 4146000000000000 d5 41c0000040400000
I/DEBUG ( 34): d6 40c00000c1880000 d7 0000000000000000
I/DEBUG ( 34): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 34): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 34): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 34): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 34): scr 60000013
I/DEBUG ( 34):
I/DEBUG ( 34): #00 pc 614c540e
I/DEBUG ( 34): 0000001 lr 480a2534 /data/data/com.pascal.project1/lib
/liblclapp.so
I/DEBUG ( 34):
I/DEBUG ( 34): code around pc:
I/DEBUG ( 34): 614c53ec ffffffff ffffffff ffffffff ffffffff ...............
.
I/DEBUG ( 34): 614c53fc ffffffff ffffffff ffffffff ffffffff ...............
.
I/DEBUG ( 34): 614c540c ffffffff ffffffff ffffffff ffffffff ...............
.
I/DEBUG ( 34): 614c541c ffffffff ffffffff ffffffff ffffffff ...............
.
I/DEBUG ( 34): 614c542c ffffffff ffffffff ffffffff ffffffff ...............
.
I/DEBUG ( 34):
I/DEBUG ( 34): code around lr:
I/DEBUG ( 34): 480a2514 e590003c e51b2044 e51b1040 e51b303c <...D ..@...<0.
.
I/DEBUG ( 34): 480a2524 e593303c e5933000 e5933068 e12fff33 <0...0..h0..3./
.
I/DEBUG ( 34): 480a2534 e3500000 0a00001b e51b0040 e3500000 ..P.....@.....P
.
I/DEBUG ( 34): 480a2544 ba000018 e51b003c e1a01000 e5911000 ....<..........
.
I/DEBUG ( 34): 480a2554 e59110b0 e12fff31 e51b1040 e1510000 ....1./.@.....Q
.
I/DEBUG ( 34):
I/DEBUG ( 34): memory map around addr 614c540e:
I/DEBUG ( 34): 486f5000-4886c000 /dev/ashmem/gralloc-buffer (deleted)
I/DEBUG ( 34): (no map for address)
I/DEBUG ( 34): b0001000-b0009000 /system/bin/linker
I/DEBUG ( 34):
I/DEBUG ( 34): stack:
I/DEBUG ( 34): bef30218 00000001
I/DEBUG ( 34): bef3021c 4835f500
I/DEBUG ( 34): bef30220 bef3027c [stack]
I/DEBUG ( 34): bef30224 bef30230 [stack]
I/DEBUG ( 34): bef30228 480f0e20 /data/data/com.pascal.project1/lib/li
blclapp.so
I/DEBUG ( 34): bef3022c 480eead0 /data/data/com.pascal.project1/lib/li
blclapp.so
I/DEBUG ( 34): bef30230 00000040
I/DEBUG ( 34): bef30234 00012810 [heap]
I/DEBUG ( 34): bef30238 00000004
I/DEBUG ( 34): bef3023c 435a14fc
I/DEBUG ( 34): bef30240 bef302c4 [stack]
I/DEBUG ( 34): bef30244 4837ff20
I/DEBUG ( 34): bef30248 00000000
I/DEBUG ( 34): bef3024c 00000000
I/DEBUG ( 34): bef30250 4836fc5c
I/DEBUG ( 34): bef30254 4827da34 /data/data/com.pascal.project1/lib/li
blclapp.so
I/DEBUG ( 34): #00 bef30258 00012810 [heap]
I/DEBUG ( 34): bef3025c 47fe3fb0 /data/data/com.pascal.project1/lib/li
blclapp.so
I/DEBUG ( 34): bef30260 4836f4e0
I/DEBUG ( 34): bef30264 00012810 [heap]
I/DEBUG ( 34): bef30268 00000118
I/DEBUG ( 34): bef3026c 00000018
I/DEBUG ( 34): bef30270 483e7220
I/DEBUG ( 34): bef30274 bef302d8 [stack]
I/DEBUG ( 34): bef30278 00000000
I/DEBUG ( 34): bef3027c 00000000
I/DEBUG ( 34): bef30280 00000000
I/DEBUG ( 34): bef30284 483e73a0
I/DEBUG ( 34): bef30288 bef302c4 [stack]
I/DEBUG ( 34): bef3028c 00000000
I/DEBUG ( 34): bef30290 00000000
I/DEBUG ( 34): bef30294 48073294 /data/data/com.pascal.project1/lib/li
blclapp.so
I/DEBUG ( 34): bef30298 00000000
I/DEBUG ( 34): bef3029c 0000003d
I/BootReceiver( 77): Copying /data/tombstones/tombstone_04 to DropBox (SYSTEM_
TOMBSTONE)
D/Zygote ( 37): Process 719 terminated by signal (11)
I/ActivityManager( 77): Process com.pascal.project1 (pid 719) has died.
W/ActivityManager( 77): Force removing ActivityRecord{4141f0a0 com.pascal.proj
ect1/.LCLActivity}: app died, no saved state
W/NetworkManagementSocketTagger( 77): setKernelCountSet(10040, 0) failed with
errno -2
I/WindowManager( 77): WIN DEATH: Window{415de3b8 com.pascal.project1/com.pasca
l.project1.LCLActivity paused=false}
I/InputDispatcher( 77): Dropping event because there is no touched window or f
ocused application.
W/NetworkManagementSocketTagger( 77): setKernelCountSet(10013, 1) failed with
errno -2
D/dalvikvm( 77): GC_CONCURRENT freed 215K, 10% free 11534K/12743K, paused 6ms+
23ms
I/Process ( 77): Sending signal. PID: 172 SIG: 3
I/dalvikvm( 172): threadid=3: reacting to signal 3
I/dalvikvm( 172): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 172): GC_FOR_ALLOC freed 4086K, 23% free 17480K/22599K, paused 79ms

W/InputManagerService( 77): Got RemoteException sending setActive(false) notif
ication to pid 719 uid 10040
I/Process ( 77): Sending signal. PID: 172 SIG: 3
I/dalvikvm( 172): threadid=3: reacting to signal 3
I/dalvikvm( 172): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 77): Sending signal. PID: 172 SIG: 3
I/dalvikvm( 172): threadid=3: reacting to signal 3
I/dalvikvm( 172): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 172): GC_FOR_ALLOC freed 658K, 21% free 17968K/22599K, paused 77ms
D/dalvikvm( 172): GC_FOR_ALLOC freed 379K, 17% free 18970K/22599K, paused 79ms
D/dalvikvm( 172): GC_CONCURRENT freed 1401K, 14% free 19599K/22599K, paused 6ms
+15ms
I/dalvikvm( 172): Jit: resizing JitTable from 4096 to 8192
TagsNo tags attached.
Fixed in Revisionr52114
LazTarget-
Widgetset
Attached Files
  • customdrawnproc.pas.patch (741 bytes)
    Index: customdrawnproc.pas
    ===================================================================
    --- customdrawnproc.pas	(revision 44586)
    +++ customdrawnproc.pas	(working copy)
    @@ -473,6 +473,7 @@
       lBaseWindowOrg: TPoint;
       lControlStateEx: TCDControlStateEx;
       lDrawControl: Boolean;
    +  lRegion:TLazRegionWithChilds;
     begin
       Result := False;
     
    @@ -504,7 +505,9 @@
       ACanvas.Clipping := True;
       ACDWinControl.Region.Rect := Bounds(lBaseWindowOrg.X, lBaseWindowOrg.Y - ACDForm.ScrollY,
         lWinControl.Width, lWinControl.Height);
    -  ACanvas.ClipRegion := ACDWinControl.Region;
    +  lRegion := TLazRegionWithChilds.Create;
    +  lRegion.Assign(ACDWinControl.Region);
    +  ACanvas.ClipRegion := lRegion;
     
       lControlCanvas := ACanvas;
     
    

Activities

samuel herzog

2014-02-07 06:19

developer   ~0072891

https://dl.dropboxusercontent.com/u/3753548/fpc_not_working.7z
https://dl.dropboxusercontent.com/u/3753548/fpc_working.7z

https://dl.dropboxusercontent.com/u/3753548/project1_not_working.7z
https://dl.dropboxusercontent.com/u/3753548/project1_working.7z

Yuriy Sydorov

2014-02-08 12:22

developer   ~0072927

There is no sense in reporting compiler issues by providing LCL projects.
First it is needed to find out exact code block which causes crash (probably in LCL). Make sure it is the compiler issue. Create a simple non-LCL program that reproduce this issue.
If the issue is LCL-related report a bug to Lazarus.

Maciej Izak

2014-02-08 12:45

developer   ~0072934

Last edited: 2014-02-08 12:46

View 2 revisions

IMO the bug exist (wrong codegen?) in "CustomDrawnInt.pas" -> "customdrawnobject_android.inc" in function

------begin code------
function Java_com_pascal_lclproject_LCLActivity_LCLOnTouch(env:PJNIEnv;this:jobject; x, y: single; action: jint): jint; cdecl;
var
  lCurForm: TCDNonNativeForm;
  lTarget: TWinControl;
  lEventPos: TPoint;
begin
  {$ifdef VerboseCDEvents}
  __android_log_write(ANDROID_LOG_INFO,'lclapp',PChar(Format('LCLOnTouch called x=%f y=%f action=%d', [x, y, action])));
  {$endif}
  eventResult := 0;

  lCurForm := GetCurrentForm();

  case action of
    ACTION_DOWN:
    begin
      CallbackMouseDown(lCurForm, Round(X), Round(Y), mbLeft, []);
    end;
    ACTION_UP:
    begin
      CallbackMouseUp(lCurForm, Round(X), Round(Y), mbLeft, []);
    end;
    ACTION_MOVE: CallbackMouseMove(lCurForm, Round(X), Round(Y), []);
  end;

  // This sends messages like Invalidate requests
  Result := eventResult;
end;
------end------

because when I comment code in this way (LCLActivity.java), all works fine

-------begin java------
    @Override public boolean onTouchEvent (MotionEvent event)
    {
      // int eventResult = LCLOnTouch(event.getX(), event.getY(), event.getAction());
      // if ((eventResult | 1) != 0) lclsurface.postInvalidate();
      return true;
    }
------end java------

samuel herzog

2014-02-08 12:57

developer   ~0072937

Hello yuri, thank you for your answer. Sorry i am not an expert on fpc.
I have provided two links to two zipped fpc-folders. If i compile project1 with the fpc from may then it works.

If i compile the same project1 with the newer fpc, then it does not work. So my conclusion was, that it either has something to do with fpc or with changed project/compiler switches.

Could you explain me, how to find out the revision numbers of these two fpc-folders?

Yuriy Sydorov

2014-02-08 13:28

developer   ~0072939

Maciej Izak, sure, the bug may be in the compiler. But I need the exact pascal code which causes the crash.
Firt, you need to double check the JNI part (method signature, registration) of the LCLOnTouch function.
Then comment out code in LCLOnTouch to find out the exact crash location.

samuel herzog, the bug may be in a user code, but it can be triggered only by some fpc version, but be unnoticed with other fpc version. Since Maciej Izak knows possible crash place it is better do dig in that direction.

Leslie

2014-03-16 22:12

reporter   ~0073751

Yury,

Handling the touch event invalidates the display. As a result a redraw takes place and the crush occurs executing Java_com_pascal_lclproject_LCLActivity_LCLDrawToBitmap around a TLAZCANVAS.SETCOLOR call. Here is the log:

 --------- beginning of /dev/log/main

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/AudioResampler( 2391): mPhaseIncrement = 986500300, 3acccccc, in=44100, out=48000

D/ALSAModule( 2391): open called for devices 00000004 in mode 0...

D/ALSAModule( 2391): input handle: (null), devName = AndroidPlayback_Headset_normal

E/ALSALib ( 2391): external/alsa-lib/src/control/cards.c:230:(snd_card_get_aml_card) cardname =AML-RT5631, card = 0

D/ALSAModule( 2391): SND_PCM_STREAM_PLAYBACK card : 0

D/ALSAModule( 2391): ---- devName = hw:0

W/ALSAModule( 2391): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian)

W/ALSAModule( 2391): Using 2 channels for PLAYBACK.

W/ALSAModule( 2391): requestedRate=48000

W/ALSAModule( 2391): returned Rate=48000, handle->rate=48000

I/ALSAModule( 2391): Set PLAYBACK sample rate to 48000 HZ

I/ALSAModule( 2391): Buffer size: 4096

I/ALSAModule( 2391): Latency: 85333

I/ALSAModule( 2391): Initialized ALSA PLAYBACK device hw:0

I/AudioResampler( 2391): mPhaseIncrement = 986500300, 3acccccc, in=44100, out=48000

I/AudioResampler( 2391): mPhaseIncrement = 986500300, 3acccccc, in=44100, out=48000

I/AudioResampler( 2391): mPhaseIncrement = 986500300, 3acccccc, in=44100, out=48000

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

F/libc (12186): Fatal signal 11 (SIGSEGV) at 0x614c540e (code=1), thread 12186 (.pascal.lcltest)

I/DEBUG ( 2387): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG ( 2387): Build fingerprint: 'MID/d5h86v_8188/d5h86v_8188:4.1.1/20130117/eng.root.20130117.172735:user/test-keys'

I/DEBUG ( 2387): pid: 12186, tid: 12186, name: .pascal.lcltest >>> com.pascal.lcltest <<<

I/DEBUG ( 2387): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 614c540e

I/DEBUG ( 2387): r0 5a58f010 r1 00000088 r2 0000010b r3 614c540f

I/DEBUG ( 2387): r4 00000052 r5 000000a7 r6 00000004 r7 40e6e3b4

I/DEBUG ( 2387): r8 beb1e6f4 r9 40e6e3a8 sl 4102e9e8 fp beb1e2cc

I/DEBUG ( 2387): ip beb1e2d0 sp beb1e278 lr 5d75915c pc 614c540e cpsr 200d0030

I/DEBUG ( 2387): d0 0000010000000100 d1 0000000100000001

I/DEBUG ( 2387): d2 0000000000000000 d3 f00f000000ff0000

I/DEBUG ( 2387): d4 00ff000036c90000 d5 ff00000080000000

I/DEBUG ( 2387): d6 00ff000000800000 d7 0000000000000000

I/DEBUG ( 2387): d8 0000000000000000 d9 0000000000000000

I/DEBUG ( 2387): d10 0000000000000000 d11 0000000000000000

I/DEBUG ( 2387): d12 0000000000000000 d13 0000000000000000

I/DEBUG ( 2387): d14 0000000000000000 d15 0000000000000000

I/DEBUG ( 2387): d16 0000000000000000 d17 f0f0000000000000

I/DEBUG ( 2387): d18 00ff00ff00ff00ff d19 0000000000000000

I/DEBUG ( 2387): d20 fffffff8fffffff8 d21 0000000000000000

I/DEBUG ( 2387): d22 0000000036360000 d23 0000000000000000

I/DEBUG ( 2387): d24 0000000000000000 d25 0000000000000000

I/DEBUG ( 2387): d26 ff00ff00ff00ff00 d27 f000000000000000

I/DEBUG ( 2387): d28 0000000000000000 d29 0000000000000000

I/DEBUG ( 2387): d30 0000000000000000 d31 0000000036000000

I/DEBUG ( 2387): scr 60000011

I/DEBUG ( 2387):

I/DEBUG ( 2387): backtrace:

I/DEBUG ( 2387): #00 pc 614c540e <unknown>

I/DEBUG ( 2387): 0000001 pc 000f3158 /data/data/com.pascal.lcltest/lib/liblclapp.so (LAZCANVAS$_$TLAZCANVAS_$__$$_SETCOLOR$LONGINT$LONGINT$TFPCOLOR+128)

I/DEBUG ( 2387):

I/DEBUG ( 2387): stack:

I/DEBUG ( 2387): beb1e238 00000026

I/DEBUG ( 2387): beb1e23c 5bdb1d60

I/DEBUG ( 2387): beb1e240 beb1e29c [stack]

I/DEBUG ( 2387): beb1e244 beb1e250 [stack]

I/DEBUG ( 2387): beb1e248 5d799984 /data/data/com.pascal.lcltest/lib/liblclapp.so (INTFGRAPHICS$_$TLAZINTFIMAGE_$__$$_GETINTERNALCOLOR$LONGINT$LONGINT$$TFPCOLOR+64)

I/DEBUG ( 2387): beb1e24c 5d7976bc /data/data/com.pascal.lcltest/lib/liblclapp.so (INTFGRAPHICS$_$TLAZINTFIMAGE_$__$$_GETCOLOR_BPP32_A8R8G8B8_BIO_TTB$LONGINT$LONGINT$TFPCOLOR+12)

I/DEBUG ( 2387): beb1e250 4102e9d8 [heap]

I/DEBUG ( 2387): beb1e254 00000004

I/DEBUG ( 2387): beb1e258 40e6e3b4

I/DEBUG ( 2387): beb1e25c beb1e6f4 [stack]

I/DEBUG ( 2387): beb1e260 beb1e2f8 [stack]

I/DEBUG ( 2387): beb1e264 5a5b2960

I/DEBUG ( 2387): beb1e268 00000000

I/DEBUG ( 2387): beb1e26c 00000000

I/DEBUG ( 2387): beb1e270 5bdb1d9c

I/DEBUG ( 2387): beb1e274 5d8ad864 /data/data/com.pascal.lcltest/lib/liblclapp.so (VMT_$FPCANVAS_$$_TFPEMPTYFONT)

I/DEBUG ( 2387): #00 beb1e278 4102e9d8 [heap]

I/DEBUG ( 2387): ........ ........

I/DEBUG ( 2387): 0000001 beb1e278 4102e9d8 [heap]

I/DEBUG ( 2387): beb1e27c 5d6e7e1c /data/data/com.pascal.lcltest/lib/liblclapp.so (SYSTEM$_$TOBJECT_$__$$_NEWINSTANCE$$TOBJECT+88)

I/DEBUG ( 2387): beb1e280 5aca2990

I/DEBUG ( 2387): beb1e284 4102e9d8 [heap]

I/DEBUG ( 2387): beb1e288 0000010b

I/DEBUG ( 2387): beb1e28c 00000088

I/DEBUG ( 2387): beb1e290 5a608160

I/DEBUG ( 2387): beb1e294 beb1e2f8 [stack]

I/DEBUG ( 2387): beb1e298 00000000

I/DEBUG ( 2387): beb1e29c 00000000

I/DEBUG ( 2387): beb1e2a0 00000000

I/DEBUG ( 2387): beb1e2a4 5a6088b0

I/DEBUG ( 2387): beb1e2a8 beb1e2f8 [stack]

I/DEBUG ( 2387): beb1e2ac 00000000

I/DEBUG ( 2387): beb1e2b0 00000000

I/DEBUG ( 2387): beb1e2b4 5d7424f0 /data/data/com.pascal.lcltest/lib/liblclapp.so (FPIMGCANV$_$TFPIMAGECANVAS_$__$$_GETCOLOR$LONGINT$LONGINT$$TFPCOLOR+104)

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near r0:

I/DEBUG ( 2387): 5a58eff0 5d747f8c 5d748648 5d747f8c 5d748648 ..t]H.t]..t]H.t]

I/DEBUG ( 2387): 5a58f000 5d6e81c0 5d70575c 00000000 00000000 ..n]\Wp]........

I/DEBUG ( 2387): 5a58f010 5d8b4bb4 5a5b2e60 5bdb1190 00000088 .K.]`.[Z...[....

I/DEBUG ( 2387): 5a58f020 0000010b 00000130 0000015e 00000000 ....0...^.......

I/DEBUG ( 2387): 5a58f030 00000000 00000000 deadbeef 0303c071 ............q...

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near r3:

I/DEBUG ( 2387): 614c53ec ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c53fc ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c540c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c541c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c542c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near r7:

I/DEBUG ( 2387): 40e6e394 5a57e966 56e89168 00000006 00000000 f.WZh..V........

I/DEBUG ( 2387): 40e6e3a4 415c8c98 00000320 000001a9 415d41d8 ..\A ........A]A

I/DEBUG ( 2387): 40e6e3b4 40e6e404 58368bfa 56e8a130 5a57e966 ...@..6X0..Vf.WZ

I/DEBUG ( 2387): 40e6e3c4 00000000 58575090 000001a9 00000320 .....PWX.... ...

I/DEBUG ( 2387): 40e6e3d4 00000320 415c8c98 415d41d8 00000000 .....\A.A]A....

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near r8:

I/DEBUG ( 2387): beb1e6d4 401ec3ab 00000000 00000000 beb1e70c ...@............

I/DEBUG ( 2387): beb1e6e4 beb1e6f0 40774e34 5d6f8b94 415d41d8 ....4Nw@..o].A]A

I/DEBUG ( 2387): beb1e6f4 4079fa03 40e6e3a4 00000001 415c8c98 ..y@...@......\A

I/DEBUG ( 2387): beb1e704 5a57fece 415c07b4 407a4087 40e6e3a4 ..WZ..\A.@z@...@

I/DEBUG ( 2387): beb1e714 5a57feca 5d6f8b88 4102e9e8 00000000 ..WZ..o]...A....

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near r9:

I/DEBUG ( 2387): 40e6e388 00000000 00000000 40e6e3c8 5a57e966 ...........@f.WZ

I/DEBUG ( 2387): 40e6e398 56e89168 00000006 00000000 415c8c98 h..V..........\A

I/DEBUG ( 2387): 40e6e3a8 00000320 000001a9 415d41d8 40e6e404 ........A]A...@

I/DEBUG ( 2387): 40e6e3b8 58368bfa 56e8a130 5a57e966 00000000 ..6X0..Vf.WZ....

I/DEBUG ( 2387): 40e6e3c8 58575090 000001a9 00000320 00000320 .PWX.... ... ...

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near sl:

I/DEBUG ( 2387): 4102e9c8 00000000 00000800 40016008 00000453 .........`.@S...

I/DEBUG ( 2387): 4102e9d8 583752a8 40e6e3a4 56e8a130 40025000 .R7X...@0..V.P.@

I/DEBUG ( 2387): 4102e9e8 000001a9 4104a0a8 beb1e820 00000000 .......A .......

I/DEBUG ( 2387): 4102e9f8 beb1e854 00000001 00000000 40774fc0 T............Ow@

I/DEBUG ( 2387): 4102ea08 00000000 00000000 561bfa70 40e69300 ........p..V...@

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near fp:

I/DEBUG ( 2387): beb1e2ac 00000000 00000000 5d7424f0 00000000 .........$t]....

I/DEBUG ( 2387): beb1e2bc 00000052 beb1e374 beb1e2d0 5d75a9d4 R...t.........u]

I/DEBUG ( 2387): beb1e2cc 5d7590e4 5d759084 5d725f64 5d6e7c40 ..u]..u]d_r]@|n]

I/DEBUG ( 2387): beb1e2dc beb1e324 00000000 0000009e 00000053 $...........S...

I/DEBUG ( 2387): beb1e2ec 5a608160 5a5fc240 5bdb1d60 00000000 `.`Z@._Z`..[....

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near ip:

I/DEBUG ( 2387): beb1e2b0 00000000 5d7424f0 00000000 00000052 .....$t]....R...

I/DEBUG ( 2387): beb1e2c0 beb1e374 beb1e2d0 5d75a9d4 5d7590e4 t.........u]..u]

I/DEBUG ( 2387): beb1e2d0 5d759084 5d725f64 5d6e7c40 beb1e324 ..u]d_r]@|n]$...

I/DEBUG ( 2387): beb1e2e0 00000000 0000009e 00000053 5a608160 ........S...`.`Z

I/DEBUG ( 2387): beb1e2f0 5a5fc240 5bdb1d60 00000000 ffff0000 @._Z`..[........

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory near sp:

I/DEBUG ( 2387): beb1e258 40e6e3b4 beb1e6f4 beb1e2f8 5a5b2960 ...@........`)[Z

I/DEBUG ( 2387): beb1e268 00000000 00000000 5bdb1d9c 5d8ad864 ...........[d..]

I/DEBUG ( 2387): beb1e278 4102e9d8 5d6e7e1c 5aca2990 4102e9d8 ...A.~n].).Z...A

I/DEBUG ( 2387): beb1e288 0000010b 00000088 5a608160 beb1e2f8 ........`.`Z....

I/DEBUG ( 2387): beb1e298 00000000 00000000 00000000 5a6088b0 ..............`Z

I/DEBUG ( 2387):

I/DEBUG ( 2387): code around pc:

I/DEBUG ( 2387): 614c53ec ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c53fc ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c540c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c541c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387): 614c542c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 2387):

I/DEBUG ( 2387): code around lr:

I/DEBUG ( 2387): 5d75913c e590003c e51b2044 e51b1040 e51b303c <...D ..@...<0..

I/DEBUG ( 2387): 5d75914c e593303c e5933000 e5933068 e12fff33 <0...0..h0..3./.

I/DEBUG ( 2387): 5d75915c e3500000 0a000019 e51b0040 e3500000 ..P.....@.....P.

I/DEBUG ( 2387): 5d75916c ba000016 e51b003c e5901000 e59110b0 ....<...........

I/DEBUG ( 2387): 5d75917c e12fff31 e51b1040 e1510000 aa00000f 1./.@.....Q.....

I/DEBUG ( 2387):

I/DEBUG ( 2387): memory map around fault addr 614c540e:

I/DEBUG ( 2387): 5db8d000-5dce8000 /dev/ump

I/DEBUG ( 2387): (no map for address)

I/DEBUG ( 2387): beafe000-beb1f000 [stack]

--------- beginning of /dev/log/system

I/BootReceiver( 3487): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)

W/InputDispatcher( 3487): channel '419fdef0 com.pascal.lcltest/com.pascal.lcltest.LCLActivity (server)' ~ Consumer closed input channel or an error occurred. events=0xd

E/InputDispatcher( 3487): channel '419fdef0 com.pascal.lcltest/com.pascal.lcltest.LCLActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

D/Zygote ( 2389): Process 12186 terminated by signal (11)

W/InputDispatcher( 3487): Attempted to unregister already unregistered input channel '419fdef0 com.pascal.lcltest/com.pascal.lcltest.LCLActivity (server)'

I/WindowState( 3487): WIN DEATH: Window{419fdef0 com.pascal.lcltest/com.pascal.lcltest.LCLActivity paused=false}

I/ActivityManager( 3487): Process com.pascal.lcltest (pid 12186) has died.

W/ActivityManager( 3487): Force removing ActivityRecord{419c2d68 com.pascal.lcltest/.LCLActivity}: app died, no saved state

I/WindowManager( 3487): WINDOW DIED Window{419fdef0 com.pascal.lcltest/com.pascal.lcltest.LCLActivity paused=false}

W/InputMethodManagerService( 3487): Got RemoteException sending setActive(false) notification to pid 12186 uid 10067

I/wpa_supplicant( 3945): [CTRL_IFACE]wlan0: SIGNAL_POLL

Hope this helps. :)

Leslie

Do-wan Kim

2014-03-17 00:15

reporter   ~0073756

this error?

http://stackoverflow.com/questions/17840521/android-fatal-signal-11-sigsegv-at-0x636f7d89-code-1-how-can-it-be-tracked

Yuriy Sydorov

2014-03-17 11:47

developer   ~0073772

Android log is not useful to me as the FPC developer (not Lazarus developer).
To display that the bug is related to FPC (compiler/rtl/packages) you need to track down the exact line in LCL sources that triggers the error.
It is better to move this bug report to Lazarus/LCL. Then Lazarus/Android developers can track the issue and report correct FPC bug if there will be any.

Leslie

2014-03-26 22:07

reporter   ~0073996

Yury,

The same pascal source is working with earlier revisions of the compiler and causes causes SIGSEGV when complied with later revisions. I understand that this does not makes it absolutely certain that it is a compiler issue, but it is still the most likely scenario. I thought the above log contained all the info. The most relevant part starts from "backtrace". I do not know what other info I could provide. Maybe the Lazarus guys know better, but my impression is that this issue has not grabbed anyone's attention yet.

Leslie

samuel herzog

2014-03-28 07:53

developer   ~0074034

Hi,

I have spent another 20 hour's to find the problem, but no luck.

@Maciej: I can not confirm you observation about commenting the two lines in OnTouch-Event. Which steps needs to be done after commenting these two lines?

@Yury: The application also dies if you create a new/empty project.

Maciej Izak

2014-03-29 23:44

developer   ~0074071

Last edited: 2014-03-29 23:44

View 2 revisions

@Samuel: Sorry for the absence. I was working on this long time ago. AFAIK if you block input for the application (in java file or maybe in FPC LCLOnTouch too), the error is gone. I will be able to describe my observations soon. I need more time. This error is very mischievous...

Regards,
hnb

samuel herzog

2014-03-30 06:26

developer   ~0074072

I need some information to successfully track down the problem.
As you already know I have two fpc-folders called "fpc_41139" and "fpc_43585".

If I rename the folder "fpc_41139" into "fpc" and compile an new/empty project, it works fine on the android simulator.

I I rename the folder "fpc_43585" into "fpc" and compile an new/empty project, the app is shown at start-up but a soon as I click onto the form, the app crashes.

Now I am trying to find the problem by using beyondcompare to compare this two folders.

To narrow down the possible candidates, could someone give me some hints which files can be deleted/excluded (e.g. *.ppu;*.o; because at the moment there are about 4000 differences.

Thank you for your advice.

Leslie

2014-04-02 14:18

reporter   ~0074117

Last edited: 2014-04-06 20:01

View 10 revisions

Finally I had some time to investigate this problem. Yury was spot on, the problem was NOT caused by the compiler. The faulty code is in customdrawnproc.RenderWinControl:

ACanvas.ClipRegion := ACDWinControl.Region;

In this line a reference is stored to an other objects property. Which did not cause a problem until FPC r24555, when a memory leak caused by not freeing TFPCustomCanvas.FClipRegion in TFPCustomCanvas destructor was fixed. From this point destroying the canvas object destroyed ACDWinControl.Region.

The solution is to create a separate object:

function RenderWinControl(var AImage: TLazIntfImage; var ACanvas: TLazCanvas;
  ACDWinControl: TCDWinControl; ACDForm: TCDForm): Boolean;
var
...
lRegion : TLazRegionWithChilds; <-- add a local variable
...
// --> replace the faulty line above with this

  lRegion := TLazRegionWithChilds.Create;
  lRegion.Assign(ACDWinControl.Region);
  ACanvas.ClipRegion := lRegion;

samuel herzog

2014-04-02 20:40

developer   ~0074124

Ok, the problem was not in fpc. I can confirm that leslie's change fixes the problem.

I have created a svn-patch file.
Would be nice if someone could review. I don't see where the newly created object will be freed?

samuel herzog

2014-04-02 20:41

developer  

customdrawnproc.pas.patch (741 bytes)
Index: customdrawnproc.pas
===================================================================
--- customdrawnproc.pas	(revision 44586)
+++ customdrawnproc.pas	(working copy)
@@ -473,6 +473,7 @@
   lBaseWindowOrg: TPoint;
   lControlStateEx: TCDControlStateEx;
   lDrawControl: Boolean;
+  lRegion:TLazRegionWithChilds;
 begin
   Result := False;
 
@@ -504,7 +505,9 @@
   ACanvas.Clipping := True;
   ACDWinControl.Region.Rect := Bounds(lBaseWindowOrg.X, lBaseWindowOrg.Y - ACDForm.ScrollY,
     lWinControl.Width, lWinControl.Height);
-  ACanvas.ClipRegion := ACDWinControl.Region;
+  lRegion := TLazRegionWithChilds.Create;
+  lRegion.Assign(ACDWinControl.Region);
+  ACanvas.ClipRegion := lRegion;
 
   lControlCanvas := ACanvas;
 

samuel herzog

2014-04-02 20:43

developer   ~0074125

The problem can be fixed with the applied patch in lcl\interfaces\customdrawn.

Leslie

2014-04-02 20:58

reporter   ~0074127

Last edited: 2014-04-02 21:04

View 3 revisions

Samuel,

"I don't see where the newly created object will be freed?"

since r24555 TFPCustomCanvas frees TFPCustomCanvas.FClipRegion in its destructor. ACanvas is an instance of TLazCanvas, which is a descendent of TFPCustomCanvas, so it will happen when the ACanvas object is destroyed.

Leslie

2014-04-02 23:48

reporter   ~0074129

Last edited: 2014-04-03 09:11

View 6 revisions

I did some thinking about possible memory leaks. There are two ways to go. The choice depends on whose responsibility is to free the current value of the TFPCustomCanvas.ClipRegion property when assigning a new value:

 a)caller - every caller must be aware and create the code accordingly. (Probably riskier, more room for mistakes)

 b)TFPCustomCanvas, the setter can make sure the previous value is freed. (may not be suitable for other usage scenarios)

Code for a)

lcl\interfaces\customdrawn\customdrawnproc.pas

function RenderWinControl(
...
  if Assigned(ACanvas.ClipRegion) then begin
    if (ACanvas.ClipRegion is TLazRegionWithChilds) then begin
       TLazRegionWithChilds(ACanvas.ClipRegion).Assign(ACDWinControl.Region);
       Exit;
    end
    else
      ACanvas.ClipRegion.Free;
  end;

  lRegion:= TLazRegionWithChilds.Create;
  lRegion.Assign(ACDWinControl.Region);
  ACanvas.ClipRegion := lRegion;
...

Code for b)

lcl\interfaces\customdrawn\customdrawnproc.pas

function RenderWinControl(
...
    if Assigned(ACanvas.ClipRegion) and (ACanvas.ClipRegion is TLazRegionWithChilds) then
       TLazRegionWithChilds(ACanvas.ClipRegion).Assign(ACDWinControl.Region)
    else begin
        lRegion:= TLazRegionWithChilds.Create;
        lRegion.Assign(ACDWinControl.Region);
        ACanvas.ClipRegion := lRegion;
    end;
...

fpcsrc\packages\fcl-image\src\fpccanvas.inc

procedure TFPCustomCanvas.SetClipRegion(AValue: TFPCustomRegion);
begin
  if FClipRegion = AValue then Exit;

  if Assigned(FClipRegion) then
    FClipRegion.Free;

  FClipRegion := AValue;
end;

Leslie

2014-05-04 13:09

reporter   ~0074752

I would recommend to create a new patch based on the code in the previous note.

Leslie

2016-03-03 11:45

reporter   ~0090587

Maybe the status of this report should be changed.

Leslie

2016-03-23 09:34

reporter   ~0091280

Is there any thing missing to close this report?

Juha Manninen

2016-03-23 09:47

developer   ~0091281

Last edited: 2016-03-23 09:48

View 2 revisions

Is the problem solved? What about the patch?
This was assigned to samuel herzog but he has no commit access to Lazarus repo. I can commit if needed.

Maciej Izak

2016-04-06 12:38

developer   ~0091783

IIRC the patch was right, I can retest it with trunk if needed. Maybe Leslie suggestions are also proper.

Juha Manninen

2016-04-06 13:36

developer   ~0091789

I applied the patch. Please test.

Issue History

Date Modified Username Field Change
2014-02-07 04:16 samuel herzog New Issue
2014-02-07 06:19 samuel herzog Note Added: 0072891
2014-02-08 12:22 Yuriy Sydorov Note Added: 0072927
2014-02-08 12:45 Maciej Izak Note Added: 0072934
2014-02-08 12:46 Maciej Izak Note Edited: 0072934 View Revisions
2014-02-08 12:57 samuel herzog Note Added: 0072937
2014-02-08 13:28 Yuriy Sydorov Note Added: 0072939
2014-03-16 22:12 Leslie Note Added: 0073751
2014-03-17 00:15 Do-wan Kim Note Added: 0073756
2014-03-17 11:47 Yuriy Sydorov Note Added: 0073772
2014-03-17 11:47 Yuriy Sydorov Project FPC => Lazarus
2014-03-26 22:07 Leslie Note Added: 0073996
2014-03-28 07:53 samuel herzog Note Added: 0074034
2014-03-29 23:44 Maciej Izak Note Added: 0074071
2014-03-29 23:44 Maciej Izak Note Edited: 0074071 View Revisions
2014-03-30 06:26 samuel herzog Note Added: 0074072
2014-04-02 14:18 Leslie Note Added: 0074117
2014-04-02 14:33 Leslie Note Edited: 0074117 View Revisions
2014-04-02 14:48 Leslie Note Edited: 0074117 View Revisions
2014-04-02 18:05 Leslie Note Edited: 0074117 View Revisions
2014-04-02 18:11 Leslie Note Edited: 0074117 View Revisions
2014-04-02 19:28 Leslie Note Edited: 0074117 View Revisions
2014-04-02 19:40 Leslie Note Edited: 0074117 View Revisions
2014-04-02 19:49 Leslie Note Edited: 0074117 View Revisions
2014-04-02 20:40 samuel herzog Note Added: 0074124
2014-04-02 20:41 samuel herzog File Added: customdrawnproc.pas.patch
2014-04-02 20:43 samuel herzog LazTarget => -
2014-04-02 20:43 samuel herzog Note Added: 0074125
2014-04-02 20:43 samuel herzog Assigned To => samuel herzog
2014-04-02 20:43 samuel herzog Status new => confirmed
2014-04-02 20:58 Leslie Note Added: 0074127
2014-04-02 21:00 Leslie Note Edited: 0074127 View Revisions
2014-04-02 21:04 Leslie Note Edited: 0074127 View Revisions
2014-04-02 23:48 Leslie Note Added: 0074129
2014-04-02 23:49 Leslie Note Edited: 0074129 View Revisions
2014-04-02 23:49 Leslie Note Edited: 0074129 View Revisions
2014-04-03 00:07 Leslie Note Edited: 0074129 View Revisions
2014-04-03 00:28 Leslie Note Edited: 0074129 View Revisions
2014-04-03 09:11 Leslie Note Edited: 0074129 View Revisions
2014-04-03 19:49 Leslie Note Edited: 0074117 View Revisions
2014-04-06 20:01 Leslie Note Edited: 0074117 View Revisions
2014-05-04 13:09 Leslie Note Added: 0074752
2016-03-03 11:45 Leslie Note Added: 0090587
2016-03-03 17:21 Bart Broersma Category Compiler => Widgetset
2016-03-03 17:21 Bart Broersma Product Version 2.7.1 =>
2016-03-23 09:34 Leslie Note Added: 0091280
2016-03-23 09:47 Juha Manninen Note Added: 0091281
2016-03-23 09:48 Juha Manninen Assigned To samuel herzog => Juha Manninen
2016-03-23 09:48 Juha Manninen Status confirmed => assigned
2016-03-23 09:48 Juha Manninen Status assigned => feedback
2016-03-23 09:48 Juha Manninen Note Edited: 0091281 View Revisions
2016-04-06 12:38 Maciej Izak Note Added: 0091783
2016-04-06 13:36 Juha Manninen Fixed in Revision => r52114
2016-04-06 13:36 Juha Manninen Note Added: 0091789
2016-04-06 13:36 Juha Manninen Status feedback => resolved
2016-04-06 13:36 Juha Manninen Resolution open => fixed