Issue 42: Mencode and Tivo Decode Crash
Status:  Fixed
Owner:
Closed:  Dec 2008
Reported by jonathan...@gmail.com, Nov 22, 2008
What steps will reproduce the problem?
1. download any file
2. mencode and tivodecode crash at the same time
3. itivo begins again to attempt a download and the cycles goes on...

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
1.5bs 10.5.5

Please provide any additional information below.


Nov 22, 2008
Project Member #1 yoav.yer...@gmail.com
is this on a PPC or intel?
   Is this for every show or just some?
   Was this not happening under 1.4?

  (I can't really control tivodecode/mencoder crashing, I didn't write them, but if
they crash on everything, something else might be broken that I can look at)
Status: Accepted
Owner: yoav.yerushalmi
Nov 22, 2008
Project Member #2 yoav.yer...@gmail.com
oh and what download format are you using?
Nov 24, 2008
#3 ska...@gmail.com
Seeing the same thing under Tiger.  Is Leopard the only version of OSX supported?

I see this in the mencode crash log:

Library not loaded: /usr/lib/libiconv.2.dylib
  Referenced from: /Applications/iTiVo.app/Contents/Resources/mencoder
  Reason: Incompatible library version: mencoder requires version 7.0.0 or later, but
libiconv.2.dylib provides version 5.0.0

Which makes me think I may need Leopard.

The tivodecode log says:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0   libSystem.B.dylib   0x900026e4 getenv + 13
1   libSystem.B.dylib   0x900364b9 getopt_internal + 57
2   tivodecode          0x000032d7 0x1000 + 8919
3   tivodecode          0x0000244e 0x1000 + 5198

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x00000000  ebx: 0x90036491  ecx: 0x90000fd8  edx: 0x00000008
  edi: 0x00000000  esi: 0x00000000  ebp: 0xbfffea58  esp: 0xbfffea30
   ss: 0x0000001f  efl: 0x00010286  eip: 0x900026e4   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037

Binary Images Description:
    0x1000 -     0xdfff tivodecode     
/Applications/iTiVo.app/Contents/Resources/tivodecode
0x8fe00000 - 0x8fe4afff dyld 46.16      /usr/lib/dyld
0x90000000 - 0x90171fff libSystem.B.dylib       /usr/lib/libSystem.B.dylib
0x901c1000 - 0x901c3fff libmathCommon.A.dylib   /usr/lib/system/libmathCommon.A.dylib
0x90bd1000 - 0x90bd8fff libgcc_s.1.dylib        /usr/lib/libgcc_s.1.dylib

Nov 24, 2008
Project Member #4 yoav.yer...@gmail.com
So, I compiled everything on leopard (that's the only OS I have)... but I compiled it
with 10.4 compatibility, so it's supposed to have all the right libraries.

  From that log, it clearly looks like there's a version issue.

  Before I track down if there's a version mismatch with 10.4, can you do me a favor
and run 'Software Update...' from the apple menu?  The last time this happened it was
to a user who hadn't updated his OS in while, and a security update changed the
version of the library...

  If it still breaks after that, tell me and I'll see if I can find a way to use a
different iconv library.
Nov 25, 2008
#5 ska...@gmail.com
I actually had run Software Update to get the latest Safari within the last few days,
so I am definitely fully up to date.
Nov 25, 2008
Project Member #6 yoav.yer...@gmail.com
hmm looking around on the net it looks like there's an issue with iconv being used
from the source OS instead of the SDK.

  Ok will see if I can fix this.  
  Thanks
Nov 25, 2008
Project Member #7 yoav.yer...@gmail.com
Ok, if you have the energy, please download 1.5b7 and tell me if it's working for you?

  (it's possible comskip won't work) --  I tried to compile manually with 10.4
compatibility forced in everywhere...
Nov 28, 2008
#9 paulm...@parashak.net
I have a similar problem. Here is a partial readout of the crash notice:
Process:         mencoder [3244]
Path:            /Applications/iTiVo/iTiVo.app/Contents/Resources/mencoder
Identifier:      mencoder
Version:         ??? (???)
Code Type:       X86 (Native)
Parent Process:  bash [3242]

Date/Time:       2008-11-28 18:33:03.828 -0500
OS Version:      Mac OS X 10.5.5 (9F33)
Report Version:  6

Exception Type:  EXC_ARITHMETIC (SIGFPE)
Exception Codes: EXC_I386_DIV (divide by zero)
Crashed Thread:  0

Thread 0 Crashed:
0   libgcc_s.1.dylib              	0x95ec1eeb __divdi3 + 187

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x00000001  ebx: 0x057e4000  ecx: 0x00000000  edx: 0x00000000
  edi: 0x00000000  esi: 0x00000000  ebp: 0xbffff198  esp: 0xbffff160
   ss: 0x0000001f  efl: 0x00010246  eip: 0x95ec1eeb   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x0000003f   gs: 0x00000037
  cr2: 0x001bb240

Binary Images:
    0x1000 -   0x6e8fff +mencoder ??? (???) <fcb4effba594cee1044bf82b7f06562d>
/Applications/iTiVo/iTiVo.app/Contents/Resources/mencoder
0x8fe00000 - 0x8fe2da53  dyld 96.2 (???) <5013f43c4d2c33c9619011f103ec3238> /usr/lib/dyld
0x90071000 - 0x90089fff  com.apple.openscripting 1.2.8 (???)
<572c7452d7e740e8948a5ad07a99602b>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x9008a000 - 0x9009affc  com.apple.LangAnalysis 1.6.4 (1.6.4)
<8b7831b5f74a950a56cf2d22a2d436f6>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x901d4000 - 0x901d4ff8  com.apple.Cocoa 6.5 (???) <e9318c93615b27231498bbe585b8da98>
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x901dd000 - 0x901e9ffe  libGL.dylib ??? (???)
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x901ea000 - 0x905a8fea  libLAPACK.dylib ??? (???)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
....

Dec 1, 2008
#10 Subtltz...@gmail.com
Same issue here (mencoder crash, divide by zero). Running Leopard 10.5.5 but sure the detailed logs are 
similar/same as previously reported.
Thanks.
Dec 3, 2008
#11 ska...@gmail.com
And on 10.4, still seeing the library issues:

Date/Time:      2008-12-03 09:05:53.971 -0500
OS Version:     10.4.11 (Build 8S2167)
Report Version: 4

Command: mencoder
Path:    /Applications/iTiVo.app/Contents/Resources/mencoder
Parent:  sh [9649]

Version: 1.5 (1.5)

PID:    9650
Thread: Unknown

Link (dyld) error:

Library not loaded: /usr/lib/libiconv.2.dylib
  Referenced from: /Applications/iTiVo.app/Contents/Resources/mencoder
  Reason: Incompatible library version: mencoder requires version 7.0.0 or later
, but libiconv.2.dylib provides version 5.0.0

Dec 3, 2008
Project Member #12 yoav.yer...@gmail.com
Ok the 10.5 crash is completely different from the 10.4

  the 10.4 is caused by incompatible shared libs.  I've tried figuring a workaround
but it seems the only real solution for me would be to compile everything on 10.4  
  Since I can't,  I'm going to mark the program as Leopard-only (until a workaround
presents itself).

  As for the 10.5 crash, it seems like somewhere in the code there is a divide by
zero going on.  Is this unique to one encode?  one format?  or is it happening
everywhere?

Dec 3, 2008
Project Member #13 yoav.yer...@gmail.com
Alright the latest beta 1.6b3  is supposed to work on 10.4, so can you tell me if
it's working for you?
Dec 10, 2008
#14 jonathan...@gmail.com
So I'm still getting mencode crashes as well.  Running 10.5.5 and wondering how I can
get the detailed info to provide you about the crash? and what is the divide by zero?
 IS that an error that mencode is throwing up with it's crash splash screen?
Dec 10, 2008
Project Member #15 yoav.yer...@gmail.com
First thing to try:

  Open up a Terminal.app (from Applications/Utilities)
  into it, type the following:

  /Applications/iTiVo.app/Contents/Resources/mencoder

  If it spits out an error (other than No File Given), copy and paste that here.  If
that is working, then something about your source video from the tivo is broken.

  You are not getting the divide by zero error (you would see a BIG window open up to
tell you this).

Dec 10, 2008
#16 jonathan...@gmail.com
ok so i did not get the divide by zero error.

Let me know if this should be a new Issue number.

I did get this error in the middle of part 2, the commercial skip section....Any
ideas on this one?  It shows up as an applescript error.
System Events got an error: Can’t get property list file "Macintosh
HD:Applications:iTiVo.app:|Contents:Resources:formats.plist". (-1728)

The f


Dec 10, 2008
Project Member #17 yoav.yer...@gmail.com
Erm, your bug submission seems incomplete?

  I find it strange that it tries to open a file with a '|' symbol in it..
  It's really looking like your installation is somehow corrupted though..
(the .plist file mentioned ships with the application bundle, and is not
modified by anything, so I don't know why it's not finding it unless it
REALLY is trying to put a pipe symbol in the filename).

  Anyways,  try completely deleting your application from the Applications drawer,
and then re-installing it?

Dec 10, 2008
#18 jonathan...@gmail.com
ok I rebooted and tried again and I got the same error listed above when I chose to
view the prefs of the app(Had just begun phase III of the process for the same file
used in above report)  Is it normal for it to take 400 minutes for a 4gig HD program
decode(phase III) at 5mbps quicktime quality on a 2.5 gig intel with 4gig of memory.
 I'm reinstalling now - will use app cleaner to be sure I get all the itivo stuff out
before I reinstall
Dec 10, 2008
Project Member #19 yoav.yer...@gmail.com
Don't mess with the preferences while it's downloading...  Although it *shouldnt*
matter, it's possible that changing the prefs is confusing the phases...

  Yes it's normal for HUGE encodes to take a while, and an HD show (1920x1080) at
h.264 5mbps is a VERY VERY big and complex encode.  Try using a smaller format (like
iphone) to see if 'anything' is working. 

Failing that, it's time to do a step-wise thing to see what's breaking:

  so see if you can just get the show (choose the 'decrypt' format).
  
Dec 17, 2008
Project Member #20 yoav.yer...@gmail.com
Ok, turns out there *were* issues with the ppc build of mencoder.  The new build is
*still* slow, but should be a little faster, and shouldn't generate buggy files. 
(the beta build that is)
Status: Fixed
Dec 17, 2008
#21 jonathan...@gmail.com
FYi - everything seems to be working well now so my issue is resolved.  One final
question though - now, all of a sudden, the first time i open the mp4's they open in
itunes and i have to cancel the copy.  Once I do that when i double click them they
open in quicktime. Any idea why?  (I have not checked "import to itunes")
Dec 17, 2008
Project Member #22 yoav.yer...@gmail.com
Good to hear that it's working.

 I'm not 100% sure, but it sounds like you need to set your default mp4 viewer to
Quicktime..  Easiest way is probably to select a file that you've just downloaded, 
right click, choose "Get Info..."

  There should be an "Open With:" option there,  select Quicktime, and click "Change
All.." to set the global default.

  IF that doesn't help, I'm not sure though.. you may want to ask on an apple forum,
it seems like it's some sort of global setting you need to override...