VR-25 / acc

Advanced Charging Controller
https://github.com/Magisk-Modules-Repo/acc
GNU General Public License v3.0
1.71k stars 107 forks source link

v2024.4.7-rc fails with segfault #248

Closed elhennig closed 4 months ago

elhennig commented 5 months ago

I tried to update acc via

acc -u dev

but in version v2024.4.7-rc the daemon cannot be started and the acc command fails with segfault. I reverted back to the latest stable at that works fine.

acc -v

v2023.10.16 (202310160)

VR-25 commented 5 months ago

Segfault is a binary-related error. ACC has only shell scripts. Two possibilities: Something's wrong with your OS' mksh (the shell) or busybox. I'm keeping an eye on this. Meanwhile, try ...7.1.

elhennig commented 5 months ago

Thanks for the clarification. Strange is, that it works with the latest stable release, but not with the dev version.

EDIT: ..7.1-rc produces the same behavior.

VR-25 commented 5 months ago

acc_v2024.4.7.2-rc_202404072_1819.zip Try this.

elhennig commented 5 months ago

No change, unfortunately. And I have no real idea how to debug this more to find possible issues on my device.

VR-25 commented 5 months ago

See if pasting and running the following line on terminal helps:

cd /data/adb/vr25; mkdir -p bin; echo -e "#!/system/bin/sh\n:" > bin/pkill; chmod 0755 bin/pkill

Remove the file if it doesn't help.

VR-25 commented 4 months ago

acc_v2024.4.11-rc_202404110_2144.zip

xChickens commented 4 months ago

acc_v2024.4.11-rc_202404110_2144.zip

Yea I'm also getting segfault on this release and the latest weekly release. On Pixel 7 Pro latest rom with APatch

kailiu42 commented 4 months ago

I'm from issue #249. It seems this segfault is due to /data/adb/vr25/acc/acc.sh:

#!/system/bin/sh
#exec_wrapper
if [ -f /dev/.vr25/acc/.updated ]; then  <-- no such .updated file, so the script goes to the else branch
  exec /dev/accd. "$@"
else
  exec . /data/adb/vr25/acc/acc.sh "$@"  <-- runs into a recursive loop and sh finally segfault.
fi
VR-25 commented 4 months ago

I'm from issue #249. It seems this segfault is due to /data/adb/vr25/acc/acc.sh:

#!/system/bin/sh
#exec_wrapper
if [ -f /dev/.vr25/acc/.updated ]; then  <-- no such .updated file, so the script goes to the else branch
  exec /dev/accd. "$@"
else
  exec . /data/adb/vr25/acc/acc.sh "$@"  <-- runs into a recursive loop and sh finally segfault.
fi

That file is in the bin folder. It's not acc.sh. So, no chance of recursive loop there.

Are all of you using Apatch? Why am I not getting segfaults with KernelSU?

kailiu42 commented 4 months ago

That file is in the bin folder. It's not acc.sh. So, no chance of recursive loop there.

This file is /data/adb/vr25/acc/acc.sh, that's why it's segfaulting.

I'm using Magisk. Your magisk module might have some problem.

kailiu42 commented 4 months ago

This is how it looks like after flashed acc_v2024.4.11-rc_202404110_2144.zip.

Snipaste-20240416-160432
VR-25 commented 4 months ago

This is how it looks like after flashed acc_v2024.4.11-rc_202404110_2144.zip.

Snipaste-20240416-160432

Definitely something's wrong there. acc.sh in this case, has the contents of bin/acc, which is weird. Looks like this is not happening to KernelSU Installs. I'll take a closer look.

VR-25 commented 4 months ago

I'd like you guys to try a clean install. Uninstall acc with acc -U then flash the new zip.

acc_v2024.4.15-rc_202404150_1809.zip

Even though acc uninstalls the current version before an upgrade/downgrade, there's an issue when upgrading from a fairly older build. It mistakenly follows bin/acc* symbolic links, overwriting the wrong files. I'll be working on a fix soon.

kailiu42 commented 4 months ago

I'd like you guys to try a clean install. Uninstall acc with acc -U then flash the new zip.

Yes the segfault is gone now.

VR-25 commented 4 months ago

https://github.com/VR-25/acc/files/15017403/acc_v2024.4.17-rc_202404170_2102.zip