Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tvheadend: fix bus error #7606

Merged
2 commits merged into from
Oct 3, 2021
Merged

tvheadend: fix bus error #7606

2 commits merged into from
Oct 3, 2021

Conversation

MrAdityaAlok
Copy link
Member

No description provided.

@MrAdityaAlok
Copy link
Member Author

MrAdityaAlok commented Sep 28, 2021

@wsnake65 I need some help from you.
I have enabled debug build. Please download and install it from github actions.
Then

  • install gdb using pkg i gdb
  • run tvheadend with gdb as gdb --args tvheadend {WHATEVER ARGS YOU WISH TO GIVE TO TVHEADEND}
  • when it crashes use bt command to get backtrace.
  • please provide me that backtrace.

@wsnake65
Copy link

@wsnake65 I need some help from you. I have enabled debug build. Please download and install it from github actions. Then

* install `gdb` using `pkg i gdb`

* run `tvheadend` with gdb as `gdb --args tvheadend {WHATEVER ARGS YOU WISH  TO GIVE TO TVHEADEND}`

* when it crashes use `bt` command to get backtrace.

* please provide me that backtrace.

bt:
Thread 26 "tvh:mi-main" received signal SIGBUS, Bus error.
[Switching to LWP 14717]
decrypt_packets_32int (keys=0xb10e4000, cluster=) at src/descrambler/ffdecsa/FFdecsa.c:834
834 src/descrambler/ffdecsa/FFdecsa.c: (undocumented errno 2).
(gdb) bt
#0 decrypt_packets_32int (keys=0xb10e4000, cluster=) at src/descrambler/ffdecsa/FFdecsa.c:834
#1 0x7d69af60 in tvhcsa_des_flush (csa=0xb36d8f04, s=0xb209fe00) at src/descrambler/tvhcsa.c:75
#2 tvhcsa_des_descramble (csa=0xb36d8f04, s=0xb209fe00, tsb=0xaf93f430 "G", tsb_len=)
at src/descrambler/tvhcsa.c:150
#3 0x7d65940e in descrambler_descramble (t=, st=, tsb=,
len=) at src/descrambler/descrambler.c:765
#4 0x7d660072 in ts_recv_packet1 (t=0xb209fe00, tsb=0xb1062011 "G", len=1316, table=1)
at src/input/mpegts/tsdemux.c:233
#5 0x7d65f4c4 in mpegts_input_process (mi=, mpkt=)
at src/input/mpegts/mpegts_input.c:1415
#6 mpegts_input_thread (p=) at src/input/mpegts/mpegts_input.c:1556
#7 0x7d5dc488 in thread_wrapper (p=0xb1032280) at src/wrappers.c:159
#8 0xb3d32c16 in __pthread_start(void*) () from /system/lib/libc.so
#9 0xb3ced066 in __start_thread () from /system/lib/libc.so
#10 0x00000000 in ?? () from /data/data/com.termux/files/usr/bin/tvheadend
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) q

@MrAdityaAlok
Copy link
Member Author

@wsnake65 Thankyou!

@xtkoba
Copy link
Contributor

xtkoba commented Sep 29, 2021

Maybe we need -DMEMALIGN=__attribute__((aligned(8))) for CFLAGS.

@wsnake65
Copy link

wsnake65 commented Oct 1, 2021

@wsnake65 Thankyou!

Is there a solution to this problem (tvheadend crashes)?

@MrAdityaAlok
Copy link
Member Author

@wsnake65 can you check if new build works. Download from here https://github.com/termux/termux-packages/actions/runs/1297584678

If it does not work then please provide me backtrace again.

@MrAdityaAlok
Copy link
Member Author

MrAdityaAlok commented Oct 2, 2021

@wsnake65 do not try it now. I am building from master branch, which should fix the issue.
This is not viable, patching v4.2.8 to fix bus error.

@MrAdityaAlok
Copy link
Member Author

MrAdityaAlok commented Oct 2, 2021

@wsnake65 you can download from https://github.com/termux/termux-packages/actions/runs/1297718826 and check if build works.

@wsnake65
Copy link

wsnake65 commented Oct 2, 2021

@wsnake65 you can download from https://github.com/termux/termux-packages/actions/runs/1297718826 and check if build works.

I can not download - no files

@xtkoba
Copy link
Contributor

xtkoba commented Oct 2, 2021

Ah, CFLAGS (or other variables for make) containing parenthesis is problematic...

It would be much easier to modify the definition of MEMALIGN in the source directly instead:

--- a/src/descrambler/ffdecsa/FFdecsa.c
+++ b/src/descrambler/ffdecsa/FFdecsa.c
@@ -106,7 +106,7 @@
 #define FREE(X) free(X)
 #endif
 #ifndef MEMALIGN
-#define MEMALIGN
+#define MEMALIGN __attribute__((aligned(8)))
 #endif
 
 //// debug tool

@MrAdityaAlok
Copy link
Member Author

Ah, CFLAGS (or other variables for make) containing parenthesis is problematic...

It would be much easier to modify the definition of MEMALIGN in the source directly instead:

--- a/src/descrambler/ffdecsa/FFdecsa.c
+++ b/src/descrambler/ffdecsa/FFdecsa.c
@@ -106,7 +106,7 @@
 #define FREE(X) free(X)
 #endif
 #ifndef MEMALIGN
-#define MEMALIGN
+#define MEMALIGN __attribute__((aligned(8)))
 #endif
 
 //// debug tool

Yes, yes was doing that only.

@MrAdityaAlok
Copy link
Member Author

@wsnake65
Copy link

wsnake65 commented Oct 2, 2021

@wsnake65 https://github.com/termux/termux-packages/actions/runs/1297994529 you can test now.

Thank you, everything works fine! Also checked the timeshift and recording - everything is fine. Please compile the package without debugs in termux.

tvheadend: enable libavutil

Revert "tvheadend: enable libavutil"

This reverts commit 619b8c6.

tvheadend: enable debug build

tvheadend: enable debug build again

gdbm: fix ssl certificate expired issue

tvheadend: try

tvheadend: try 2

tvheadend: try 3

gdbm: revert to https

tvheadend: try 4

tvheadend: build from master

Revert "tvheadend: build from master"

This reverts commit ce010e9.

tvheadend: fix bus error

tvheadend: fix bus error

tvheadend: fix build

tvheadend: fix build

tvheadend: fix bus error
tvheadend: fix bus error
@MrAdityaAlok
Copy link
Member Author

MrAdityaAlok commented Oct 2, 2021

@xtkoba and @wsnake65 thankyou for your help

@MrAdityaAlok MrAdityaAlok marked this pull request as ready for review October 2, 2021 13:20
@MrAdityaAlok
Copy link
Member Author

This PR should be ready to be merged.

@ghost ghost merged commit 0cff0f4 into termux:master Oct 3, 2021
@MrAdityaAlok MrAdityaAlok deleted the tvheadend branch October 3, 2021 19:27
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants