You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Andreas Argirakis <an...@maindialog.se> on 2015/03/19 17:01:09 UTC

bug: fop crashes when using float and span="all"

Hi.

Using fop nightly 20150319 on Windows 7.

Attached are three .fo files showing that a combination of using 
fo:float and fo:block span="all" will sometimes crash fop.

The file two-columns-with-float-and-two-blocks-and-span.fo will crash 
fop with the following stack trace:

SEVERE: Exception
org.apache.fop.apps.FOPException
java.lang.NullPointerException
         at 
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:288)
         at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
         at org.apache.fop.cli.Main.startFOP(Main.java:186)
         at org.apache.fop.cli.Main.main(Main.java:217)
Caused by: java.lang.NullPointerException
         at 
org.apache.fop.layoutmgr.PageBreaker.redoLayout(PageBreaker.java:420)
         at 
org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:329)
         at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:427)
         at 
org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)
         at
<snip>

If one block is removed as in the file 
two-columns-with-float-and-one-block-and-span.fo a pdf can be produced, 
however one block will not show up and the two-column block will be cut.

If the fo:float is removed as in two-columns-with-span.fo the resulting 
outcome is as expected.

Attached are minimal .fo files and pdfs.

Best regards,
Andreas Argirakis

Andreas Argirakis
Tel +46 31 15 04 90
Mob +46 733 41 44 26
Fax +46 31 15 04 09
andreas.argirakis@maindialog.se

Main Dialog AB
Västra Hamngatan 12
SE-411 17 Göteborg
www.maindialog.s

Re: bug: fop crashes when using float and span="all"

Posted by Andreas Argirakis <an...@maindialog.se>.
OK, thanks for your reply. I've created a bug in Jira at 
https://issues.apache.org/jira/browse/FOP-2458

Best regards,
Andreas Argirakis

On 2015-03-19 23:22, Luis Bernardo wrote:
>
> Please create a bug in Jira. I think that span, like float does, may 
> trigger a restart of the layout engine and the two restarts are not 
> playing well together...
>
> On 3/19/15 5:01 PM, Andreas Argirakis wrote:
>> Hi.
>>
>> Using fop nightly 20150319 on Windows 7.
>>
>> Attached are three .fo files showing that a combination of using 
>> fo:float and fo:block span="all" will sometimes crash fop.
>>
>> The file two-columns-with-float-and-two-blocks-and-span.fo will crash 
>> fop with the following stack trace:
>>
>> SEVERE: Exception
>> org.apache.fop.apps.FOPException
>> java.lang.NullPointerException
>>         at 
>> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:288)
>>         at 
>> org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
>>         at org.apache.fop.cli.Main.startFOP(Main.java:186)
>>         at org.apache.fop.cli.Main.main(Main.java:217)
>> Caused by: java.lang.NullPointerException
>>         at 
>> org.apache.fop.layoutmgr.PageBreaker.redoLayout(PageBreaker.java:420)
>>         at 
>> org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:329)
>>         at 
>> org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:427)
>>         at 
>> org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)
>>         at
>> <snip>
>>
>> If one block is removed as in the file 
>> two-columns-with-float-and-one-block-and-span.fo a pdf can be 
>> produced, however one block will not show up and the two-column block 
>> will be cut.
>>
>> If the fo:float is removed as in two-columns-with-span.fo the 
>> resulting outcome is as expected.
>>
>> Attached are minimal .fo files and pdfs.
>>
>> Best regards,
>> Andreas Argirakis
>>
>> Andreas Argirakis
>> Tel +46 31 15 04 90
>> Mob +46 733 41 44 26
>> Fax +46 31 15 04 09
>> andreas.argirakis@maindialog.se
>>
>> Main Dialog AB
>> Västra Hamngatan 12
>> SE-411 17 Göteborg
>> www.maindialog.s
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail:fop-users-help@xmlgraphics.apache.org
>


-- 


Andreas Argirakis
Tel +46 31 15 04 90
Mob +46 733 41 44 26
Fax +46 31 15 04 09
andreas.argirakis@maindialog.se

Main Dialog AB
Västra Hamngatan 12
SE-411 17 Göteborg
www.maindialog.se


This e-mail and the information it contains may be privileged and/or 
confidential. It is intended solely for the use of the named 
recipient(s). If you are not the intended recipient you may not 
disclose, copy, distribute or retain any part of this message or 
attachments. If you have received this e-mail in error please notify the 
sender immediately [by clicking 'Reply'] and delete this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: bug: fop crashes when using float and span="all"

Posted by Luis Bernardo <lm...@gmail.com>.
Please create a bug in Jira. I think that span, like float does, may 
trigger a restart of the layout engine and the two restarts are not 
playing well together...

On 3/19/15 5:01 PM, Andreas Argirakis wrote:
> Hi.
>
> Using fop nightly 20150319 on Windows 7.
>
> Attached are three .fo files showing that a combination of using 
> fo:float and fo:block span="all" will sometimes crash fop.
>
> The file two-columns-with-float-and-two-blocks-and-span.fo will crash 
> fop with the following stack trace:
>
> SEVERE: Exception
> org.apache.fop.apps.FOPException
> java.lang.NullPointerException
>         at 
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:288)
>         at 
> org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
>         at org.apache.fop.cli.Main.startFOP(Main.java:186)
>         at org.apache.fop.cli.Main.main(Main.java:217)
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.fop.layoutmgr.PageBreaker.redoLayout(PageBreaker.java:420)
>         at 
> org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:329)
>         at 
> org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:427)
>         at 
> org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)
>         at
> <snip>
>
> If one block is removed as in the file 
> two-columns-with-float-and-one-block-and-span.fo a pdf can be 
> produced, however one block will not show up and the two-column block 
> will be cut.
>
> If the fo:float is removed as in two-columns-with-span.fo the 
> resulting outcome is as expected.
>
> Attached are minimal .fo files and pdfs.
>
> Best regards,
> Andreas Argirakis
>
> Andreas Argirakis
> Tel +46 31 15 04 90
> Mob +46 733 41 44 26
> Fax +46 31 15 04 09
> andreas.argirakis@maindialog.se
>
> Main Dialog AB
> Västra Hamngatan 12
> SE-411 17 Göteborg
> www.maindialog.s
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: bug: fop crashes when using float and span="all"

Posted by Robert Meyer <rm...@hotmail.co.uk>.
Hi,
It seems the source of the NPE is a debug line:
        AbstractBreaker.log.debug("restart: optimalPageCount= " + optimalPageCount                + " pageBreaks.size()= " + algRestart.getPageBreaks().size());
The algRestart.getPageBreaks() is null here causing the issue. When I comment out the line it seems to render the document without further issue. However, the output was not what I imagine you were expecting. I've attached two PDF's with and without the span using the float. 
I am not sure if having multiple columns with a float is a corner case in which unexpected results occur but as can be seen in the output without the span (and obscured with the span), everything is placed in the first column.
Luis would be better at answering this than me if he hasn't moved to greener pastures ;-) I'll take another look in a day or two if I get a chance.
Regards,
Robert Meyer
Date: Thu, 19 Mar 2015 17:01:09 +0100
From: andreas.argirakis@maindialog.se
To: fop-users@xmlgraphics.apache.org
Subject: bug: fop crashes when using float and span="all"

Hi.
 
Using fop nightly 20150319 on Windows 7.
 
Attached are three .fo files showing that a combination of using 
fo:float and fo:block span="all" will sometimes crash fop.
 
The file two-columns-with-float-and-two-blocks-and-span.fo will crash 
fop with the following stack trace:
 
SEVERE: Exception
org.apache.fop.apps.FOPException
java.lang.NullPointerException
         at 
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:288)
         at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
         at org.apache.fop.cli.Main.startFOP(Main.java:186)
         at org.apache.fop.cli.Main.main(Main.java:217)
Caused by: java.lang.NullPointerException
         at 
org.apache.fop.layoutmgr.PageBreaker.redoLayout(PageBreaker.java:420)
         at 
org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:329)
         at 
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:427)
         at 
org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:112)
         at
<snip>
 
If one block is removed as in the file 
two-columns-with-float-and-one-block-and-span.fo a pdf can be produced, 
however one block will not show up and the two-column block will be cut.
 
If the fo:float is removed as in two-columns-with-span.fo the resulting 
outcome is as expected.
 
Attached are minimal .fo files and pdfs.
 
Best regards,
Andreas Argirakis
 
Andreas Argirakis
Tel +46 31 15 04 90
Mob +46 733 41 44 26
Fax +46 31 15 04 09
andreas.argirakis@maindialog.se
 
Main Dialog AB
V�stra Hamngatan 12
SE-411 17 G�teborg
www.maindialog.s

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org