Author Topic: Lazarus 1.6 broke my app  (Read 14051 times)

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Lazarus 1.6 broke my app
« on: September 04, 2016, 02:04:30 pm »
After compiling my app with Lazarus 1.6/fpc 3 rather than a year(s) old trunk, it does not work on my phone anymore!

It just gets stuck at

Quote
Code: [Select]
D/dalvikvm( 5021): Trying to load lib /data/data/de.benibela.videlibri/lib/liblclapp.so 0x40d5f048

And strace says its stuck

Quote
Code: [Select]
[pid  5050] writev(3, [{"\3", 1}, {"dalvikvm\0", 9}, {"Trying to load lib /data/data/de"..., 80}], 3) = 90
[pid  5050] stat64("/data/data/de.benibela.videlibri/lib/liblclapp.so", {st_mode=S_IFREG|0755, st_size=7288852, ...}) = 0
[pid  5050] open("/data/data/de.benibela.videlibri/lib/liblclapp.so", O_RDONLY) = 45
[pid  5050] lseek(45, 0, SEEK_SET)      = 0
[pid  5050] read(45, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\204}\20\0004\0\0\0"..., 4096) = 4096
[pid  5050] lseek(45, -8, SEEK_END)     = 7288844
[pid  5050] read(45, "\1\0\0\0\0\0\0\0", 8) = 8
[pid  5050] mmap2(NULL, 7380992, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x47eac000
[pid  5050] mmap2(0x47eac000, 7016004, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 45, 0) = 0x47eac000
[pid  5050] mprotect(0x47eac000, 7016448, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
[pid  5050] mmap2(0x4855d000, 271356, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 45, 0x6b1) = 0x4855d000
[pid  5050] mmap2(0x485a0000, 88852, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x485a0000
[pid  5050] close(45)                   = 0
[pid  5050] stat64("/vendor/lib/libjnigraphics.so", 0xbef8df68) = -1 ENOENT (No such file or directory)
[pid  5050] stat64("/system/lib/libjnigraphics.so", {st_mode=S_IFREG|0644, st_size=5416, ...}) = 0
[pid  5050] open("/system/lib/libjnigraphics.so", O_RDONLY) = 45
[pid  5050] lseek(45, 0, SEEK_SET)      = 0
[pid  5050] read(45, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 4096) = 4096
[pid  5050] lseek(45, -8, SEEK_END)     = 5408
[pid  5050] read(45, "\1\0\0\0\0\0\0\0", 8) = 8
[pid  5050] mmap2(NULL, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x441a1000
[pid  5050] mmap2(0x441a1000, 2076, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 45, 0) = 0x441a1000
[pid  5050] mprotect(0x441a1000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
[pid  5050] mmap2(0x441a2000, 272, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 45, 0x1) = 0x441a2000
[pid  5050] close(45)                   = 0
[pid  5050] mprotect(0x441a1000, 4096, PROT_READ|PROT_EXEC) = 0
[pid  5050] mprotect(0x47eac000, 7016448, PROT_READ|PROT_EXEC) = 0
[pid  5050] mprotect(0x40a2b000, 4096, PROT_READ|PROT_WRITE) = 0
[pid  5050] mprotect(0x40a2b000, 4096, PROT_READ) = 0
[pid  5050] getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
[pid  5050] rt_sigaction(SIGFPE, {0x47fe1c90, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_SIGINFO, 0x47fbcb9c}, {0xb0005ab1, [RT_5 RT_9 RT_19], SA_RESTART|SA_SIGINFO}, 8) = 0
[pid  5050] rt_sigaction(SIGSEGV, {0x47fe1c90, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_SIGINFO, 0x47fbcb9c}, {0xb0005ab1, [RT_5 RT_9 RT_19], SA_RESTART|SA_SIGINFO}, 8) = 0
[pid  5050] rt_sigaction(SIGBUS, {0x47fe1c90, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_SIGINFO, 0x47fbcb9c}, {0xb0005ab1, [RT_5 RT_9 RT_19], SA_RESTART|SA_SIGINFO}, 8) = 0
[pid  5050] rt_sigaction(SIGILL, {0x47fe1c90, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_SIGINFO, 0x47fbcb9c}, {0xb0005ab1, [RT_5 RT_9 RT_19], SA_RESTART|SA_SIGINFO}, 8) = 0
[pid  5050] ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbef8e0b0) = -1 ENOTTY (Not a typewriter)
[pid  5050] ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbef8e0b0) = -1 ENOTTY (Not a typewriter)
[pid  5050] ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbef8e0b0) = -1 ENOTTY (Not a typewriter)
[pid  5050] ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbef8e0b0) = -1 ENOTTY (Not a typewriter)
[pid  5050] readlink("/proc/self/exe", "/system/bin/app_process", 255) = 23
[pid  5050] rt_sigaction(SIGFPE, {0xb0005ab1, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x47fbcb9c}, NULL, 8) = 0
[pid  5050] rt_sigaction(SIGSEGV, {0xb0005ab1, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x47fbcb9c}, NULL, 8) = 0
[pid  5050] rt_sigaction(SIGBUS, {0xb0005ab1, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x47fbcb9c}, NULL, 8) = 0
[pid  5050] rt_sigaction(SIGILL, {0xb0005ab1, [RT_1 RT_6 RT_7 RT_14 RT_16 RT_17], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x47fbcb9c}, NULL, 8) = 0
[pid  5050] open("/etc/timezone", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  5050] stat64("/etc/localtime", 0xbef8e050) = -1 ENOENT (No such file or directory)
[pid  5050] stat64("/usr/lib/zoneinfo/localtime", 0xbef8e050) = -1 ENOENT (No such file or directory)
[pid  5050] open("/usr/share/zoneinfo/localtime", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  5050] gettimeofday({1472990078, 162223}, {4294967176, 0}) = 0
[pid  5050] mmap2(NULL, 4556, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x44f19000
[pid  5050] mmap2(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x47c42000
[pid  5050] futex(0xb00143b4, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid  5060] <... futex resumed> )       = -1 ETIMEDOUT (Connection timed out)
[pid  5060] clock_gettime(CLOCK_MONOTONIC, {8853, 525163658}) = 0
[pid  5060] futex(0x13f9c8, FUTEX_WAIT_PRIVATE, -2, NULL

and then it waits forever and does not get anywhere.

What is going on? Is it stuck on the first initialization section?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 13052
  • FPC developer.
Re: Lazarus 1.6 broke my app
« Reply #1 on: September 06, 2016, 09:36:58 am »
Doesn't say much, except the clock monotonic seems to suggest it is stuck in a loop with gettickcount or some other loop with time checking.

Thaddy

  • Hero Member
  • *****
  • Posts: 19978
  • Pointless static linking author
Re: Lazarus 1.6 broke my app
« Reply #2 on: September 06, 2016, 12:26:52 pm »
Doesn't say much, except the clock monotonic seems to suggest it is stuck in a loop with gettickcount or some other loop with time checking.

He knows he has to put in a reproducable example in code. He gave up on doing that. Bit of a sorry state he's in  O:-)
Maybe we should help him?  :o %)
Any "programmer" that knows only one programming language is not a programmer

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Re: Lazarus 1.6 broke my app
« Reply #3 on: September 11, 2016, 03:15:50 pm »
This is not so easy to run anything on this crap Android phone.

My USB cable is broken, so I load the things on it using adb-over-network.

On friday I tried doing it, but suddenly it stopped working. Then I noticed I could not access the internet anymore even on my laptop. ADB must have send invalid packages that crashed my entire wifi router.

Today I have been installing things, then the phone turned off and suddenly the phone power key stopped working. I could not start it anymore and had to reboot it.

Afterwards  adb  got stuck on installing, because I had changed the partitions to be readonly and forgot to remount it as rw after the reboot, so it could not install anything.

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Re: Lazarus 1.6 broke my app
« Reply #4 on: September 11, 2016, 05:41:02 pm »
So it loads the .so. And the imports except libdl:

Code: [Select]
$ cat /proc/3109/maps
b0001000-b0009000 r-xp 00001000 1f:03 378        /system/bin/linker
befd3000-beff4000 rw-p 00000000 00:00 0          [stack]
...
40000000-40003000 r-xp 00000000 1f:03 1011       /system/lib/liblog.so
40003000-40004000 rw-p 00003000 1f:03 1011       /system/lib/liblog.so
40004000-40046000 r-xp 00000000 1f:03 758        /system/lib/libc.so
40046000-40049000 rw-p 00042000 1f:03 758        /system/lib/libc.so
...
481c1000-4875e000 r-xp 00000000 00:10 3973       /mnt/sdcard/liblclapp.so
4875e000-487b5000 rw-p 0059d000 00:10 3973       /mnt/sdcard/liblclapp.so

Now gdb (on my laptop) is frozen and does not react anymore on anything.

But I got a stack trace.

Code: [Select]
(gdb) info frame
Stack level 0, frame at 0xbeff3350:
 pc = 0xb0001990; saved pc 0xbeff3354
 called by frame at 0xbeff3350
 Arglist at 0xbeff3310, args:
 Locals at 0xbeff3310, Previous frame's sp is 0xbeff3350
 Saved registers:
  r11 at 0xbeff3340, r12 at 0xbeff3344, lr at 0xbeff3348
(gdb) bt
#0  0xb0001990 in ?? ()
#1  0xbeff3354 in ?? ()
#2  0xbeff3354 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) info registers
r0             0xfffffe00 4294966784
r1             0x80 128
r2             0x2 2
r3             0x0 0
r4             0xb00143b4 2952872884
r5             0x0 0
r6             0x2 2
r7             0xf0 240
r8             0x40828f40 1082298176
r9             0x9 9
r10            0x4361cd04 1130482948
r11            0xbeff350c 3204396300
r12            0x2 2
sp             0xbeff3310 0xbeff3310
lr             0xb00068b0 2952816816
pc             0xb0001990 0xb0001990
cpsr           0x60000010 1610612752


And a stack dump: With resolved symbols:

Code: [Select]
0xbeff3310: 0xb00143b4 0x00000001 0x47f0818c 0x0000000d
0xbeff3320: 0x00000004 0x20000000 0x40828f40 0x00000009
0xbeff3330: 0x4361cd04 0xb0005a15 0x486901a4 0x48392164 => 0x4CF1A4 messagesystem.pas:115 0x1D1164 lazclasses.pas:277
0xbeff3340: 0x00000000 0x483922e4 0xbeff3354 0x00000000 => 0x1D12E4 lazclasses.pas:277
0xbeff3350: 0x00000001 0x486901a4 0x0000000d 0x00000004 => 0x4CF1A4 messagesystem.pas:115
0xbeff3360: 0x20000000 0x40828f40 0x00000009 0x4361cd04
0xbeff3370: 0xbeff350c 0xbeff3348 0x483922c4 0x00000000 => 0x1D12C4 lazclasses.pas:277
0xbeff3380: 0x47f0818c 0x00000001 0x0000004b 0x483919c0 => 0x1D09C0 lazclasses.pas:277
0xbeff3390: 0x00000000 0x00000000 0x00000000 0x482a6ca4 => 0xE5CA4 videlibriandroid.pas:31
0xbeff33a0: 0x47f08144 0x00000020 0x47f30020 0x20000000
0xbeff33b0: 0x40828f40 0x482ace7c 0x487b8e34 0x47f08144 => 0xEBE7C videlibriandroid.pas:31
0xbeff33c0: 0x00000010 0x482ad3dc 0x47f08140 0x00000004 => 0xEC3DC videlibriandroid.pas:31
0xbeff33d0: 0x47f30020 0x482ac190 0x487b8e34 0x482e9de0
0xbeff33e0: 0x487b8e34 0x47f08140 0x00000000 0x482ea1ac
0xbeff33f0: 0x487b8e34 0x47f08140 0x00000000 0x482ea2d8
0xbeff3400: 0x482eafd0 0x47f08120 0x487b8e34 0x0000004b
0xbeff3410: 0x0000000a 0x482a81b8 0x0000004b 0x482f79cc
0xbeff3420: 0x48659ee4 0x482f7b7c 0x00000000 0x47f30020
0xbeff3430: 0xbeff343c 0x00000000 0x00000001 0x0000004b
0xbeff3440: 0x0000000a 0x00000004 0x20000000 0x40828f40
0xbeff3450: 0x00000009 0x4361cd04 0xbeff350c 0xbeff3420
0xbeff3460: 0x482f78f0 0x00000000 0x0000004b 0x00000060
0xbeff3470: 0x00000004 0x20000000 0x40828f40 0x482ace7c
0xbeff3480: 0x487b8e34 0x0000004b 0xffffffff 0x482a7ac4 => 0xE6AC4 videlibriandroid.pas:31
0xbeff3490: 0x487b8e34 0x482a66ec 0x47f28054 0x482adc30 => 0xE56EC videlibriandroid.pas:31 0xECC30 videlibriandroid.pas:31
0xbeff34a0: 0x00000000 0x482fb36c 0x0000004b 0x48391e98 => 0x13A36C intfbaselcl.inc:0  lazclasses.pas:277
0xbeff34b0: 0x487b8e34 0x482aaf0c 0x00000001 0x4875e004 => 0xE9F0C videlibriandroid.pas:31
0xbeff34c0: 0x00000002 0x482aaf64 0x00000001 0x48289608 => 0xE9F64 videlibriandroid.pas:31 0xC8608 videlibriandroid.pas:29
0xbeff34d0: 0x4361cd04 0x4002f60b 0x00000000 0x40022b93 -> 0x4002f60b -> 0x2B60B libc _thread_atexit_unlock
                                                                    2b606:       f7e6 ee3e       blx     12284 <pthread_mutex_unlock>
                                                                    2b60a:       bd10            pop     {r4, pc}
                                                           -> 0x40022b93 -> 0x1EB93 libc __cxa_atexit>
                                                                    1eb8e:       f00c fd37       bl      2b600 <_thread_atexit_unlock>
                                                                    1eb92:       b007            add     sp, #28

0xbeff34e0: 0x481c15a1 0x0006cf04 0xb00094f0 0x482ab384 => 0x5A1 librarysearcher.pas:0, 0xEA384 videlibriandroid.pas:31
0xbeff34f0: 0x00000000 0x4875e6ac 0xb00094fc 0x4875e004
0xbeff3500: 0xbeff351c 0xbeff3510 0x48289574 0x48289600 => 0xC8574 librarysearcher.pas:0,  0xC8600 videlibriandroid.pas:28
0xbeff3510: 0x47e895af 0xbeff3520 0xb0003a99 0x48289548 => lcl 0xC8548 librarysearcher.pas:0
0xbeff3520: 0xb000e22c 0xb000e228 0xb000970c 0xb00046eb
0xbeff3530: 0xb000e148 0xb000e148 0xb000e1ec 0x001c1038
0xbeff3540: 0x00000000 0xffffffff 0x4875e000 0xb0012978
0xbeff3550: 0xffffffff 0xb000e1d4 0xb000e148 0xb000e1d8
0xbeff3560: 0x00000001 0xb0005195 0xffffffff 0x00000000
0xbeff3570: 0x00000052 0x00000000 0x00000018 0x4089bb6b
0xbeff3580: 0x4089c4c8 0x4089bb6b 0x487b5000 0x0060b000 => lcl mapping end
0xbeff3590: 0x0000002d 0x481c1000 0xb00094f0 0x00016594 => 0x481c1000 lcl 0
0xbeff35a0: 0x00000004 0xb000e240 0xb000e244 0xb000e1e0
0xbeff35b0: 0xbeff36a8 0x00000001 0x00000000 0x40018c93 -> 0x14C93 000136d4 <dlmalloc_stats>:
                                                               14c8e:       f7fd eafa       blx     12284 <pthread_mutex_unlock>
                                                               14c92:       b00b            add     sp, #44 ; 0x2c
0xbeff35c0: 0x0000005b 0xc751932b 0x00000021 0x408bcf74
0xbeff35d0: 0x000158f0 0x4086a66d 0x00000003 0x000000da
0xbeff35e0: 0x4004c4d4 0x00000800 0x001e1d08 0x00000003  -> 0x484D4 libc __dso_handle
0xbeff35f0: 0x001e1d20 0x00000003 0x4004c4d4 0x000001b4  -> 0x484D4 libc __dso_handle
0xbeff3600: 0x40828f40 0x40a34d30 0x0001a080 0x47dac370
0xbeff3610: 0xbeff3648 0x4085a925 0x001af890 0x47dad008
0xbeff3620: 0x00000003 0x000000da 0x0026ab18 0x00000050
0xbeff3630: 0x40828f40 0x00000009 0x4361cca8 0x40019af3  -> 0x15AF3  000153f0 <dlfree>:
                                                             15aee:       f7fc ebca       blx     12284 <pthread_mutex_unlock>
                                                             15af2:       b003            add     sp, #12
0xbeff3640: 0x4004c510 0x00000003 0x001e1d20 0x001e1d20  -> 0x48510   000483a0 <__dso_handle>: ??
0xbeff3650: 0x001e1d08 0x40a34d30 0x00015900 0x4001a043  -> 0x16043   00016034 <free>:
                                                             16040:       4798            blx     r3
                                                             16042:       bd10            pop     {r4, pc}
0xbeff3660: 0x001e1d20 0x4087cb31 0xbeff3684 0x00000000
0xbeff3670: 0x00000000 0x43eb211e 0x4361ccd8 0x000158f0
0xbeff3680: 0x40a49c70 0x4083ac10 0x16b00029 0x000158f0
0xbeff3690: 0x408bcf74 0xbeff36c0 0x43623480 0xbeff3704
0xbeff36a0: 0x00000000 0x408c1cd8 0xfffffe80 0x4083e3b0
0xbeff36b0: 0x00000030 0x40d4d018 0x00013808 0xbeff37b8
0xbeff36c0: 0x00000370 0x40884ba7 0x000158f0 0x40ef5d08
0xbeff36d0: 0xfffffe80 0x4086a6b1 0xfffffe80 0x40ef5d08
0xbeff36e0: 0x00000000 0x408c1cd8 0x00000030 0x4083dc5c
0xbeff36f0: 0x00000018 0x40d4d018 0x00013808 0x00000000
0xbeff3700: 0x408bcf74 0x447bf8cc 0x4361cd4c 0x438c40a0
0xbeff3710: 0x0019a690 0x40ef5c88 0x408c3a20 0xbeff3838
0xbeff3720: 0x00000000 0xbeff38b4 0x00000018 0x00000001
0xbeff3730: 0x43623480 0x000158f0 0x4401c8ec 0x40828f40
0xbeff3740: 0x00000001 0x43623480 0x000158f0 0x408761e1
0xbeff3750: 0x4401c8ec 0xbeff3760 0x00000003 0x000000da
0xbeff3760: 0x4004c4d4 0x00000010 0x40828f40 0x00000000  -> 0x484D4 libc __dso_handle
0xbeff3770: 0x0024bdf4 0x40019af3 0x40828f40 0x00000000  -> 0x15AF3  000153f0 <dlfree>: ^^
0xbeff3780: 0x000158f0 0x00000000 0x0019d398 0x0001f360
0xbeff3790: 0x44003782 0x47c8eff6 0x00000001 0x00000001
0xbeff37a0: 0x001c1030 0x00000003 0x00000023 0x000001b4
0xbeff37b0: 0x40828f40 0x00000009 0x001c1030 0x00000000
0xbeff37c0: 0x000158f0 0x001c1030 0x001c1030 0x000158f0
0xbeff37d0: 0x40d5c440 0xb0005a1b 0x00000001 0x40864ae9
0xbeff37e0: 0x00000000 0xffffffff 0x40ef5c58 0x00000364
0xbeff37f0: 0x408bcf74 0xbeff3824 0x00000001 0x00000014
0xbeff3800: 0x0000006e 0x408c1cd8 0x00000000 0x00000000
0xbeff3810: 0x001c1030 0x00015900 0x40af58b0 0x4087c5d9
0xbeff3820: 0x43edc984 0x00000000 0x43eda828 0x4361cd34
0xbeff3830: 0x000158f0 0x4083ac10 0x0001a080 0x000158f0
0xbeff3840: 0x408bcf74 0xbeff3870 0x436cabf8 0xbeff38b4
0xbeff3850: 0x00000000 0x408c1cd8 0xfffffe80 0x4083e3b0
0xbeff3860: 0x40828f40 0x448c21a0 0x0005e218 0xbeff3920
0xbeff3870: 0x00000000 0x000001b4 0x44a46844 0x00000000
0xbeff3880: 0x4361cd18 0x408bcf74 0x00000000 0x00059af8
0xbeff3890: 0x000158f0 0x4087f74f 0x00000001 0x408bcf74
0xbeff38a0: 0x00000000 0x408bcf74 0x4004c4d4 0x00000000 -> 0x484D4 libc __dso_handle
0xbeff38b0: 0x40828f40 0x459f8bbc 0x4361ce8c 0x4362c2a8
0xbeff38c0: 0x0001f398 0x40d58d68 0x408c3a20 0xbeff39a8
0xbeff38d0: 0x00000000 0xbeff3a24 0x000158f0 0x4361ce9c
0xbeff38e0: 0x436cabf8 0x000158f0 0x408bcf74 0x40828f40
0xbeff38f0: 0x00000009 0x4361ceb0 0xfffffe80 0x40875f25
0xbeff3900: 0x00013808 0x408c3a38 0x00000370 0x00000001
0xbeff3910: 0x40d58e1c 0x40d58d24 0x00000001 0x40a2c2a8
0xbeff3920: 0xfffffe80 0x40d58e08 0x00000001 0x000072f4
0xbeff3930: 0x408c1cd8 0x4083dba8 0x436b5460 0x40859a89
0xbeff3940: 0x40a4a9b0 0x00000001 0x408bcf74 0x40a2ce90
0xbeff3950: 0x00000001 0x40828f40 0x40d58e08 0xc751932b
0xbeff3960: 0x4089bb6b 0x00000000 0x436cabf8 0x00000000
0xbeff3970: 0x00015900 0x4087d5cb 0x40a2c2a8 0x00000000
0xbeff3980: 0x00000000 0x40a2c2a8 0x40d58d10 0x40d58e08
0xbeff3990: 0x4361cf38 0x43ee4ca6 0x4361cef8 0x000158f0
0xbeff39a0: 0x40a302e0 0x4083ac10 0x4361cfb8 0x000158f0
0xbeff39b0: 0x408bcf74 0xbeff39e0 0x4366b368 0xbeff3a24
0xbeff39c0: 0x00000000 0x408c1cd8 0xfffffe80 0x4083e3b0
0xbeff39d0: 0x4366abf8 0x000158f0 0x45a18677 0xbeff3aa8
0xbeff39e0: 0x00010008 0x4366abf8 0x000158f0 0x408761e1
0xbeff39f0: 0x45a18677 0xbeff3a00 0x00000000 0x00000000
0xbeff3a00: 0xfffffe80 0x4366ac0c 0x00000000 0xbeff3a98
0xbeff3a10: 0x40a4a608 0x40881425 0xbeff3a28 0x00000008
0xbeff3a20: 0xbeff3a98 0x00000000 0x4361cf98 0x00000000
0xbeff3a30: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3a40: 0x00000000 0x00000000 0x40196cbc 0x0000000a
0xbeff3a50: 0x4366b368 0x000158f0 0x45a186a9 0x00000000
0xbeff3a60: 0x00000000 0x00000000 0x00000000 0x408761db
0xbeff3a70: 0x45a186a9 0xbeff3a80 0x4361cfc0 0x00000001
0xbeff3a80: 0x000b2320 0x4085e099 0x00000001 0xbeff3ae4
0xbeff3a90: 0x4366b368 0x000b2320 0x1fe00015 0x4085eec7
0xbeff3aa0: 0xbeff3aa8 0xbeff3ae4 0x40a4a608 0x4366b368
0xbeff3ab0: 0x000b2320 0x000158f0 0x40a4a608 0x4085eea5
0xbeff3ac0: 0x408baca8 0x4015a88f 0x000b2320 0xbeff3ae4
0xbeff3ad0: 0x408baca8 0x40860b69 0x1d300021 0x4015b3d9
0xbeff3ae0: 0x4366b368 0x1fe00015 0x4008ebb1 0x401b0bbc -> 4008... libcutils.so
0xbeff3af0: 0x0000b70e 0x0000b733 0x00000000 0x400889c5
0xbeff3b00: 0x400912e4 0xbeff3b18 0x00012d00 0x400888d9
0xbeff3b10: 0x2e302e34 0x00000034 0x00000000 0x00000000
0xbeff3b20: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3b30: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3b40: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3b50: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3b60: 0x000df38b 0x00000000 0x00000004 0x000122e0
0xbeff3b70: 0x0000bfe9 0x0000d1e8 0xbeff3d32 0xffffffbc
0xbeff3b80: 0x00000001 0x0000a0a1 0x00000004 0xbeff3c18
0xbeff3b90: 0x00000004 0xbeff3d32 0x0000b668 0x0000b678
0xbeff3ba0: 0xbeff3c28 0x00000000 0x00000001 0xbeff3d11
0xbeff3bb0: 0xbeff3c60 0x0000d028 0x401af7d0 0x000121a8
0xbeff3bc0: 0x0000000f 0x00000000 0x00000008 0xbeff3d32
0xbeff3bd0: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3be0: 0x00000000 0xbeff3c14 0x00000005 0xbeff3c2c
0xbeff3bf0: 0x00009bb4 0x4001a665 0x00009bb8 0x00000000 -> 0x4001a665 -> 0x16665 -> libc __libc_init>
                                                           16662:       47b8            blx     r7
                                                           16664:       f008 fba6       bl      1edb4 <exit>
0xbeff3c00: 0x00000000 0x00000000 0x00000000 0xb00046eb
0xbeff3c10: 0x00000005 0xbeff3d11 0xbeff3d29 0xbeff3d32
0xbeff3c20: 0xbeff3d3e 0xbeff3d47 0x00000000 0xbeff3d5d
0xbeff3c30: 0xbeff3d7a 0xbeff3db7 0xbeff3ddf 0xbeff3df2
0xbeff3c40: 0xbeff3e07 0xbeff3e1c 0xbeff3e37 0xbeff3e4a
0xbeff3c50: 0xbeff3e64 0xbeff3e7d 0xbeff3fa8 0xbeff3fcb
0xbeff3c60: 0x00000000 0x00000010 0x00000197 0x00000006
0xbeff3c70: 0x00001000 0x00000011 0x00000064 0x00000003
0xbeff3c80: 0x00008034 0x00000004 0x00000020 0x00000005
0xbeff3c90: 0x00000007 0x00000007 0x00000000 0x00000008
0xbeff3ca0: 0x00000000 0x00000009 0x00009ba0 0x0000000b
0xbeff3cb0: 0x00000000 0x0000000c 0x00000000 0x0000000d
0xbeff3cc0: 0x00000000 0x0000000e 0x00000000 0x00000017
0xbeff3cd0: 0x00000000 0x00000019 0xbeff3cfd 0x0000001f
0xbeff3ce0: 0xbeff3fe4 0x0000000f 0xbeff3d0d 0x00000000
0xbeff3cf0: 0x00000000 0x00000000 0x00000000 0x4d564800
0xbeff3d00: 0xf9e4ee43 0x525ba072 0x2f74b455 0x6c367693
0xbeff3d10: 0x2e656400 0x696e6562 0x616c6562 0x61796d2e
0xbeff3d20: 0x6f72646e 0x00006469 0x00000000 0x00000000
0xbeff3d30: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3d40: 0x00000000 0x00000000 0x00000000 0x00000000
0xbeff3d50: 0x00000000 0x00000000 0x00000000 0x54584500
0xbeff3d60: 0x414e5245 0x54535f4c 0x4741524f 0x6d2f3d45
0xbeff3d70: 0x732f746e 0x72616364 0x41500064 0x2f3d4854
0xbeff3d80: 0x6e696273 0x65762f3a 0x726f646e 0x6e69622f
0xbeff3d90: 0x79732f3a 0x6d657473 0x6962732f 0x732f3a6e
0xbeff3da0: 0x65747379 0x69622f6d 0x732f3a6e 0x65747379
0xbeff3db0: 0x62782f6d 0x4c006e69 0x494c5f44 0x52415242
0xbeff3dc0: 0x41505f59 0x2f3d4854 0x646e6576 0x6c2f726f
0xbeff3dd0: 0x2f3a6269 0x74737973 0x6c2f6d65 0x41006269
0xbeff3de0: 0x4f52444e 0x425f4449 0x4c544f4f 0x3d4f474f
0xbeff3df0: 0x4e410031 0x494f5244 0x41435f44 0x3d454843
0xbeff3e00: 0x6361632f 0x41006568 0x4f52444e 0x525f4449
0xbeff3e10: 0x3d544f4f 0x7379732f 0x006d6574 0x52444e41
0xbeff3e20: 0x5f44494f 0x45535341 0x2f3d5354 0x74737973
0xbeff3e30: 0x612f6d65 0x41007070 0x4f52444e 0x445f4449
0xbeff3e40: 0x3d415441 0x7461642f 0x53410061 0x4d5f4345
0xbeff3e50: 0x544e554f 0x4e494f50 0x6d2f3d54 0x612f746e
0xbeff3e60: 0x00636573 0x504f4f4c 0x554f4d5f 0x4f50544e
0xbeff3e70: 0x3d544e49 0x746e6d2f 0x62626f2f 0x4f4f4200
0xbeff3e80: 0x414c4354 0x41505353 0x2f3d4854 0x74737973
0xbeff3e90: 0x662f6d65 0x656d6172 0x6b726f77 0x726f632f
0xbeff3ea0: 0x616a2e65 0x732f3a72 0x65747379 0x72662f6d
0xbeff3eb0: 0x77656d61 0x2f6b726f 0x65726f63 0x6e756a2d
0xbeff3ec0: 0x6a2e7469 0x2f3a7261 0x74737973 0x662f6d65
0xbeff3ed0: 0x656d6172 0x6b726f77 0x756f622f 0x6379636e
0xbeff3ee0: 0x6c747361 0x616a2e65 0x732f3a72 0x65747379
0xbeff3ef0: 0x72662f6d 0x77656d61 0x2f6b726f 0x2e747865
0xbeff3f00: 0x3a72616a 0x7379732f 0x2f6d6574 0x6d617266
0xbeff3f10: 0x726f7765 0x72662f6b 0x77656d61 0x2e6b726f
0xbeff3f20: 0x3a72616a 0x7379732f 0x2f6d6574 0x6d617266
0xbeff3f30: 0x726f7765 0x6e612f6b 0x696f7264 0x6f702e64
0xbeff3f40: 0x7963696c 0x72616a2e 0x79732f3a 0x6d657473
0xbeff3f50: 0x6172662f 0x6f77656d 0x732f6b72 0x69767265
0xbeff3f60: 0x2e736563 0x3a72616a 0x7379732f 0x2f6d6574
0xbeff3f70: 0x6d617266 0x726f7765 0x70612f6b 0x65686361
0xbeff3f80: 0x6c6d782d 0x72616a2e 0x79732f3a 0x6d657473
0xbeff3f90: 0x6172662f 0x6f77656d 0x662f6b72 0x65746c69
0xbeff3fa0: 0x2e776672 0x0072616a 0x52444e41 0x5f44494f
0xbeff3fb0: 0x504f5250 0x59545245 0x524f575f 0x4150534b
0xbeff3fc0: 0x393d4543 0x3139342c 0x41003235 0x4f52444e
0xbeff3fd0: 0x535f4449 0x454b434f 0x797a5f54 0x65746f67
0xbeff3fe0: 0x0030313d 0x7379732f 0x2f6d6574 0x2f6e6962
0xbeff3ff0: 0x5f707061 0x636f7270 0x00737365 0x00000000

But all the address in the pas are outside the code. Before the first begin or on  the last.

Thaddy

  • Hero Member
  • *****
  • Posts: 19978
  • Pointless static linking author
Re: Lazarus 1.6 broke my app
« Reply #5 on: September 11, 2016, 07:45:27 pm »
Give sourcecode, not stacktraces. I am not prepared to reverse engineer. I am prepared to replicate or refute issues with sourcecode and I have plenty of time for that.
Any "programmer" that knows only one programming language is not a programmer

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Re: Lazarus 1.6 broke my app
« Reply #6 on: September 11, 2016, 07:50:47 pm »
The source does not really matter.

Now I removed everything and it freezes the same:

Code: [Select]
library simplelcl;

{$mode objfpc}{$H+}

{$DEFINE UseCThreads}

uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces,
jni;



function JNI_OnLoad(vm: PJavaVM; reserved: pointer): jint; {$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
begin
  result := JNI_VERSION_1_4;
end;

procedure JNI_OnUnload(vm: PJavaVM; reserved: pointer); {$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
begin
end;

exports
  JNI_OnLoad name 'JNI_OnLoad',
  JNI_OnUnload name 'JNI_OnUnload';

begin

end.

Even the stack dump is the same, except for the addresses inside the so

Thaddy

  • Hero Member
  • *****
  • Posts: 19978
  • Pointless static linking author
Re: Lazarus 1.6 broke my app
« Reply #7 on: September 11, 2016, 07:56:52 pm »
Since when doesn't sourcecode matter to find bugs nobody can replicate? and plz add initc to the uses clause. (First)
Any "programmer" that knows only one programming language is not a programmer

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Re: Lazarus 1.6 broke my app
« Reply #8 on: September 11, 2016, 08:20:19 pm »
That changes nothing

But we are getting somewhere. It is the interfaces unit.

This works

Code: [Select]
library simplelcl;
{$mode objfpc}{$H+}
uses initc;
begin
end.

This fails

Code: [Select]
library simplelcl;
{$mode objfpc}{$H+}
uses initc,interfaces;
begin
end.

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Re: Lazarus 1.6 broke my app
« Reply #9 on: September 11, 2016, 10:31:15 pm »
This also fails

Code: [Select]
library simplelcl;
uses cwstring;
begin
end.

And interfaces pulls in cwstring (interfaces -> InterfaceBase -> LazUTF8 ->  cwstring). (which also brings your initc)

And what can cwstring be reduced to?

Code: [Select]
library simplelcl;
uses dl;
begin
  dlopen('libicuuc.so',RTLD_LAZY);
end.

which also fails.

You were right, the code actually mattered

Perhaps Android cannot load a library during the initialization of another library


Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Lazarus 1.6 broke my app
« Reply #11 on: September 11, 2016, 11:32:32 pm »
Have you tried build and use trunk version of FPC? It seems that this bug is fixed in it : http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=34406

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Re: Lazarus 1.6 broke my app
« Reply #12 on: September 12, 2016, 11:35:32 am »
Have you tried build and use trunk version of FPC? It seems that this bug is fixed in it : http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=34406

No, I only checked if there was a relevant change in cwstring

You could have said something, before I wasted my weekend on this. 


I wonder, if that issue has a known fix, too: https://github.com/benibela/xidel/issues/2#issuecomment-230065399
« Last Edit: September 12, 2016, 11:38:52 am by BeniBela »

BeniBela

  • Hero Member
  • *****
  • Posts: 959
    • homepage
Re: Lazarus 1.6 broke my app
« Reply #13 on: September 12, 2016, 11:55:45 am »
Is there no option to just disable cwstring? I do not need it, I have my own unicode functions

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
Re: Lazarus 1.6 broke my app
« Reply #14 on: September 12, 2016, 01:37:58 pm »
BeniBela, the trunk version of FPC has a lot of bug fixes and improvements for Android.
See the Known issues here: http://wiki.freepascal.org/Android#Known_issues

 

TinyPortal © 2005-2018