yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] mionica:
Can you confirm you weren't having these issues with 2.3?

Very good question; I have NO idea; actually, could you try moving them off the sdcard and see if you're still getting issues?
[Sony Cross-Device General] infinitylook:
Will try again. Can I flash 2.3 on top of 2.4 or i need to use your uninstaller?
[Sony Cross-Device General] mionica:
Ummm, yes you can - but you'll have to mount /system in twrp, then use the advanced/file manager to remove the /system/etc/init.d/98_revert_flimit_after_boot file

Remove it before flashing the .zip; you don't have to do that before, but after you flash 2.3 you'l have both a 98_revert_flimit_after_boot and a 99_revert_flimit_after_boot, which can be confusing
[Sony Cross-Device General] Superblond:
Xposed stop / uninstall when in boot loop

[MENTION=6351145]ondrejvaroscak[/MENTION]: Worked! Thanks a lot for the fast and competent help!

I dindn't realized that the anwser to my question and therefore the solution for my problem, is the already here, on page 1, the "xposed-uninstall.zip".

Thanks again & Regards

SB
[Sony Cross-Device General] Shujath:
Thanks for the useful info
[Sony Cross-Device General] infinitylook:
2.3 still does it

[MENTION=1103233]mionica[/MENTION] Still it freezes and restarts for 2.3. I would try doing a clean install. If still unsuccessful would stay on without xposed for a while.
[Sony Cross-Device General] ondrejvaroscak:
Yet another interesting fact..

I have found out that on my system, with 331 (so two packages above my safe limit of 329) packages installed, I got bootloop not with Xposed framework, but bootloop is caused by Xposed apk (aka Framewor installer app.).

When I remove the folder of framework installer app from /data/app/ bootloop has disappeared.

So I have installed the Framework Installer app again, downloaded and activated the 20MP module, rebooted to recovery and removed Framework app again. Unfortunatelly it didnt help either and still got bootloop. Removing also the module folder from /data/app was succesfull and rebooted without any problems.

From my point of view, the framework itself is harmless until it processes either module or its own Framewor installer APK.
[Sony Cross-Device General] jasieq:
A funny thing I have just noticed - although phone itself stops responding after some time of using, I can still see live wallpaper moving in the background (when the phone freezes on the homescreen). Apparently certain processes/services stay active even when phone stops responding.

BTW. Now I've been using v2.4 with flimit.prop set to 4096 4096 after reboot and freezes seem to be less frequent.
[Sony Cross-Device General] ondrejvaroscak:
Seems not the phone, but certain apps stopped responding (home.apk form Sony launcher or other launcher app.).
[Sony Cross-Device General] ondrejvaroscak:
Uninstall framework ZIP

Funny, I have flashed [MENTION=1103233]mionica[/MENTION] uninstall zip that should remove the framework, however I still get:

busybox lsof|busybox grep xposed|busybox awk '{print $1}'|busybox sort -gu|busybox wc -l

62

busybox lsof|busybox grep xposed|busybox awk '{print $1}'|busybox sort -g|busybox wc -l

2204

?

Looks like zip removed only XposedFramework Bridge, not the app.process component ..
[Sony Cross-Device General] jasieq:
Home.apk itself doesn't make entire phone stop responding for touch and pressing physical buttons. Freezes come from Xposed or flimit mod.
[Sony Cross-Device General] ondrejvaroscak:
Ok, didnt get that touch also stopped working... As to where the freeze comes, it comes from both. I am sure it comes from Xposed, which flimit made working to the point where it manages to freeze the system. Without flimit xposed fails in initialization. It seems that initially it exhausted resources allowed to use, so we raised the limits, however the memory hog continues until it freezes totally. This is supported by the fact, that people with heavy mods or lot of installed apps are likely to get reboots or freezes, while people with vanilal stock or just few apps are good to go.
[Sony Cross-Device General] mionica:
Wrong :D

The trick is that a process is created by busybox grep xposed - which will match a grep for "xposed" :D. Try the following:

busybox lsof|busybox grep xposed|[b][color=green]busybox grep -v grep|[/color][/b]busybox awk '{print $1}'|busybox sort -gu|busybox wc -l
[Sony Cross-Device General] ondrejvaroscak:
Ech, me stupid :)
[Sony Cross-Device General] defim:
This fixed the problem with bootloops without cleaned dalvic cache, but since installation the device random crashes, today while Play Store updated an app. Before this i never noticed spontan boots

Btw

busybox grep xposed|busybox grep -v grep

could also be

busybox grep [x]posed
[Sony Cross-Device General] ondrejvaroscak:
Well, thats the thing we are already aware of. The mystery lies in the root cause. It seems that xposed tends to consume memory until the point it just crashes..
[Sony Cross-Device General] ondrejvaroscak:
HISTORY

Latest version can be found here http://xdaforums.com/showpost.php?p=60298690&postcount=123 and of course in OP. This post is for historical reference only.
[Sony Cross-Device General] ondrejvaroscak:
Man, I wish more people here as dedicated and PROfessional as you (including myself). Many thanks...
[Sony Cross-Device General] ondrejvaroscak:
I flashed it over version 2.4 ---> led to bootloop. Needed to remove /etc/init.d manually a flash it again..
[Sony Cross-Device General] jbbandos:
Without modules it doesn't bootloop. I'll try your suggestion, 2.1, reboot, xposed.
[Sony Cross-Device General] mionica:
That's funny, it didn't for me (doah - I don't upload anything until I'm happy it does what I mean it to). Pulling link for now.
[Sony Cross-Device General] _mysiak_:
Flashed 2.5 over 2.4, working fine, including logs.
[Sony Cross-Device General] ondrejvaroscak:
Ok I will repeat the process to make sure I didnt make anything stupid..

Ok, removed 2.5 by rm-rf /etc/init.d and /system/xbin/flimit, reboot,

flashed 2.4, reboot OK

reboot recovery, flashed 2.5 reboot, booting took significantly longer, and navbar failed to load (simply did not appear), reboot again

boot fast and everything ok ... I am on pretty vanilla stock, just updated apps and have xposed + 1 module (20MP Superior Auto).

Logs:

cat flimit.log

01_flimit starting...

=====================

[v]

[d] during.boot limits from .prop file: soft=[] hard=[]

[d] during.boot limits after normalization: [0 0]

[d] during.boot limits after sanity check: [0 0]

[d] during.boot limits after applying defaults: [2047 4095]

[d] during.boot limits after making parity fixup: [2047 4095]

during boot, using softlimit 2047, hardlimit 4095

byeSElinux is already loaded

waiting for the zygote process to appear...

found zygote process after 1350ms at PID 699

initial zygote flimits: [1024 4096]

new zygote flimits: [2047 4095]

applying during.boot flimits - done

[v]

98_revert_flimit_after_boot starting...

=======================================

[v]

[d] after.boot limits from .prop file: soft=[] hard=[]

[d] other .prop settings: keep.boot.limit=[]

[d] other .prop settings: save.boot.logcat=[]

[d] other .prop settings: save.boot.dmesg=[]

[d] after.boot limits after normalization: [0 0]

[d] other settings after normalization: keep.boot.limit=[false]

[d] other settings after normalization: save.boot.logcat=[false]

[d] other settings after normalization: save.boot.dmesg=[false]

[d] after.boot limits after sanity check: [0 0]

[d] after.boot limits after applying defaults: [1024 4096]

during boot, used softlimit 2047, hardlimit 4095

after boot, using softlimit 1024, hardlimit 4096

waiting for boot to complete...

boot completed after 22300ms

byeSElinux is already loaded

applying after.boot flimits - iteration #1

47 processes to check

target PIDs: [ 699 1052 1056 1053 1054 1763 2858 2868 2901 2943 2981 3039 30

62 3081 3100 3144 3206 3282 3318 3330 3353 3362 3383 3405 3462 3480 3521 3534 36

41 3736 3807 3857 3870 3943 3962 4020 4200 4445 4472 4517 4557 4598 4650 4693 47

26 4749 4791]

43 processes were updated

updated PIDs: [ 699 1763 2858 2868 2901 2943 2981 3039 3062 3081 3100 3144 3

206 3282 3318 3330 3353 3362 3383 3405 3462 3480 3521 3534 3641 3736 3807 3857 3

870 3943 3962 4020 4200 4445 4472 4517 4557 4598 4650 4693 4726 4749 4791]

applying after.boot flimits - iteration #2

54 processes to check

target PIDs: [ 699 1052 1056 1053 1054 1763 2858 2868 2943 3039 3062 3081 31

00 3144 3206 3282 3318 3330 3353 3362 3383 3405 3462 3480 3521 3534 3641 3736 38

07 3857 3870 3943 3962 4020 4200 4445 4472 4517 4557 4598 4650 4693 4726 4749 47

91 4999 5074 5116 5124 5164 5320 5360 5385 5407]

5 processes were updated

updated PIDs: [ 4999 5074 5116 5124 5164]

applying after.boot flimits - iteration #3

1 processes to check

target PIDs: [ 5896]

0 processes were updated

updated PIDs: []

applying after.boot flimits - done
[Sony Cross-Device General] mionica:
Wait 5mins for 2.5a :)
[Sony Cross-Device General] mionica:
See if this is any better. I did some minor cleanups, and made sure we don't look at the same process twice (the process list from iteration #2 is pruned with the process list from iteration #1; #3 with everything from #1 and #2)
[Sony Cross-Device General] SkyBeat:
ok, now i have a bigger problem since i use xposed-sonyfix-v2.5.zip.

what i have do:

1. wipe dalvik and cache and data

2. fresh install of a pre rooted flashable.zip (see post #336 from me) including xposed-arm

3. wipe dalvik and cache after installation was finished

4. flash xposed-sonyfix-v2.5.zip.

5. reboot into system

6. install xposed apk and all app updates from playstore

7. install gravity and GEM modules for xposed

8. reboot

now i have also bootloops but the biggest problem is that i can't go into TWRP anymore. So i cant restore to my backup!

What can i do now?

Please help.

Thanks, Nico
[Sony Cross-Device General] ondrejvaroscak:
Depends where you have the backups located. Also see in red above, you didnt wipe system before flashing ROM?
[Sony Cross-Device General] ondrejvaroscak:
Works like a charm both clean installed or flashed over both 2.4 or 2.5, Thanks
[Sony Cross-Device General] mionica:
The first thing I'd try is, removing the sdcard and attempting to boot that way. Full boot, not recovery.

---------- Post added at 10:04 PM ---------- Previous post was at 10:00 PM ----------

Coud you try with and without logging enabled?
[Sony Cross-Device General] hzmenxd:
Some bootlops today using 2.3. I didnt had any in 2.1
[Sony Cross-Device General] ondrejvaroscak:
Done, nice logs it produces :) Everything ok..
[Sony Cross-Device General] mionica:
It seems the better my code is at what I mean it to do, the least stable the system it runs on :)

Here's the thing; v2(.0) was the last version that restored the flimit of the zygote processes correctly; v2.1 up to v2.3 missed some processes by not scanning the entire process tree - v2.0 worked because it didn't care about zygote, it looked at all the processes, and only reverted the flimits of those that needed them reverted.

v2.4 is the first version that scans the entire process tree (thus get all processes to the original limits), and v2.5a is the first one that does so cleanly (a process is only scanned once).

However. 2.5a has a very nice feature: it can dump the dmesg, plus the logcat (at 4 points in time :D). This should make it a lot easier for the Xposed developers to figure out wtf is wrong. And there's a chance some of us could figure things ourselves, too.
[Sony Cross-Device General] hzmenxd:
Thanks for your work, we all appreciate dude, my bootloops happened while starting spotify or making a call (if that help you). I can take screemshots of the modules I'm using, and again, thanks for your developement :D
[Sony Cross-Device General] ondrejvaroscak:
Well the reason behind is that your code allows Xposed to run, thus allowing it to f*ck up the system, because thats what Xposed currently does :)
[Sony Cross-Device General] SkyBeat:
ok i have PRFCreateor but how i can flash the system after i have createt a flashable zip? I have no recovery to go to and flash it...
[Sony Cross-Device General] mionica:
That's why I put all that effort into boot logging; I really, really hope some people will just knock on Xposed's door with the logs from my thing in the briefcase...

Now, that aside. Can you do me a favor and link back to, and only to, post #123? Then keep it that way? :D

I see that as my release page, that is, if I don't link a release there, then there's a chance I don't want it to go public yet (that is, beyond the people reading the tail of this thread) :D

And since 2.5a is probably good enough, I edited #123 to list 2.4, 2.5 and 2.5a; btw, the list items are links to the release post. It's probably the best way to document what's what and where.
[Sony Cross-Device General] ondrejvaroscak:
OKi, for sake of clarity I will also remove files from OP and point just to #123.
[Sony Cross-Device General] Masoud.Ser:
i flash v2.5 and worked good

A question

with Come every new version Whether Should I flashed new version? Like version 2.5a after 2.4 and Soon version 2.6 /2.6b/2.7/2.8and....:D

Please answer, thank you;)
[Sony Cross-Device General] Pandemic:
Ofcourse ;)
[Sony Cross-Device General] ondrejvaroscak:
Well, as with any development, as people are getting more and more into understand the root cause of problem, they come with more and more precise solutions.

Above to that, also the code is cleaner. The development change between 2.3 and 2.5a is quite big with respect to sanity.

At the other hand, you don't have to use new version as long as older one works good for you. Unless of course as major breakthrough or serious flaw is being addressed...
[Sony Cross-Device General] ondrejvaroscak:
setting limits denied reported in logcat

in logcat3.log line ~3390:

W/flimit ( 4709): type=1400 audit(0.0:76): avc: denied { setrlimit } for scontext=u:r:init:s0 tcontext=u:r:zygote:s0 tclass=process op_res=0 ppid=1249 pcomm="98_revert_flimi" tgid=1249 tgcomm="98_revert_flimi"
W/flimit ( 4718): type=1400 audit(0.0:77): avc: denied { setrlimit } for scontext=u:r:init:s0 tcontext=u:r:system_server:s0 tclass=process op_res=0 ppid=1249 pcomm="98_revert_flimi" tgid=1249 tgcomm="98_revert_flimi"
W/flimit ( 4721): type=1400 audit(0.0:78): avc: denied { setrlimit } for scontext=u:r:init:s0 tcontext=u:r:platform_app:s0 tclass=process op_res=0 ppid=1249 pcomm="98_revert_flimi" tgid=1249 tgcomm="98_revert_flimi"
W/flimit ( 4727): type=1400 audit(0.0:79): avc: denied { setrlimit } for scontext=u:r:init:s0 tcontext=u:r:untrusted_app:s0 tclass=process op_res=0 ppid=1249 pcomm="98_revert_flimi" tgid=1249 tgcomm="98_revert_flimi"
W/flimit ( 4730): type=1400 audit(0.0:80): avc: denied { setrlimit } for scontext=u:r:init:s0 tcontext=u:r:system_app:s0 tclass=process op_res=0 ppid=1249 pcomm="98_revert_flimi" tgid=1249 tgcomm="98_revert_flimi"

I would understand that flimit was denied to set limit (setrlimit function)..
[Sony Cross-Device General] ondrejvaroscak:
Which version you have? I have 2.8.12 and the line was there. Anyway, if it it not present, just add it. Doesnt matter where..

My XZDR.prop lines for Xposed:

dr.initd.active=true
dr.keep.byeselinux=true
[Sony Cross-Device General] 3Shirts:
Thanks, it seems to have worked. I say seems as all the tests ran ok (soft limit is 4096) but I haven't installed enough apps to test it yet.

I would just add that I tried this while in recovery but couldn't su from there so I suggest doing it booted. It obviously worked running the script at boot though as the tests showed success when I got into adb on the booted phone and could run su.
[Sony Cross-Device General] ondrejvaroscak:
when you adb into recovery you are automatically root, hence no need to su
[Sony Cross-Device General] 3Shirts:
Oh yeah :silly:

All good then. Thanks for your work on this, you rock!
[Sony Cross-Device General] kostas-k:
Excellent, works on my Z1C D5503
[Sony Cross-Device General] adolfovm:
Finally!!! It worked like a charm for me! No more messing around with ART cache every boot.

I did it all through a terminal window already booted and most of it worked directly through it. The only thing I couldn't do was change to 777 the permissions of "01_flimit". I got an error saying system was read only. So I went ahead and did the file permission change through the terminal on TRWP recovery, there it took it at first attempt.

After this the reboot worked perfectly.

Thank you for this fix!!!
[Sony Cross-Device General] nurps:
Just ran into my first troubles with this script. Both my Opera browsers wont run with the script active. If I clear their data they start, but of course without my bookmarks and feeds. After a reboot I have to delete their data again.

So I thought it would be a Xmodule, but deactivating all didn't help. So I deactivated the script in the XZDR.prop, went through the whole cache clearing process and they do work if the the script isn't loaded.
[Sony Cross-Device General] mionica:
Just as a small contribution - my version of the shell script (loads byeselinux on demand, and unloads it if it had to load it - gets rid of messing with XZDR.prop)

#!/system/bin/sh
#
#zygote filelimits customization
#Created by Ondrej Varoscak (ondrejvaroscak @ xda-developers)
#Copyleft
#
#flimit executable source code from http://lzone.de/cheat-sheet/ulimit
#no copyright statement - reused and redistributed in good faith
#
#modified by mionica to load/remove byeselinux on-demand

function flimit_patch {
ZPID=$(pgrep zygote)
while test ! -n "$ZPID"
do
sleep 0.1
ZPID=$(pgrep zygote)
done
/system/xbin/flimit $ZPID $1 $2 | sed 's,^, ,'
}

# load byeSElinux, if it wasn't already loaded
BYESELINUX=0
echo -n "Checking if byeSElinux is loaded... "
if lsmod | grep byeselinux > /dev/null
then
BYESELINUX=1
echo "yes"
else
echo "no"
echo -n "Loading byeSElinux... "
if test ! -e /system/lib/modules/byeselinux.ko
then
echo "NOT FOUND!"
return -1
fi
insmod /system/lib/modules/byeselinux.ko
if lsmod | grep byeselinux > /dev/null
then
echo "ok"
else
echo "FAILED"
return -2
fi
fi

# do the patch
echo "Patching file limits... "
flimit_patch 2048 4096

# unload byeSElinux if we loaded it
#(leave it alone if it was already loaded, i.e. if XZDR wants it kept)
if test "$BYESELINUX" = "0"
then
echo -n "Removing byeSElinux... "
rmmod byeselinux \
&& echo "ok" \
|| echo "FAILED"
fi

return 0
[Sony Cross-Device General] ondrejvaroscak:
Cool development, however i think that byeselinux needs to be loaded anyway for Xposed to work...
[Sony Cross-Device General] mionica:
No need for that. Just duplicate the script somewhere, and set it to re-set the limits to the defaults (1024 4096). Then you can just run that when you need to.

Or, you could mod the init script to set the limits to 2048 4096 instead of 4096 4096, or, more conservatively, 1536 4096. There's a good chance that'll make the problem go away; I have the 2048 4096 settings, and no problems at all with Opera (regular; I don't use Mini).

To see how to enable/disable byeSElinux at runtime, open a terminal, get superuser, then use insmod/rmmod per my previous post.
[Sony Cross-Device General] ondrejvaroscak:
Forgot to put into instructions to remount system rw... corrected
[Sony Cross-Device General] nurps:
I'll do this in the 01_flimit?
[Sony Cross-Device General] mionica:
Yup. Scripts are the things that begin with #! <something> ;)
[Sony Cross-Device General] ondrejvaroscak:
Ok, I can confirm the problem with both Opera and Opera Mini being killed. I will try to investigate more. So far found out it has nothing to do with byeselinux.... thanks for testing

Can confirm that [MENTION=1103233]mionica[/MENTION] was right with more conservative softlimits on open files. Will modify my script accordingly.. 2048 did the trick.
[Sony Cross-Device General] nurps:
Wow, that was fast and easy. Opera Mini and regular working with 2048, and of course Xposed still runs too. Thanks.
[Sony Cross-Device General] McBane87:
Hey Guys,

Just create two flashable ZIP-Files.

Hopefully it will be easier for you this way.

XZDR-Init.d-Enabler:

This Script will search for your XZDR.prop-File in 3 ways (one other another):

1. Try to find File in "/storage/sdcard1/XZDualRecovery" (CWM)

2. Try to find FIle in "/external_sd/XZDualRecovery" (TWRP)

3. Try to find File via [find / -name XZDR.prop 2>/dev/null] , but will only use finding if there is only one XZDR.prop-FIle in System found.

After that it will edit your XZDR.prop and adds the two props [MENTION=6351145]ondrejvaroscak[/MENTION] mentioned:

sed -i '/dr.initd.active/d' $XZDR_File
echo "dr.initd.active=true" >> $XZDR_File
sed -i '/dr.keep.byeselinux/d' $XZDR_File
echo "dr.keep.byeselinux=true" >> $XZDR_File

Finally it will create init.d folder in: /system/etc/init.d

FLimit Flashable:

This will copy the binary "flimit" to "/system/bin" (did it it little bit different here) and "01_flimit" to "/system/etc/init.d/"

ondrejvaroscak just released v1.1, so files are:

v1.0 = flimit_flashable_4096.zip

v1.1 = flimit_flashable_2048.zip

Instruction:

Just flash both Zip-Files via CWM or TWRP

1. XZDR_Inid-Enabler

2. flimit_flashable_2048 or flimit_flashable_4096

3. Reboot (no wipes necessary)

If the first Script isn't working, then you can edit "/sdcard1/XZDualRecovery/XZDR.prop" on your own.

Just modify/add those lines:

dr.initd.active=true
dr.keep.byeselinux=true

If you did that you only need to flash "flimit_flashable_XXXX"

Newest Flashable

[MENTION=1103233]mionica[/MENTION] created a more experienced version of the workaround as flashable,

which will revert all changes after boot is finished. Because we only need this workaround for boot.

After that we should use android as Google/Sony intended ;)

http://xdaforums.com/showpost.php?p=60298690&postcount=123

Undo Workaround:

As requested here are two options for undo Workaround.

Edit: Will now undo mionica Workaround, too.

Undo Workaround, but keep init.d-Support of XZDR:

flimit_undo_flashable.zip

Undo Workaround completly:

flimit_undo_full_flashable.zip

-
[Sony Cross-Device General] Pandemic:
[MENTION=4712883]McBane87[/MENTION]

we only need to flash those zips and everything works ?

please explain us howto do it like flashing or something :)

i am just curious and avoid a bootloop.

ooh and btw after this we need to flash the xposed zip and wipe dalvik and cache and install xposed installer ?

please someone explain !
[Sony Cross-Device General] McBane87:
Just added short instruction ;)

Or do you need instruction on how to use TWRP/CWM?

This will not interfere with Xposed-Files itself, so you can flash it before or after Xpsoed.
[Sony Cross-Device General] Pandemic:
sorry [MENTION=4712883]McBane87[/MENTION]

i was just curious, and i know how to use it,

but about xposed installer, we need to flash the xposed zip 1st then reboot and install xposed installer ?

i need only to know that
[Sony Cross-Device General] nurps:
I didn't wipe, worked without, but after flashing xposed it rebuilds the apps anyway. I flashed first, then installed.
[Sony Cross-Device General] ondrejvaroscak:
Despair

I am really thinking of just getting dmesg/logcats from same vanilla system before/after xposed and going through side-by-side....