15

Why does this problem occur?

public static String path;
private VideoView mVideoView;


mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();

//...

    private int mLayout = VideoView.VIDEO_LAYOUT_ZOOM;

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        if (mVideoView != null)
            mVideoView.setVideoLayout(mLayout, 0);
        super.onConfigurationChanged(newConfig);
    }

this is error

CompEng
  • 7,161
  • 16
  • 68
  • 122
  • 1
    Which line causes the error? Step through it with a debugger and isolate the problematic line. – Aleks G May 28 '12 at 16:27
  • 1
    I do not know it is not error on my code. When I open my app firstly video open and then 1 secong it is closing and saying that error. But my app dont force closing only video closing – CompEng May 28 '12 at 16:30
  • In that case, the issue must be with the video. If the video is malformed, it may cause this error in the system video decoder. Any chance you can share the video or the URL where you are loading it? – Aleks G May 28 '12 at 16:32
  • I use vitamio codec . and the error is from my size? height or width? the url is :mms://50.7.241.234/kelkit – CompEng May 28 '12 at 16:33
  • No stacktrace? If you run with the debugger doesn't it jump to error line when the error happens? – User May 28 '12 at 16:35
  • it is runtime error wait I upload image – CompEng May 28 '12 at 16:36
  • Try loading the file locally and playing it as a local file instead of `mms` stream. – Aleks G May 28 '12 at 16:42
  • Can you record the stream locally? I'm pretty sure the issue is with the content of the stream. – Aleks G May 28 '12 at 16:44
  • I want to play stream video on my app. what does locally mean? – CompEng May 28 '12 at 16:46
  • 2
    Did you found a solution? I'm interested especially for the cause... – Marvin Emil Brach Oct 12 '12 at 08:24
  • I cant find the solution – CompEng Mar 31 '14 at 07:03
  • Here comes a bunch of similar problems. [This answer](http://stackoverflow.com/a/14023479/1900071) states that the error comes because of the bug in your NDK code (if you have any) or because of the bug in the firmware of the device. [This answer](http://stackoverflow.com/a/17213503/1900071) specifies that the problem is happenning because of the out of memory error. Possibly, your case is just `out-of-memory` error, investigate it a bit further through logcat – Drew Apr 03 '14 at 19:02
  • thank you @Drew I investigate that , thanks – CompEng Apr 04 '14 at 04:46

5 Answers5

7

The error message you are seeing is caused by dereferencing a null pointer in native code. From what you show it's hard to guess what may be the cause.

In your place I'd double check that you're not passing a null references to a system or library method.

Nicola Musatti
  • 17,834
  • 2
  • 46
  • 55
5

As mentioned by Nicola, this is most likely caused by dereferencing a null pointer in the native code. I had a similar issue and resolved it by debugging the stack trace.

If you turn off filtering in your log cat, you will see the entire stack trace. This will give you detailed information at where the crash occurred, I used the following python script in order to find the exact cause; https://code.google.com/p/android-ndk-stacktrace-analyzer/wiki/Usage

In my case a null pointer was occurring due to running a custom android build.

Good luck

Lunar
  • 4,663
  • 7
  • 43
  • 51
  • I do not know it is not error on my code. When I open my app firstly video open and then 1 secong it is closing and saying that error. But my app dont force closing only video closing – CompEng Mar 31 '14 at 08:23
  • 1
    Its most likely your VideoView code will be causing and issue in the native code. You really need the full native stack trace to understand why this is happening.. – Lunar Mar 31 '14 at 08:39
  • sorry I cant understand, my code is being causing? beause I just set the path. When I look it on my webbrowser on pc the path is working but when I want to see it on my app , there is an issue – CompEng Mar 31 '14 at 08:45
  • "Its most likely your VideoView code will be causing the issue in the native code" typo :/, what is the path your trying to use? – Lunar Mar 31 '14 at 08:50
  • it is private i am sorry :( – CompEng Mar 31 '14 at 09:03
  • Ok, well you need to provide all your code for anyone to help you any further. – Lunar Mar 31 '14 at 10:09
  • thanks for answer , and you think this error occurs because of my code? – CompEng Mar 31 '14 at 16:44
  • It possible that something you are doing is causing an issue in the native code, could be passing a null value down. – Lunar Apr 01 '14 at 08:30
  • 2
    This advice "**if you turn off filtering in your log cat, you will see the entire stack trace.**" saved me. – MDrabic Oct 15 '14 at 17:51
4

Most likely a threading problem... I once ran in a Fatal Signal 11 as well, when I was doing stuff on the wrong thread...

Probably the setVideoLayout()-call in you onConfigurationChanged() implementation.

Would be helpful tho, if you could post some more code...

Harshit Rathi
  • 1,862
  • 2
  • 18
  • 25
Sambuca
  • 1,224
  • 18
  • 30
  • 1
    Could you expand on that? I'm trying to debug this SIGSEGV on someone else's code. No idea which part of the code is at fault though. – Andrew Wyld Mar 13 '13 at 12:14
0

I had the same problem using samsung galaxy tab 2 loading any WiX website getting:

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

and exiting the whole application.

Researching more, I found a post talking about a ROM BUG. So, I plug a phone and F11 (eclipse) to compile the same code. And... It's is working! I'm still getting the error in my tablet.

TABLET: Samsung Galaxy Tabg 2 GT-P5100 ANDROID 4.0.3 KERNEL 3.0.8

PHONE: Samsung Galaxy Young DUOS (old but firmware updated) GT-S6102B ANDROID 4.4.2 KERNEL 2.6.35.7

Work in my phone, but crashes on tablet when I load any website made with WiX tool.

good information here: google+ link

0

I had a similar problem when finishing my activity with two TextureViews (i.e. pressing the home button):

Fatal signal 11 (SIGSEGV), code 1, fault addr 0xa4680000 in tid 29013 (pool-4-thread-1)

The logcat showed that the segv showed up inside a drawXXX function. So I tried to not draw when the surface is destroyed:

private synchronized void doDraw(Canvas canvas) {
...
}

doDraw() is called regularly by a background thread. To be precise, using a ScheduledExecutorService. This thingy is stopped in the destroyed listener, which also got the synchronized keyword:

public synchronized boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
    executorService.shutdownNow();
    return true;
}

This guarantees that the surface can only be destroyed when currently nothing is drawn.

No more crashes on leaving the activity now!

It seems to me that nobody is using TextureViews but still SurfaceViews. Unfortunately, the latter has some problems when drawing translucent graphics on some devices, that's why I switched to TextureView.

Hope this helps.

Uwe Post
  • 518
  • 4
  • 10