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

JVM crash on audio decode #27

Closed
dstieglitz opened this issue Jul 22, 2014 · 5 comments
Closed

JVM crash on audio decode #27

dstieglitz opened this issue Jul 22, 2014 · 5 comments
Labels

Comments

@dstieglitz
Copy link

While attempting to open an HLS stream over HTTP, our humble-based application crashed. See stack trace excerpt below:

Thread 75 Crashed:: Java: Audio Decode Thread
0   libsystem_kernel.dylib              0x00007fff8a76f866 __pthread_kill + 10
1   libsystem_pthread.dylib             0x00007fff8614535c pthread_kill + 92
2   libsystem_c.dylib                   0x00007fff84e9db1a abort + 125
3   libsystem_malloc.dylib              0x00007fff91040690 szone_error + 587
4   libsystem_malloc.dylib              0x00007fff910466f4 small_malloc_from_free_list + 1162
5   libsystem_malloc.dylib              0x00007fff910457b2 szone_malloc_should_clear + 1327
6   libsystem_malloc.dylib              0x00007fff91047868 malloc_zone_malloc + 71
7   libsystem_malloc.dylib              0x00007fff9104827c malloc + 42
8   libjvm.dylib                        0x00000001061b41b1 os::malloc(unsigned long) + 27
9   libjvm.dylib                        0x00000001060a1967 jni_GetByteArrayElements + 108
10  humble3772417458551337729.tmp       0x000000011a2376d5 JNIEnv_::GetByteArrayElements(_jbyteArray*, unsigned char*) + 69
11  humble3772417458551337729.tmp       0x000000011a236769 VS_JNI_malloc_javaByteBacked(JNIEnv_*, _jobject*, unsigned long) + 409
12  humble3772417458551337729.tmp       0x000000011a235705 VSJNI_malloc(_jobject*, unsigned long) + 261
13  humble3772417458551337729.tmp       0x000000011a2355e8 io::humble::ferry::JNIMemoryManager::malloc(void*, unsigned long) + 40
14  humble3772417458551337729.tmp       0x000000011a22cf38 io::humble::ferry::BufferImpl::make(io::humble::ferry::RefCounted*, int) + 1064
15  humble3772417458551337729.tmp       0x000000011a230f2b io::humble::ferry::Buffer::make(io::humble::ferry::RefCounted*, int) + 27
16  humble3772417458551337729.tmp       0x000000011a258b96 io::humble::video::MediaAudioImpl::make(int, int, int, io::humble::video::AudioChannel::Layout, io::humble::video::AudioFormat::Type) + 2854
17  humble3772417458551337729.tmp       0x000000011a257874 io::humble::video::MediaAudio::make(int, int, int, io::humble::video::AudioChannel::Layout, io::humble::video::AudioFormat::Type) + 52
18  humble3772417458551337729.tmp       0x000000011a2c470a Java_io_humble_video_VideoJNI_MediaAudio_1make_1_1SWIG_10 + 138
@artclarke
Copy link
Owner

Hey Dan,

Any chance you have:

  1. a HLS server / URL that you tried to stream from?
  2. A simple stand-alone Java either Unit Test or main program that repros
    this in Humble Video by attempting to stream from that URL that I could run?

Otherwise, it's hard for me to debug :(

  • Art

On Mon, Jul 21, 2014 at 9:08 PM, dstieglitz [email protected]
wrote:

While attempting to open an HLS stream over HTTP, our humble-based
application crashed. See stack trace excerpt below:

Thread 75 Crashed:: Java: Audio Decode Thread
0 libsystem_kernel.dylib 0x00007fff8a76f866 pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff8614535c pthread_kill + 92
2 libsystem_c.dylib 0x00007fff84e9db1a abort + 125
3 libsystem_malloc.dylib 0x00007fff91040690 szone_error + 587
4 libsystem_malloc.dylib 0x00007fff910466f4 small_malloc_from_free_list + 1162
5 libsystem_malloc.dylib 0x00007fff910457b2 szone_malloc_should_clear + 1327
6 libsystem_malloc.dylib 0x00007fff91047868 malloc_zone_malloc + 71
7 libsystem_malloc.dylib 0x00007fff9104827c malloc + 42
8 libjvm.dylib 0x00000001061b41b1 os::malloc(unsigned long) + 27
9 libjvm.dylib 0x00000001060a1967 jni_GetByteArrayElements + 108
10 humble3772417458551337729.tmp 0x000000011a2376d5 JNIEnv
::GetByteArrayElements(jbyteArray, unsigned char
) + 69
11 humble3772417458551337729.tmp 0x000000011a236769 VS_JNI_malloc_javaByteBacked(JNIEnv__, jobject, unsigned long) + 409
12 humble3772417458551337729.tmp 0x000000011a235705 VSJNI_malloc(jobject, unsigned long) + 261
13 humble3772417458551337729.tmp 0x000000011a2355e8 io::humble::ferry::JNIMemoryManager::malloc(void_, unsigned long) + 40
14 humble3772417458551337729.tmp 0x000000011a22cf38 io::humble::ferry::BufferImpl::make(io::humble::ferry::RefCounted_, int) + 1064
15 humble3772417458551337729.tmp 0x000000011a230f2b io::humble::ferry::Buffer::make(io::humble::ferry::RefCounted_, int) + 27
16 humble3772417458551337729.tmp 0x000000011a258b96 io::humble::video::MediaAudioImpl::make(int, int, int, io::humble::video::AudioChannel::Layout, io::humble::video::AudioFormat::Type) + 2854
17 humble3772417458551337729.tmp 0x000000011a257874 io::humble::video::MediaAudio::make(int, int, int, io::humble::video::AudioChannel::Layout, io::humble::video::AudioFormat::Type) + 52
18 humble3772417458551337729.tmp 0x000000011a2c470a Java_io_humble_video_VideoJNI_MediaAudio_1make_1_1SWIG_10 + 138


Reply to this email directly or view it on GitHub
#27.

@artclarke artclarke added the bug label Jul 24, 2014
@dstieglitz
Copy link
Author

This URL works in VLC, for example, but causes the error above when we try to load it in our player:

http://www.nasa.gov/multimedia/nasatv/NTV-Public-IPS.m3u8

artclarke added a commit that referenced this issue Aug 21, 2014
artclarke added a commit that referenced this issue Aug 21, 2014
Squashed commit of the following:

commit 1009bd7
Author: Art Clarke <[email protected]>
Date:   Thu Aug 21 05:58:02 2014 -0700

    add a test to try to repro issue #27

commit 10cb830
Author: Art Clarke <[email protected]>
Date:   Wed Aug 20 16:24:41 2014 -0700

    adjust timestamps after filtering, not before

commit f6370ec
Author: Art Clarke <[email protected]>
Date:   Tue Aug 19 08:10:40 2014 -0700

    make sure we have enough audio in a frame before we try to encode.

    For this checkin, the testfile in the encoder has correct audio. video
    is a little off -- but this is likely to do the video path (given that
    the output video has an incorrect starting frame or two). That's next
    to debug.

commit 48aa868
Author: Art Clarke <[email protected]>
Date:   Mon Aug 18 18:58:08 2014 -0700

    fix linux gcc identified bug: always true test

commit 343d8b2
Author: Art Clarke <[email protected]>
Date:   Mon Aug 18 18:55:08 2014 -0700

    include inttypes.h correctly and modify print strings to be portable

commit 3de21c5
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 11:08:13 2014 -0700

    fix bug that shows up on latest mavericks with -n on echo from shells

commit 2ca8a90
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 11:00:03 2014 -0700

    fix license to CORRECTLY reflect AGPL (the top-level license was AGPL
    originally).

commit 4b3fa3a
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 09:28:14 2014 -0700

    start trying filter graphs and fix a memory leak in encodeVideo

commit 8fa6c2f
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 08:30:05 2014 -0700

    revert accidentally checked in copy of a test

commit 8bd21cb
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 08:27:25 2014 -0700

    add swig generated updates

commit b5d6f35
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 08:26:03 2014 -0700

    change filtering to allow (1) fixed audio frame sizes to be returned and
    (2) EOF handling and EAGAIN handling to be correct. Add tests for both.

commit 4a1b774
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 08:24:27 2014 -0700

    Attempt to fix SWIG generation problem. Not yet working.

commit 973c016
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 08:23:29 2014 -0700

    change EAGAIN handling so we return 0 with an incomplete packet.

commit fc1fc28
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 08:22:58 2014 -0700

    revise comments

commit bc8c072
Author: Art Clarke <[email protected]>
Date:   Sat Aug 16 07:00:38 2014 -0700

    fix comments to reflect that we now throw exceptions for interruptions

commit 895ae13
Author: Art Clarke <[email protected]>
Date:   Wed Aug 13 08:21:30 2014 -0700

    merge MediaAudioImpl into MediaAudio to aid debugging; add signatures (commented out) for pop/push on audio buffers

commit e6f4c25
Author: Art Clarke <[email protected]>
Date:   Wed Aug 13 07:45:05 2014 -0700

    add an error check for incorrect frame size; this will fail some tests but that's the current bug to fix

commit b18add1
Author: Art Clarke <[email protected]>
Date:   Sun Aug 10 20:29:02 2014 -0700

    - do not autoconvert timestamps when timebases change; very error prone.
    - fix off by one error on dropframe calc

commit d1fc870
Author: Art Clarke <[email protected]>
Date:   Sun Aug 10 19:43:50 2014 -0700

    set timestamp after convering timebase

commit 30ddf44
Author: Art Clarke <[email protected]>
Date:   Sun Aug 10 18:05:43 2014 -0700

    copy completeness and timebase

commit 187e3d3
Author: Art Clarke <[email protected]>
Date:   Sun Aug 10 17:52:47 2014 -0700

    more work on encoder. timestamps are still messed up, but getting
    closer.

commit 0fd5837
Author: Art Clarke <[email protected]>
Date:   Wed Aug 6 21:00:18 2014 -0700

    Add Media::logMetadata, and provide trace logging in debug builds for the major workhorse objects

commit c3f84d0
Author: Art Clarke <[email protected]>
Date:   Wed Aug 6 18:28:32 2014 -0700

    add Media::logMetadata to make it easier to output media packets for the inevitable timestamp debugging that now comes

commit 7a8e046
Author: Art Clarke <[email protected]>
Date:   Tue Aug 5 20:42:44 2014 -0700

    more debugging

commit c888dcb
Author: Art Clarke <[email protected]>
Date:   Tue Aug 5 16:56:58 2014 -0700

    add object specific logger names to make it easier to debug each object with logging from Java

commit 840b1f4
Author: Art Clarke <[email protected]>
Date:   Tue Aug 5 08:58:30 2014 -0700

    enable trace logging and clean up an allocation inefficiency highlighted as a result

commit af87b04
Author: Art Clarke <[email protected]>
Date:   Mon Aug 4 20:46:45 2014 -0700

    make tracing logging work in debug builds

commit 117739c
Author: Art Clarke <[email protected]>
Date:   Mon Aug 4 20:16:41 2014 -0700

    more work on the elegant transcoder.
    - fix problem where -debug builds were not staged (Fix issue #28).
    - make packet stream index default to -1 until explicitly set.
    - make muxer look for right stream by checking packet encoders if a
      stream index is not set.
    - Fix a bug where we throw an exception if a codec id was
      AV_CODEC_ID_NONE on a decoder (can happen with some data streams).

commit 3b4a7d4
Author: Art Clarke <[email protected]>
Date:   Fri Aug 1 08:42:28 2014 -0700

    minor formatting

commit 92fc93f
Author: Art Clarke <[email protected]>
Date:   Fri Aug 1 08:41:27 2014 -0700

    and fix bug where when flushing audio encoders we passed crap audio into
    encode due to not correctly checking completeness of the resampler
    audio.

commit b4f3bf1
Author: Art Clarke <[email protected]>
Date:   Fri Aug 1 08:26:09 2014 -0700

    fix bug where encoders sometimes need larger packets by reseting
    the output packet each time through the loop. This will result in the
    Ffmpeg encode allocating a new packet of the correct size.

commit 8ce0403
Author: Art Clarke <[email protected]>
Date:   Wed Jul 30 20:12:44 2014 -0700

    fix bug when null is passed to encode methods.

commit 7cff88d
Author: Art Clarke <[email protected]>
Date:   Wed Jul 30 19:50:13 2014 -0700

    continued work on the transcoder.
    resamplers are a class hierarchy now, which makes the encode and decode
     loops for audio and video possible with super-classes that do not
     distinguish between media types.
    Or it would, if there weren't encoding bugs still :)
@artclarke
Copy link
Owner

Dan, I'm not able to reproduce this easily. I wrote a test that attempts to download from that URL and decode from it (in native code) and it works. I'll keep hammering (there's another test I can do), but if you had a standalone Java program without your player code (i.e. that I could easily run) that reproduced it, it would help.

@artclarke
Copy link
Owner

closing this until I get a piece of code that can repro this. Sorry Dan.

@smikesmike
Copy link

Is it possible, that I ran into the same problem?

I've filed a small project to reproduce the problem:
#141

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

No branches or pull requests

3 participants