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

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 20217 #12

Open
JeanChristophePal opened this issue Jun 23, 2016 · 33 comments

Comments

@JeanChristophePal
Copy link

I got a Fatal error with the attached pdf, do you know why?

pdfSample.pdf

@barteksc
Copy link
Collaborator

Please attach output from logcat, I will be able to analyze it

@JeanChristophePal
Copy link
Author

The pdfView become blank, the logcat is solely:
" A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 20626"

After few second the app crash.

@Miha-x64
Copy link
Contributor

Miha-x64 commented Jun 24, 2016

I'm getting this sort of crash (and seldom SIGBUS or just UI freeze and SIGABRT) only if I'm trying to display two PDF files simultaneously.
(Unfortunately, I've got pages in separate files and forced to create a ViewPager populated with PDFViews)
I've made some locks that force PDFViews to work in series, but it works not so good.

Some fatal signals:
A/libc: Fatal signal 6 (SIGABRT) at 0x000001f6 (code=0), thread 14050 (*my package name without first letter*)

A/libc: Fatal signal 11 (SIGSEGV) at 0x00000002 (code=1), thread 14285 (*my package name without first letter*)

A/libc: Fatal signal 11 (SIGSEGV), thread 14563 (AsyncTask #1)
A/libc: Fatal signal 11 (SIGSEGV) at 0x00000002 (code=1), thread 14539 (*my package name without first letter*)

A/libc: Fatal signal 11 (SIGSEGV) at 0x00000007 (code=1), thread 25761 (*same*)

Addresses differ and may be 0xffffffff, 0x00000000, and others.

@hashtaag-vinay-sasalatti

hey @Miha-x64 i am doing the same functionality as you and getting a similar issue

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffffffc0 in tid 4027 (AsyncTask #2)

                                                       [ 06-24 17:37:03.683   304:  304 W/         ]
                                                       handle_request(10) debug_value = false;


                                                       [ 06-24 17:37:03.733   304:  304 W/         ]
                                                       wait_for_sigstope = 19

@barteksc any help would be very helpful

Thanks ;)

@niekvse
Copy link

niekvse commented Jun 24, 2016

Similar problem here, this occasionally happens, seemingly randomly:

06-24 17:01:41.521 15568-15568/com.xxxx.android.beta D/PdfViewActivity: Showing pdf file: /data/data/com.xxxx.android.beta/app_xxxx/Temp/pdfs/temp_pdf-1466780501469.pdf, size: 113509
06-24 17:01:41.521 15568-15721/com.xxxx.android.beta D/jniPdfium: Init FPDF library
06-24 17:01:41.581 15568-15721/com.xxxx.android.beta E/libc: mmap fail (pid 15568, tid 15721, size 113509, flags 0x2, errno 9(Bad file number))
06-24 17:01:41.581 15568-15721/com.xxxx.android.beta D/jniPdfium: File Size: 113509
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: Chrome build fingerprint:
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: 1.2.3
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: 7d26c012-4f20-450a-b207-c04dc7980276
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffffffff in tid 15721 (AsyncTask #4)
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/libc: Security Level: (1), Debug inforamtion is controlled by the DUMPABLE flag.

@barteksc
Copy link
Collaborator

@Miha-x64 @hashtaag-vinay-sasalatti I know the reason of problem when using few PDFViews simultaneously, but it will be hard to fix.
AndroidPdfViewer uses PdfiumAndroid library which is custom compilation of Pdfium library for Android. Android Lollipop introduced PdfRenderer, which also uses Pdfium. If you are running AndroidPdfViewer on Lollipop and higher, its Pdfium library is replaced by built-in version of Pdfium. And there is no way to override system version of Pdfium. Probable solution is to compile Pdfium with different SONAME, but I'am not an expert in native code.

@hashtaag-vinay-sasalatti

@barteksc thanks for the library and the reply ,
i was just wondering and wanted to ask your input's for problem that i am facing here , please oblige ;P

i have 20 single pdfs which are download one by one from server , so i need to show these 20 files as they are downloaded one below the other , so my solution was i used JoanZapata/android-pdfview in a view pager for 20 items , so it did not have any crash but there was too much of rendering time required so i dropped the approach and tried this lib instead in view pager and its crashing so now i am in a mess ;P

just want to ask , if i can supply multiple pdfs to the pdfview so it shows them one below other , or can u help me with what view i need to use from the lib to render only one pdf in a recycler view or list view item :)

if not possible can u lead me to any approach where i can find a solution for this problem because i am unable to find help anywhere from more than a month .

any help will be appreciated @barteksc @JeanChristophePalyart @Miha-x64 @niekvse

Thanks
Vinay

@Miha-x64
Copy link
Contributor

@barteksc, so, now we've got two problems — Segmentation Violation and SONAME that clashes with the system one?

@barteksc
Copy link
Collaborator

@Miha-x64 If you use Pdfium provided by PdfiumAndroid, few PDFViews can be used without problems, so there is only issue with SONAME.

@Miha-x64
Copy link
Contributor

Miha-x64 commented Jun 27, 2016

@barteksc, I'm getting

A/libc: Fatal signal 11 (SIGSEGV) at 0x00000007 (code=1), thread 16454 (*package*)

in my own SurfaceView with this dirty method:

public synchronized void fromFile(File file) {
    try {
        FileDescriptor fd = new FileInputStream(file).getFD();
        if (!fd.valid()) {
            Log.e("PdfView", "FileDescriptor is invalid.");
            return;
        }
        PdfDocument doc = pdfiumCore.newDocument(fd);
        Surface sur = getHolder().getSurface();
        if (sur == null) {
            Log.e("PdfView", "Surface is null");
            return;
        }
        pdfiumCore.openPage(doc, 0);
        pdfiumCore.renderPage(doc, sur, 0, 0, 0, getWidth(), getHeight()); // here
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

on KitKat.
On not-first app run I see

D/dalvikvm: Shared lib '/data/app-lib/*my-package*-1/libpdfium.so' already loaded in same CL 0x42009318
D/dalvikvm: Shared lib '/data/app-lib/*my-package*-1/libjniPdfium.so' already loaded in same CL 0x42009318

in logs, but on first run I don't, so your libraries are getting loaded.

@macjay
Copy link

macjay commented Jun 27, 2016

I have got the same crash Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffffffffffffff in tid 1327 (AsyncTask #3)
and i dont know how to fix it

@barteksc
Copy link
Collaborator

@Miha-x64 @hashtaag-vinay-sasalatti Please check version 1.1.2, it fixes using multiple PDFViews at the same time.
@JeanChristophePalyart @niekvse @macjay Please check version 1.1.2, it should help

@hashtaag-vinay-sasalatti

@barteksc Thanks for that , i will check and update you asap

Thanks ,
Vinay

@JeanChristophePal
Copy link
Author

@barteksc I changed to version 1.1.2 and I still have problem with the this particular file. With others pdf files it ok.

(I'm testing on Elephone P60000 Pro Android 5.1, AP22)

@barteksc
Copy link
Collaborator

@JeanChristophePalyart Unfortunately I cannot reproduce this issue on any of my three devices (4.0.3, 4.2.1 and 5.0.1), documents opens without any problem. Could you try opening this file using built-in PdfRenderer (https://developer.android.com/reference/android/graphics/pdf/PdfRenderer.html)? There is also simple example available https://github.com/googlesamples/android-PdfRendererBasic

@macjay
Copy link

macjay commented Jun 28, 2016

@barteksc Thank you .I have update to 1.1.2,there is no problem in my nexus 5,but still have the problem in 魅蓝note2

@barteksc
Copy link
Collaborator

@macjay So, now we have serious problem. I cannot reproduce and therefore debug this issue. Please check if my previous post (with PdfRenderer) works for you

@Miha-x64
Copy link
Contributor

@barteksc, thank you for your fix.
As it turns out, some sequences of PDFs work great and some are not.
They both have format version 1.6, but ones with the 'Author' field set to 'InDesign CS6 (Windows)' giving crash on Asus Nexus 5 (2012) 'grouper' (API 21). And all of them giving crash on my HTC Evo 3D 'shooteru' (API 19).

@barteksc
Copy link
Collaborator

@Miha-x64 Not good. It looks like pdfium itself may have some strange bugs...

@hashtaag-vinay-sasalatti

@barteksc Thanks for the new update it fixed my issues, good going ;P

Cheers
Vinay

@barteksc
Copy link
Collaborator

@hashtaag-vinay-sasalatti Yay, finally it works for someone ;)

@hashtaag-vinay-sasalatti

yes it worked for me and m one happy guy now , haha ;P

hey @barteksc i have observed one problem now (just want to improve) OnLoadCompleteListener is not giving me a correct callback after load complete (OR) maybe its displaying a white blank screen before the pdf is drawn , now here i need some inputs please

and one more thing is since i have 20 views in view pager and when i scroll back from 3rd to 1st position, again the pdf loads with a blink , how can i change it such that its already there ..

if any updates on my query please hit me back , but btw thats one awesome lib there .

Cheers ,
Vinay

@barteksc
Copy link
Collaborator

@hashtaag-vinay-sasalatti OnLoadCompleteListener is called after PDF file is loaded and ready to render on view, so you see white page for a while.
ViewPager adapter keeps 3 instances of pages - visible page, page to the left and page to the right. When you slide to next page, old left page is destroyed and new page to the right is instantiated. Keeping all 20 PDFViews in memory would quickly throw OutOfMemoryError exception. Thanks to the adapter behavior, you only keep 3 instances and when you scroll from 3rd to 1st page PDFView is loading and rendering document.

@hashtaag-vinay-sasalatti

@barteksc Ok thanks
but some times pdf won't load even after waiting for long time , this is my method below it is inside fragment item of view pager

private void showPdf(String filePath) {

        File PDF = new File(filePath);

        photoView.recycle();

        photoView.fromFile(PDF)
                .pages(0)
                .defaultPage(1)
                .showMinimap(false)
                .swipeVertical(false)
                .enableSwipe(false)
                .onDraw(new OnDrawListener() {
                    @Override
                    public void onLayerDrawn(Canvas canvas, float pageWidth, float pageHeight, int displayedPage) {

                    }
                })
                .onLoad(new OnLoadCompleteListener() {
                    @Override
                    public void loadComplete(int nbPages) {
                        progressBar.setVisibility(View.GONE);
                    }
                })
                .onPageChange(new OnPageChangeListener() {
                    @Override
                    public void onPageChanged(int page, int pageCount) {

                    }
                })
                .load();
    }

it won't load pdf sometimes , am i using it wrong ? sorry m troubling u many times :)

@JeanChristophePal
Copy link
Author

JeanChristophePal commented Jul 1, 2016

@barteksc The document attached to my first post works with pdf Renderer. Therefor this one his limited to Lollipop.

To open "pdfSample.pdf" I'm doing

                    pdfView.fromFile(pdfFile)
                            .defaultPage(1)
                            .showMinimap(false)
                            .enableSwipe(true)
                            .onLoad(this)
                            .onPageChange(this)
                            .onError(new OnErrorListener() {
                                @Override
                                public void onError(Throwable t) {
                                    t.printStackTrace();
                                }
                            })
                            .load();

EDIT:
It's working on Android 4.2.2, 4.4.2, 6.0.1

EDIT 2:
Tried also on another mobile with Android 5.1 (Samsumg) and works. Finally only the Elephone crash on this particular file...

@Miha-x64
Copy link
Contributor

@barteksc, with new version of the library there is no crash anymore. Thank you! :) 👍

@FAReact
Copy link

FAReact commented Oct 14, 2017

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x94 in tid 11169 (package_name)

                                                     [ 10-14 06:59:26.001  1254: 1254 W/         ]
                                                     debuggerd: handling request: pid=11169 uid=10274 gid=10274 tid=11169

How can I fix it? Help I try to find answer on the Internent but I didn't find. Help me to fix this problem, it is on Android studio

@1stmetro
Copy link

Trace your steps back....

@1stmetro
Copy link

Sounds like a fragment issue....

@pritamsnkadiya
Copy link

07-31 01:08:32.486 28994-28994/io.indoorlocation.navisens.demoapp A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 28994 (avisens.demoapp)

@SergeyBurlaka
Copy link

Check last version guys. It fixed!

@pritamsnkadiya
Copy link

#SergeyBurlaka, thank you so much for your reply but it's not fixed
error is !
screenshot from 2018-08-10 18-19-37

@elerot
Copy link

elerot commented Aug 29, 2018

Did you check manifest file

android:hardwareAccelerated="false"

it should be true to fix

android:hardwareAccelerated="true"

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