• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[ROM][UNOFFICIAL][11.0.0][r43][I9100] LineageOS 18.1

Search This thread

jo-so

Member
Nov 23, 2020
15
7
Samsung Galaxy Note II
i9100
Screen is not broken ;) I'm hunting this bug for months. This is the first time someone reported this bug specifically. It is hard to grab a log because it happens after weeks or sometimes twice a day. It is kernel related and it is happening when the display is suspending or resuming. I added some debug lines in my kernel to troubleshoot when it happens and having useful log.
For as far I know there is a racing condition which is prevented using a spinlock. However it sometimes happens when the spinlock is hanging... When this happens, the lcd is not turned off because the display is suspending and hangs during this proces...
Other sympton is that some values while suspending are invalid. This causes a kernel crash due invalid pointers. Hard reboot happens. I have a dirty fix for these issues and testing it for 3 weeks now. It looks promising but the main cause of the corruption is still unknown. I will include these dirty fix in next build.
If you have a kernel to test, I'm happy to try it. Also with debug messages and anything more that might help you.
 

zpunout

Senior Member
Aug 26, 2015
139
23
Samsung Galaxy S5
Moto G5 Plus
It was funny to upgrade my friend's SII to your build of Android 11 and then hand the phone back to him for a surprise. I'm guessing Android 12 might be a bit of a stretch due to its OS size and getting it to work on an old kernel would be a hurdle and then all the other things.
 

js-xda

Senior Member
Aug 20, 2018
228
104
I am having a rather vague issue regarding sleep state and battery drain.

The following situation: I am using a SII currently pretty much only as a MP3 player (using Vinyl from F-Droid) incl. sleep timer. While this was working pretty OK for some time (early September til end September) with battery lasting several days (WiFi off, airplane mode on), I am having lately issues that the devices is often drained after one night and the sleep timer in Vinyl hasn't ended either. Especially due to the last, I assumed that something is plainly getting stuck as the music doesn't last until the battery dies but rather somewhere in the range of what I set the sleep timer. I tried already different performance profiles (saver vs. balanced) and with and without WiFi on (just out of curiosity).

I can"t say for sure whether it is related to the last build which I installed around September 20th but I can say for sure that it hasn't been present before.

Anyone else having issues that could be linked a same underlying issue? Or anyone an idea?
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
Hey @rINanDO

I'm a little bit in a pickle. I have to resort to using my i9100 as a daily driver once again (my n7100 needs some serious repair). I was using a 2019 version on my S2 for a while without problem, at some point, it somehow 'crashed' (bootloop both normal and twrp) so couldn't recover it easily.

Now, I'm back at it again, and hooked up a serial port to see what was really going on. So the bootloop was triggered by mmcblk0p10 (user data partition) causing fsck to take a bit, and then segfaulting. As I want to see if there's anything that needs recovering (foto's) I figured, lets start by upgrading the kernel + twrp.

edit: see the posts below for potentially more info; I didn't manage to fix the segfault; but, transfering the image to my desktop, and fsck/mounting it there, it works just fine, doesn't even think it's corrupted. So def. a bug in the f2fs driver of that kernel, as the disk-format is not the issue.
Code:
sudo fsck.f2fs datafs.img
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 26697728 (13036 MB)
Info: MKFS version
  ""
Info: FSCK version
  from "Linux version 3.0.101-lineage-gc2aaf5ba3b8-dirty ([email protected]) (gcc version 4.9.4 20151028 (prerelease) (Linaro GCC 4.9-2016.02) ) #0 SMP PREEMPT Mon Oct 18 11:31:46 UTC 2021"
    to "Linux version 5.14.0-1-amd64 ([email protected]) (gcc-10 (Debian 10.3.0-10) 10.3.0, GNU ld (GNU Binutils for Debian) 2.37) #1 SMP Debian 5.14.6-2 (2021-09-19)"
Info: superblock features = 0 : 
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 26697728 (13036 MB)
Info: CKPT version = d8f6
Info: checkpoint state = 3 :  orphan_inodes unmount

[FSCK] Unreachable nat entries                        [Ok..] [0x0]
[FSCK] SIT valid block bitmap checking                [Ok..]
[FSCK] Hard link checking for regular file            [Ok..] [0x0]
[FSCK] valid_block_count matching with CP             [Ok..] [0x11285a]
[FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x73f2]
[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x73f2]
[FSCK] valid_inode_count matched with CP              [Ok..] [0x70a9]
[FSCK] free segment_count matched with CP             [Ok..] [0x1076]
[FSCK] next block offset is free                      [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs                           [Ok..]

Done: 1.343300 secs
So at least i can recover my data (if there is any, I'd expect some fotos probably though)

I downloaded the latest image from this thread, and used heimdall to flash the KERNEL to the kernel partition, and the latest twrp (3.5.2) image and flashed that into the RECOVERY partition.

Sadly, it still fails to boot normally (init crashing, due to factoryfs being wrong, understandable) however, for some reason isorec is not kicking in to load twrp.

Here's a snippet of the bootlog
Code:
[    6.165529] c0 gpio_table = [2]
[    6.270613] c0 Warning: unable to open an initial console.
[    6.275105] c0 Freeing init memory: 2292K
[    6.440088] c0 max8922-charger max8922-charger: max8922_is_charging: charging state = 0x0
[    6.448103] c0 sec-battery sec-battery: sec_bat_check_temper: recovery count = 0
[    6.455948] c0 sec-battery sec-battery: sec_bat_check_temper: temp=280, adc=903
[    6.462904] c0 sec-battery sec-battery: Time past : 0 secs
[    6.468058] c0 max8922-charger max8922-charger: max8922_is_charging: charging state = 0x0
[    6.476098] c0 sec-battery sec-battery: soc(58), vfocv(3844), vcell(3843), temp(28), charging(1), health(1), chg_adc(1103)
[    6.861527] c0 init: init first stage started!
[    6.864948] c0 init: Unable to open /lib/modules, skipping module loading.
[    6.872697] c0 init: [libfs_mgr]ReadFstabFromDt(): failed to read fstab from dt
[    6.883243] c0 init: Using Android DT directory /proc/device-tree/firmware/android/
[    6.925093] c0 notify_change_of_tmu_state: uevent: 0, name = TMUSTATE=0
[    6.930458] c0 normal: free cpufreq_limit & interrupt enable.
[    6.971078] c0 init: DSU not detected, proceeding with normal boot
[    6.977853] c0 init: [libfs_mgr]superblock s_max_mnt_count:65535,/dev/block/platform/dw_mmc/by-name/FACTORYFS
[    6.992477] c0 EXT4-fs (mmcblk0p9): mounted filesystem without journal. Opts:
[    6.998696] c0 init: [libfs_mgr]__mount(source=/dev/block/platform/dw_mmc/by-name/FACTORYFS,target=/system,type=ext4)=0: Success
[    7.010736] c0 init: Switching root to '/system'
[    7.015683] c0 init: Unable to move mount at '/dev': No such file or directory
[    7.023282] c0 init: InitFatalReboot: signal 6
[    7.100323] c0 init: #00 pc 000cb988  /init (UnwindStackCurrent::UnwindFromContext(unsigned int, void*)+84)
[    7.108873] c0 init: #01 pc 0005e709  /init (android::init::InitFatalReboot(int)+132)
[    7.116596] c0 init: #02 pc 0005e9ed  /init (android::init::InstallRebootSignalHandlers()::$_22::__invoke(int)+20)
[    7.127104] c0 init: #03 pc 00122f78  /init (__restore)
[    7.132099] c0 init: #04 pc 0011fe40  /init (abort+168)
[    7.137322] c0 init: #05 pc 00060667  /init (android::init::InitAborter(char const*)+22)
[    7.145394] c0 init: #06 pc 0009a9a1  /init (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+48)
[    7.158327] c0 init: #07 pc 0009a3c9  /init (android::base::LogMessage::~LogMessage()+224)
[    7.166622] c0 init: #08 pc 0005f1dd  /init (android::init::SwitchRoot(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+612)
[    7.181709] c0 init: #09 pc 0005b925  /init (android::init::FirstStageMount::TrySwitchSystemAsRoot()+240)
[    7.191228] c0 init: #10 pc 0005ab1f  /init (android::init::FirstStageMount::MountPartitions()+134)
[    7.200251] c0 init: #11 pc 0005cbfb  /init (android::init::DoFirstStageMount()+54)
[    7.207873] c0 init: #12 pc 00058a77  /init (android::init::FirstStageMain(int, char**)+2594)
[    7.216424] c0 init: #13 pc 0011f2fb  /init (__real_libc_init(void*, void (*)(), int (*)(int, char**, char**), structors_array_t const*, bionic_tcb*)+402)
[    7.230275] c0 init: Reboot ending, jumping to kernel

After this we get a reboot into download mode; though reboot takes like 30 seconds (could be related to your mentioned bug, improper shutodwn)

So my recovery plan next is, to a) get a kernel built with a busybox shell active; so I can explorer and manually fix stuff from a linux terminal and b) convert the update image from your zip into an ext4.img so I can use heimdall to flash it.

So on both accounts a few questions.

How can I rebuild the kernel without having to do the whole lineage build? I'm very familiar with kernel builds, so that's not an issue, but from a 'traditional' kernel build I end up with a zImage. Afaik, I need to atleast use mkbootimg to convert it into an android boot image, so what else is in your kernel image so i have a drop-in replacement?

Secondly, do you happen to know an easy trick to convert the update image? I'm gonna probably just chroot into the twrp image and fake-install the update file into a loop device, that should work well enough.

Thirdly, do you know if the latest twrp even works on our device? I downloaded it and it's 8708998 bytes, looking at the 'download-pit' from heimdall, the recovery partition is 16384 blocks, which would be 8388608 bytes so twrp doesn't even fit, which could be an explanation of isorec failing.
Code:
twrp-3.5.2_9-0-i9100.img    8.3M    2021-04-06 05:59:38 UTC
twrp-3.5.1_9-0-i9100.img    8.3M    2021-03-15 00:53:27 UTC
twrp-3.5.0_9-0-i9100.img    7M    2020-12-29 01:10:47 UTC
so I'll try downgrading first :)

edit: So with twrp 3.5.0 recovery works again; so indeed, 8.3M is obviously to big. I'll open a bugreport there and see how easy it is to add a compile-time check to produce a warning on their pipeline; they shouldn't be publishing files that won't fit on 'stock' partitions'

It bootloops again however, since the newer kernel won't allow me to recover either (kernel crashing on the image) the only options I have left; create a kernel, dump the partition to an SD card and fix it on a normal linux system; and/or flash a f2fs image into the user partition so the kernel won't crash anymore :(

edit2: Bah, this sucks; For whatever reason, the DATAFS partition can't be heimdalled, `
ERROR: Failed to confirm end of file transfer sequence!`

I'll have to start to compile your kernel and add a shell (should be trivial really) so i can run mkfs on the device instead :(

I think TWRP trying to fsck and crashing is really bad; we can't fix the kernel (too old, should upgrade to mainline really) but can fix TWRP imo to not crash. There should be just a button 'fsck filesystem's instead ... it's a recovery, the whole point is being able to recover no? :)
 
Last edited:

Badger50

Simple Forum Moderator
Staff member
Feb 27, 2011
13,349
18,119
61
Kansas City
Samsung Galaxy Note 10.1
Greetings to all, and I certainly hope everyone is doing well. I dropped in for a little thread cleaning since things were getting a bit off topic. As a friendly reminder, if you are having difficulties with a particular rom or kernel, please report them in a respectful, and informative way, without impugning the integrity of this, or any developer on XDA, with things you may have experienced in the past.

Furthermore, we would be most appreciative if members would just report potential problems, rather than replying in a confrontational manner, which usually leads to piling on, and the inevitable flame war. So let us please keep things civil and respectful going forward shall we. I thank you all for your cooperation, and have a pleasant day.

-Best regards: Badger50 FSM
 
  • Like
Reactions: 2faraway2

rINanDO

Senior Member
Dec 17, 2009
668
4,491
After some days of usage, I can confirm that this helps. I've disabled the Ambient display and saw no crashes any more.
Nice! My dirty fix and logging for troubleshooting this issue still leads in rare crashes. The message to display driver is corrupt, causing hangs or null references and reboots. But if my dirty fix is triggered, it crashes the next driver... I saw wifi and touchscreen crash. It always happens (when it happens) when pressing power button to set the phone to sleep. At least after few weeks I never had a white corrupted 'broken' display screen. :)
I will try this workaround and investigate how this actually prevents these crashes.
This helps, thanks guys!
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
@rINanDO your current HEAD of your kernel repo is not the one in use right? As there are some things in that don't seem to work (causing init exit errors)

e.g. `busybox cd /` doesn't make sense, `cd` is a shell built in, so doesn't need busybox prefixed. Also `exec >>boot.txt` I don't even know what's that supposed to do, as `exec` normally swappes out the current process (and pid) with the new process, but no process is listed there ...

edit: must be fine though; because that part of the script was not touched for almost 10 years, and now with everything fixed it's working ...

I managed to compile and run a shell however :) I did use alpine's latest static busybox, because the 2010 android one lacks some stuff. I'll actually be cleaning the init up a bit, and want to enable some more features (you can call it isorec2 :p) as the latest twrp's don't work anymore due to size, so want to change that too, to either squashfs and/or to xz.

Anyway, I've run out of all options on trying to fix my lost partition, dd-ing it now to a microSD card to see if I can recover some files (you'll see it'll turn out to be nothing of value there :p) and then mkfs.ext4 it. I think f2fs is a great FS and is super stable, but not on the 3.0 kernel series ...

edit: So i finally have everything working again :) after re-installing the ROM, i got the kernel that's part of the build back, and with everything wiped, it should all be perfect.

However, for whatever reason, I keep having the serial console enabled (with a pop up from android) and it's all really slow (probably caused by the console).

I do see
Code:
[    0.000000] c0 Linux version 3.0.101-lineage-g24b4dc225265 ([email protected]) (gcc version 4.9.x 20150123 (prerelease)
i9100:/ # cat /proc/cmdline                                                                                               
console=ttySAC2,115200 consoleblank=0 androidboot.hardware=smdk4210 loglevel=3 console=ram androidboot.serialno=0009e7990bcc4f sec_debug.enable=0 sec_debug.enable_user=0 c1_watchdog.sec_pet=5 [email protected] s3cfb.bootloaderfb=0x5ec00000 ld9040.get_lcdtype=0x2 consoleblank=0 lpj=3981312 vmalloc=144m
hah, actually console is set twice, once as per bootloader, and once from somewhere else. So is this something that needs to be fixed? I do notice quote some choppiness and slowness ... probably turning off animations might help significantly ...

btw, doing a strings om PARAM (/dev/block/mmcblk0p4) I do see something resembling the SBL environment ...
Code:
I9000XXIL
loglevel=3 console=ram
/ttySAC2,115200
(I did set the loglevel lower) but console, as you can see is set to ram ... I'll tripple check to make sure, but i'm very certain i did set things up properly, maybe I should put some garbage in the CMDLINE first to ensure it's properly wiped/empty and that I see is just some left-over stuff.

Here's the env;
Code:
SBL> printenv
PARAM Rev 1.3
SERIAL_SPEED : 7
LOAD_RAMDISK : 0
BOOT_DELAY : 0
LCD_LEVEL : 50
SWITCH_SEL : 1
PHONE_DEBUG_ON : 0
LCD_DIM_LEVEL : 1
LCD_DIM_TIME : 6
MELODY_MODE : 1
REBOOT_MODE : 0
NATION_SEL : 0
LANGUAGE_SEL : 0
SET_DEFAULT_PARAM : 0
FLASH_LOCK_STATUS : 0
PARAM_INT_14 : 0
VERSION : I9000XXIL
CMDLINE : loglevel=3 console=ram
DELTA_LOCATION : /mnt/rsv
PARAM_STR_3 :
PARAM_STR_4 :
SBL> setenv BOOT_DELAY 1
So is there anywhere in the ROM that sets the console to something else? I cannot find it in your kernel img and I doubt its in the boot.cpio ...
 
Last edited:
  • Like
Reactions: SethGeckoXDA

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
Also, I installed micro-g via fdroid (microg repo) and signature spoofing enablement as per OP fails?

255|i9100:/ $ pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE

Exception occurred while executing 'grant':
java.lang.IllegalArgumentException: Unknown permission: android.permission.FAKE_PACKAGE_SIGNATURE
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1445)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1404)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2287)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:249)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21696)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4603)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4351)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
255|i9100:/ $ pm grant com.google.android.gms android.permission.FAKE_PACKAGE_SIGNATURE

Exception occurred while executing 'grant':
java.lang.IllegalArgumentException: Unknown permission: android.permission.FAKE_PACKAGE_SIGNATURE
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1445)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1404)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2287)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:249)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21696)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4603)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4351)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
regardless of reboot, root etc.

edit: Scrap the above; I think this is a copy/paste thing on the start-post; I see that [1/2] was only merged yesterday :) https://github.com/rINanDO/android_frameworks_base/commit/aaa5bcf5ed39f585000572640de65c965cc7a8aa so most definitely not part of the 2020 release from the first-post.

Gah, the opening post isn't updated with the latest links :) https://forum.xda-developers.com/t/...43-i9100-lineageos-18-1.4199759/post-85625999 is the latest zip post :)
 
Last edited:

mirhl

Senior Member
Oct 15, 2012
3,089
1,159
I am having a rather vague issue regarding sleep state and battery drain.

I can"t say for sure whether it is related to the last build which I installed around September 20th but I can say for sure that it hasn't been present before.

Anyone else having issues that could be linked a same underlying issue? Or anyone an idea?
As with all battery problems, install BBS and check from there?

I'm a little bit in a pickle. I have to resort to using my i9100 as a daily driver once again (my n7100 needs some serious repair). I was using a 2019 version on my S2 for a while without problem, at some point, it somehow 'crashed' (bootloop both normal and twrp) so couldn't recover it easily.

Now, I'm back at it again, and hooked up a serial port to see what was really going on. So the bootloop was triggered by mmcblk0p10 (user data partition) causing fsck to take a bit, and then segfaulting. As I want to see if there's anything that needs recovering (foto's) I figured, lets start by upgrading the kernel + twrp.

edit: see the posts below for potentially more info; I didn't manage to fix the segfault; but, transfering the image to my desktop, and fsck/mounting it there, it works just fine, doesn't even think it's corrupted. So def. a bug in the f2fs driver of that kernel, as the disk-format is not the issue.


Sadly, it still fails to boot normally (init crashing, due to factoryfs being wrong, understandable) however, for some reason isorec is not kicking in to load twrp.
Sigh.. That sounds like the bug I have been trying to report for almost 10 years.
The kernel explodes whenever it doesn't like mounting a partition.
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
As with all battery problems, install BBS and check from there?


Sigh.. That sounds like the bug I have been trying to report for almost 10 years.
The kernel explodes whenever it doesn't like mounting a partition.
I'll also look into the battery stuff; I notice that the battery drain is quite high. One thing I noticed, it might be related to the relative high frequency during 'sleep'. It's currently running at 100Mhz at its slowest, while I'm quite certain that my note2 runs at something much slower. If we can get it to 10 - 25MHz; that's another win there (if we can also scale the voltage down a bit; that's even a bigger win.


As for the bug; yeah the kernel should not explode on mount failures. I think this is some really weird kernel behavior; that's specific to this android build.
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
I'll also look into the battery stuff; I notice that the battery drain is quite high. One thing I noticed, it might be related to the relative high frequency during 'sleep'. It's currently running at 100Mhz at its slowest, while I'm quite certain that my note2 runs at something much slower. If we can get it to 10 - 25MHz; that's another win there (if we can also scale the voltage down a bit; that's even a bigger win.


As for the bug; yeah the kernel should not explode on mount failures. I think this is some really weird kernel behavior; that's specific to this android build.

I would expect that the best work-around is to ensure that twrp/recovery don't auto-mount the partitions, the user can mount them via a click on the UI; update scripts should do this already anyway, and it ensures we still have a recovery shell we can access to manually fix things. I'm not sure however who makes this policy 'twrp shall automount everything from fstab'. I believe we do have a specific recovery fstab already anyway, and so having the 'no-auto' flag there is an easy work-around.
 

ol1ver

Senior Member
Jun 25, 2011
54
16
gitlab.com
I haven't run logcat yet, but I tried to save an attachment from k9, which kept crashing (creating a 0 byte file, so storage access was working) on internal/external storage; Using the 'SimpleMail' app something similar happened.

Also I noticed 'sometimes' the phone just hard-locks, but always 'while' doing something, and you have to force-reboot.

The white snow screen I've also seen twice now. Interestingly enough; the OS seems to be still functional. I could push the menu/back button and got haptic feedback. I didn't have time to poke-around to see If I could get any useful logs however ...
 

Top Liked Posts