Author Topic: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove  (Read 3041 times)

nibbles

  • Sr. Member
  • ****
  • Posts: 292
I can't seem to open 1080i MPEG2 with AC3 audio in a .ts file using r7902 on OSX.
I'm not sure when this started, as I haven't tried this before.  I used dd to make a
small sample file of a PBS (Public Broadcast System) TV show that was broadcast
over the air in HD recently.  It is legal content from a commercial free network.

Error Summary:
Code: [Select]
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000011235c000
0x00007fff94b13d51 in memmove$VARIANT$sse42 ()

Steps to reproduce:
  Build avidemux-2.6 in debug mode (or release mode) using llvm-gcc or clang.
  Open this file (10 MB):  https://github.com/2bits/samples/raw/master/PBS.1080i.sample.ts
  Segfault 11 before it gets finished loading it.
  This happens using avidemux or avidemux_cli, with or without OpenGL enabled.

Logfiles: I have pasted into a gist the following data:


I would try to provide more info, e.g. what BitBlit was sending to memmove, but I'm not sure how to do that.
I have tried to open a few other 1080i videos that were all encoded the same way using the same setup, without success.
I can successfully open a 480i encoded the same way.  I suppose it goes through different steps.
This is not critical, but it would be nice if it worked.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #1 on: April 27, 2012, 12:09:14 PM »
Opens here (Ubuntu 11.10 64-bit) with 2.6 r7902. The terminal output when opening the clip uploaded by you: https://gist.github.com/2508662

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #2 on: April 27, 2012, 12:28:01 PM »
Try not using OpenGL (only for Nvidia) in avidemux, have problems to with OpenGL on Intel core I3 and I5 gpu's. Try, if you have the choice, X11 or xvideo for output

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10968
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #3 on: April 27, 2012, 02:32:13 PM »
Seems to crash in a sse4 variant of memmove
If the source & destination address are legit, shouldnt crash

With the gdb backtrack could you try to dump what it's trying to copy to see if the source& dest address are ok ?


nibbles

  • Sr. Member
  • ****
  • Posts: 292
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #4 on: April 28, 2012, 06:07:43 AM »
@jan thanks for checking that it works for you.  In my OP I mentioned it occurs with or without OpenGL.

@mean Here is the output of bt full that shows a lot of more information than the backtrace I linked above.  If there's another command I should use, please let me know.

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10968
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #5 on: April 28, 2012, 08:23:03 AM »
Ok, found the problem
It is an issue with coded height vs real height

The real height is 1080 but it is coded inside 1088 height
Avidemux tries to copy the 1088 lines, but only 1080 are actually usable

I fixed something similar for h264, need to do it for mpeg2

Thanks for the infos, it helped a lot

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10968
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #6 on: April 28, 2012, 09:56:07 AM »
Should be fixed now

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10968
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #7 on: April 28, 2012, 11:39:08 AM »
& Remove the index file

nibbles

  • Sr. Member
  • ****
  • Posts: 292
Re: r7902 - Segfault loading 1080i MPEG2+AC3+ts after BitBlit in memmove
« Reply #8 on: April 29, 2012, 05:34:45 AM »
Thanks for the fix.  It works now using r7907, built with clang or llvm-gcc.