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

[BUG] Segmentation Fault part way through extracting from DVB #1084

Closed
7 tasks done
bcb2000 opened this issue Apr 28, 2019 · 8 comments
Closed
7 tasks done

[BUG] Segmentation Fault part way through extracting from DVB #1084

bcb2000 opened this issue Apr 28, 2019 · 8 comments

Comments

@bcb2000
Copy link

bcb2000 commented Apr 28, 2019

CCExtractor version (using the --version parameter preferably) : 0.87

In raising this issue, I confirm the following (please check boxes, eg [X] - and delete unchecked ones):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked that the issue I'm posting isn't already reported.
  • I have checked that the issue I'm porting isn't already solved and no duplicates exist in closed issues and in opened issues
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • I have used the latest available version of CCExtractor to verify this issue exists.

My familiarity with the project is as follows (check one, eg [X] - and delete unchecked ones):

  • I have used CCExtractor just a couple of times.

Necessary information

  • Is this a regression (did it work before)? [X] NO | [ ] YES - please specify the last known working version
  • What platform did you use? [ ] Windows - [X] Linux - [ ] Mac
  • What were the used arguments? none

Video links (replace text below with your links)

http://213.229.121.188/1.srt
http://213.229.121.188/1.ts

Additional information

  • CCExtractor was installed using the ./build method
  • OS is Debian 9.1

$ ccextractor /tmp/1.ts
CCExtractor 0.87, Carlos Fernandez Sanz, Volker Quetschke.
Teletext portions taken from Petr Kutalek's telxcc


Input: /tmp/1.ts
[Extract: 1] [Stream mode: Autodetect]
[Program : Auto ] [Hauppage mode: No] [Use MythTV code: Auto]
[Timing mode: Auto] [Debug: No] [Buffer input: No]
[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No]
[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No]
[Add font color data: Yes] [Add font typesetting: Yes]
[Convert case: No] [Video-edit join: No]
[Extraction start time: not set (from start)]
[Extraction end time: not set (to end)]
[Live stream: No] [Clock frequency: 90000]
[Teletext page: Autodetect]
[Start credits text: None]
[Quantisation-mode: CCExtractor's internal function]


Opening file: /tmp/1.ts
File seems to be a transport stream, enabling TS mode
Analyzing data in general mode
18% | 11:11Segmentation fault

The resulting .srt is complete as far as to 11:44.

@thelastpolaris
Copy link
Contributor

I can confirm this issue and will look at it in more details soon.

@thelastpolaris
Copy link
Contributor

The issue at 11:44 is due to the absence of check whether last_font_tag_end in ocr.c:662 actually contains text or not. However, I get another SEGFAULT with your file in the middle of processing. Will look at it and commit the changes.

@bcb2000
Copy link
Author

bcb2000 commented Apr 28, 2019

Thanks for your swift analysis and investigation!

For background, the sample .ts file is the output from Plex, whose source is a HDHomeRun network tuner. I initially thought the issue was related to HD streams (the sample I provided is HD) but I have also seen the same issue with SD streams. From a small sample, it seems that at least half of the .ts files I've grabbed can demonstrate this behaviour in CCExtractor.

I'm happy to provide more samples if required, and will test any published updates against my backlog of .ts files.

Thanks again!

thelastpolaris added a commit to thelastpolaris/ccextractor that referenced this issue Apr 30, 2019
@thelastpolaris
Copy link
Contributor

Ok, so I made a pull request with changes that solve the bug you filed, but it doesn't solve all the problems that we have in DVB module. I'm getting a segfault at 33:53 with free(): invalid next size (normal) description. Kindly ask you to test extensively CCExtractor on your files with DVB. The problem, which you described, should be solved by this commit, but there can be other problems with DVB support. Please, tell me if you will encounter any more segfaults.

While waiting for pull request to be pulled to master you can try the new changes by downloading and building CCExtractor from this repo

@cfsmp3 cfsmp3 closed this as completed in d3543ff May 1, 2019
@bcb2000
Copy link
Author

bcb2000 commented May 1, 2019

Thanks again.

My testing is continuing. I have set master and issue_1084 branches away on my full set of 220 .ts files, most (if not all?) seem to have dvb subtitles.

So far, master has processed 190, and had 110 segfaults
issue_1084 has processed 125, and had 1 segfault.

The single segfault for issue_1084 branch is on this file:
http://213.229.121.188/2.ts [836M]

I will post final test results when both versions have processed all files.

@thelastpolaris
Copy link
Contributor

@bcb2000 Thx for testing! It looks like this patch solved most of the issues but let's wait for the end results of your testing. Patch is available in master now.

Also I processed 2.ts file that you provided and got no segfault. Some issues with DVB module look pretty random.

@bcb2000
Copy link
Author

bcb2000 commented May 2, 2019

All of my ts files have now been processed by the issue_1084 branch of ccextractor.
master: 129 Segfaults from 220 .ts files. 5 ended abruptly with "Aborted"
fix: 1 Segfault (as previously reported - I tried again and still get a Segfault) 17 "Aborted"

The fix seems very good to me.

On a point of order, would you like me to raise a new bug for the 17 "Aborted" scenarios? There's something not right about the files because ffmpeg also has problems with them (if I use -c:s copy arguments) and also aborts without completing processing.

@thelastpolaris
Copy link
Contributor

@bcb2000 I'm happy to hear that it helped :)

On a point of order, would you like me to raise a new bug for the 17 "Aborted" scenarios?

Sure. Please, add sample files with which you get "aborted" scenario to the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants