<div dir="ltr"><div><div><div>I have created a small project, uploaded to git@git.kde.org:scratch/jsolanki/TxtDocumentTest01<br><br></div>May be you'd like to have a look at it.<br></div>I have (extracted and) uploaded the file that made it crash the most, to data folder in that repo.<br>
<br></div>& It doesn't crash.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 25, 2013 at 11:48 PM, Jaydeep Solanki <span dir="ltr"><<a href="mailto:jaydp17@gmail.com" target="_blank">jaydp17@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Wed, Sep 25, 2013 at 11:40 PM, Albert Astals Cid <span dir="ltr"><<a href="mailto:aacid@kde.org" target="_blank">aacid@kde.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">El Dimecres, 25 de setembre de 2013, a les 23:19:11, Jaydeep Solanki va<br>
escriure:<br>
<div>> On Wed, Sep 25, 2013 at 11:01 PM, Jaydeep Solanki <<a href="mailto:jaydp17@gmail.com" target="_blank">jaydp17@gmail.com</a>> wrote:<br>
> > Running it under helgrind, gives<br>
</div>> > this<<a href="https://www.dropbox.com/s/5v3bh1v6le8adkr/helg.txt" target="_blank">https://www.dropbox.com/s/5v3bh1v6le8adkr/helg.txt</a>>output.<br>
> ><br>
> > It shows a warning near the region where we get a crash saying "*conflicts<br>
> > with a previous write of size 4 by thread #4*", L117 in helgrind output<br>
<div>> > file<br>
> ><br>
> > Also, can you please throw some light on what the warning is trying to<br>
> > say. What is a 'conflict on previous write' ?<br>
><br>
> I read the documentation and understood what it is, but it doesn't give any<br>
> insight about what's going wrong.<br>
><br>
> BTW, I tried a few times with helgrind & it didn't crash.<br>
<br>
</div>Yeah, it may go so slow that it doesn't really race/crash itself.<br>
<br>
I am betting on saying "this is a bug in Qt" but let's prove it first ;-)<br>
<br>
My suggestion, do this: Write a simple program that spawns two threads, in<br>
each thread you create a QTextDocument, add some text to it and then simply<br>
loop its rendering to a QImage forever.<br>
<br>
Let's see if that crashes or not. If not, we can build up from there trying to<br>
make it more like what Okular does until it crashes.<br>
<br>
You up to it?<br></blockquote></div><div>Yes <br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
  Albert<br>
<div><div><br>
><br>
> > On Mon, Sep 23, 2013 at 1:40 PM, Jaydeep Solanki <<a href="mailto:jaydp17@gmail.com" target="_blank">jaydp17@gmail.com</a>>wrote:<br>
> >> On Mon, Sep 23, 2013 at 3:17 AM, Albert Astals Cid <<a href="mailto:aacid@kde.org" target="_blank">aacid@kde.org</a>> wrote:<br>
> >>> El Dilluns, 23 de setembre de 2013, a les 02:05:23, Jaydeep Solanki va<br>
> >>><br>
> >>> escriure:<br>
> >>> > On Sun, Sep 22, 2013 at 9:21 PM, Albert Astals Cid <<a href="mailto:aacid@kde.org" target="_blank">aacid@kde.org</a>><br>
> >>><br>
> >>> wrote:<br>
> >>> > > El Dissabte, 21 de setembre de 2013, a les 23:16:56, Jaydeep Solanki<br>
> >>><br>
> >>> va<br>
> >>><br>
> >>> > > escriure:<br>
> >>> > > > On Sat, Sep 21, 2013 at 9:25 PM, Albert Astals Cid <<a href="mailto:aacid@kde.org" target="_blank">aacid@kde.org</a>><br>
> >>> > ><br>
> >>> > > wrote:<br>
> >>> > > > > El Dissabte, 21 de setembre de 2013, a les 14:50:50, Jaydeep<br>
> >>><br>
> >>> Solanki<br>
> >>><br>
> >>> > > > > va<br>
> >>> > > > ><br>
> >>> > > > > escriure:<br>
> >>> > > > > > Hi,<br>
> >>> > > > ><br>
> >>> > > > > Hi<br>
> >>> > > > ><br>
> >>> > > > > > @Albert,<br>
> >>> > > > > > Welcome back :)<br>
> >>> > > > ><br>
> >>> > > > > Thanks :-)<br>
> >>> > > > ><br>
> >>> > > > > > As you might be aware GSoC is coming to an end, I want to wrap<br>
> >>> > > > > > things<br>
> >>> > > > > > up.<br>
> >>> > > > > ><br>
> >>> > > > > > I have a few days, and I want to finish multi-threading<br>
> >>><br>
> >>> support for<br>
> >>><br>
> >>> > > > > > ePubs<br>
> >>> > > > > > before GSoC ends. I have created a patch, but it crashes<br>
> >>><br>
> >>> sometimes,<br>
> >>><br>
> >>> > > I'm<br>
> >>> > ><br>
> >>> > > > > > unable to find a reason to that.<br>
> >>> > > > ><br>
> >>> > > > > Where's the patch?<br>
> >>> > > ><br>
> >>> > > > Diff attached<br>
> >>> > > ><br>
> >>> > > > File to test on :<br>
> >>> > > > link<<br>
> >>><br>
> >>> <a href="https://www.dropbox.com/s/x63kkjf8q4h4fdy/Getting%20Gold%20by%20J_C_F_J" target="_blank">https://www.dropbox.com/s/x63kkjf8q4h4fdy/Getting%20Gold%20by%20J_C_F_J</a><br>
> >>><br>
> >>> > > > ohnson.epub><br>
> >>> > > ><br>
> >>> > > > > Do you have a backtrace of the crash?<br>
> >>> > > ><br>
> >>> > > > I have got two different backtraces, using the same ePub<br>
> >>> > > ><br>
> >>> > > > Backtrace 1 : <a href="http://paste.kde.org/p0b9a1e1e/" target="_blank">http://paste.kde.org/p0b9a1e1e/</a><br>
> >>> > > ><br>
> >>> > > > Backtrace 2 : <a href="http://paste.kde.org/pa4e31b12/" target="_blank">http://paste.kde.org/pa4e31b12/</a><br>
> >>> > ><br>
> >>> > > Any reason you have not installed debug symbols for Qt to get a<br>
> >>><br>
> >>> better<br>
> >>><br>
> >>> > > bracktrace (less ??)?<br>
> >>> ><br>
> >>> > Installed it.<br>
> >>> > still I'm not able to make any sense out of it.<br>
> >>> ><br>
> >>> > Updated backtrace :  <a href="http://paste.kde.org/pa8f27933/" target="_blank">http://paste.kde.org/pa8f27933/</a><br>
> >>><br>
> >>> How are you getting the backtrace?<br>
> >><br>
> >> I use Qt Creator, when it crashes I use create full backtrace option to<br>
> >> get this backtrace.<br>
> >> Further more using gdb + terminal I get<br>
</div></div>> >> this<<a href="http://paste.kde.org/p11fad1cf/" target="_blank">http://paste.kde.org/p11fad1cf/</a>>backtrace.<br>
<div><div>> >><br>
> >> Can you mark in which thread the crash is<br>
> >><br>
> >>> happening?<br>
> >><br>
> >> I get an ABORT signal when TextDocumentGeneratorPrivate::createTextPage(.<br>
> >> . .) is called inside core/textdocumentgenerator.cpp. Now inside that 99%<br>
> >> of the times I get a crash on L81 (my branch).<br>
> >><br>
> >>> Cheers,<br>
> >>><br>
> >>>   Albert<br>
> >>><br>
> >>> > > Cheers,<br>
> >>> > ><br>
> >>> > >   Albert<br>
> >>> > ><br>
> >>> > > > > What has changed<br>
> >>> > > > > since last time we tried to do this?<br>
> >>> > > ><br>
> >>> > > > I have noticed that it only crashes when the epub has an adequate<br>
> >>><br>
> >>> amount<br>
> >>><br>
> >>> > > of<br>
> >>> > ><br>
> >>> > > > images. Epubs with no images or 1 or 2 images are less likely to<br>
> >>><br>
> >>> crash.<br>
> >>><br>
> >>> > > The<br>
> >>> > ><br>
> >>> > > > more the images the more likely it is to crash.<br>
> >>> > > ><br>
> >>> > > > Now we don't have to guess if it will crash on this file or not.<br>
> >>> > > > Considering all this, I have given you an ePub that is most likely<br>
> >>><br>
> >>> to<br>
> >>><br>
> >>> > > crash<br>
> >>> > ><br>
> >>> > > > atleast once before completing a round trip (top to bottom &<br>
> >>><br>
> >>> bottom to<br>
> >>><br>
> >>> > > > top).<br>
> >>> > > ><br>
> >>> > > > > Cheers,<br>
> >>> > > > ><br>
> >>> > > > >   Albert<br>
> >>> > > > ><br>
> >>> > > > > > So, can we please help, me get this done.<br>
> >>> > > > > > It's the same bug that we once tried to fix on IRC.<br>
> >>> > > > > ><br>
> >>> > > > > > I'll be available on #okular, same time as usual.<br>
> >>> > > > > ><br>
> >>> > > > > > Cheers,<br>
> >>> > > > > > Jaydeep<br>
> >>> > > > ><br>
> >>> > > > > _______________________________________________<br>
> >>> > > > > Okular-devel mailing list<br>
> >>> > > > > <a href="mailto:Okular-devel@kde.org" target="_blank">Okular-devel@kde.org</a><br>
> >>> > > > > <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
> >>> > ><br>
> >>> > > _______________________________________________<br>
> >>> > > Okular-devel mailing list<br>
> >>> > > <a href="mailto:Okular-devel@kde.org" target="_blank">Okular-devel@kde.org</a><br>
> >>> > > <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
> >>><br>
> >>> _______________________________________________<br>
> >>> Okular-devel mailing list<br>
> >>> <a href="mailto:Okular-devel@kde.org" target="_blank">Okular-devel@kde.org</a><br>
> >>> <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
<br>
_______________________________________________<br>
Okular-devel mailing list<br>
<a href="mailto:Okular-devel@kde.org" target="_blank">Okular-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>