Invalid ELF file

0

if I run my application on Android I always get this error and the application crashes immediately:

03-25 14:29:44.011  1833  7290 I ActivityManager: START u0 {flg=0x10000000 cmp=cz.jech.muzika/.Muzika} from uid 2000
03-25 14:29:44.093  1833  1998 I ActivityManager: Start proc 17399:cz.jech.muzika/u0a464 for activity cz.jech.muzika/.Muzika
03-25 14:29:44.098 17399 17399 E cz.jech.muzika: Not starting debugger since process cannot load the jdwp agent.
03-25 14:29:44.193  1833  2400 I WindowManager:   SURFACE show Surface(name=Splash Screen cz.jech.muzika)/@0xbe60fc9: Splash Screen cz.jech.muzika
03-25 14:29:44.298 14007 17395 D InstalledAppProviderSer: insertAppIntoDb cz.jech.muzika
03-25 14:29:44.302 17399 17414 E AndroidRuntime: Process: cz.jech.muzika, PID: 17399
03-25 14:29:44.302 17399 17414 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: invalid ELF file "/data/app/cz.jech.muzika-iMRmvRSnmwPpVhRlaZJJwg==/lib/arm64/libswscale.so" load segment[4]: p_offset (0x41000) + p_filesz (0x0) ( = 0x41000) past end of file (0x40910)
03-25 14:29:44.306  1833  9531 W ActivityManager:   Force finishing activity cz.jech.muzika/.Muzika
03-25 14:29:44.327  1833  4076 I ActivityManager: Process cz.jech.muzika (pid 17399) has died: vis  TOP
03-25 14:29:44.336  1140  1237 W SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{485887d token=Token{1c63ed4 ActivityRecord{a8f0c27 u0 cz.jech.muzika/.Muzika t4527}}}#0

What could be the root cause of the error? The ffmpeg libraries I use are from here. What does the error "invalid ELF file" mean?

android
shared-libraries
asked on Stack Overflow Mar 25, 2020 by JeCh

1 Answer

0

The file /lib/arm64/libswscale.so is corrupt. In particular, it has a PT_LOAD segment with offset that is past the end of the file (file size is 0x40910) and has 0 length.

One way the file may have become corrupt is if you did an FTP transfer and forgot to set binary mode. (Of course there are numerous other ways, such as decompressing the archive and running out of disk space.)

Your best bet is to re-extract the archive, check the length and md5sum of the file, and use scp or something other than ASCII FTP transfer, then verify that the md5sum is still the same on the target device.

answered on Stack Overflow Mar 26, 2020 by Employed Russian

User contributions licensed under CC BY-SA 3.0