Segmentation Fault

140 views
Skip to first unread message

Siddharth Shah

unread,
Jan 14, 2015, 11:58:21 AM1/14/15
to pdfne...@googlegroups.com
Hello,
I am using PDFNet SDK. When I am trying to use FreeText annotation on PDF, my app is crashing sometimes, and I am not getting any stack trace. Just getting something like:
A/libc(4969): Fatal signal 11 (SIGSEGV)"

It crashes for like 4-5 times and after that it starts working. Any help?

Thanks :)

Siddharth

Ryan

unread,
Jan 14, 2015, 2:09:37 PM1/14/15
to pdfne...@googlegroups.com
You should call IsValid method on any annot before you call other methods on it. For example, a FreeText annot does not have to have a popup, so calling

free_text.GetPopUp().GetContent()

is dangerous.

instead call

popup = free_text.GetPopup()
if (popup.IsValid()) {
popup.GetContent();
}

Of course a SIGSEGV is bad, and we recently fixed an issue with this regards, but the fix is not yet available for mobile yet, so you need to use the logic above.

If this does not help, that is you get a crash after IsValid returns true, or something similar, please file a bug report, including the code you are calling, and ideally the PDF file for which the issue happens with.
https://www.pdftron.com/support/reportproblem.html

Siddharth Shah

unread,
Jan 15, 2015, 6:00:06 AM1/15/15
to pdfne...@googlegroups.com
Hey Ryan,
Thanks for the help. I fixed it..it also happens when we don't handle the locks properly when editing the annotations.
So, it's working cool.

Now, another problem that I am facing is with the converted pdfs (Which were like jpg/png, we converted them to pdf). The FreeText annotation is not getting placed.
But, for some images it was working. I am attaching two converted pdfs. Please let me know what difference you find while annotating FreeText. If both of them are working good for you, I will send you the code for a review, may be I am missing something.

Thanks :)

Regards, 
Siddharth 
This doesn't work.pdf
This works good.pdf

Ryan

unread,
Jan 15, 2015, 2:13:26 PM1/15/15
to pdfne...@googlegroups.com
What happens when you try to add the FreeText annotation in the original, unmodified, PDFViewCtrl or CompleteReader sample that came with the PDFNet SDK?

Assuming that is correct, then you need review your changes.

Note, that the page dimensions for the "This doesn't work" file is much larger then the other document. Perhaps in your changes you made some assumption about dimensions?
Reply all
Reply to author
Forward
0 new messages