[ 
https://jira.codehaus.org/browse/MNG-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=345459#comment-345459
 ] 
Christian Jung commented on MNG-5623:
-------------------------------------

Hi Michael,
thanks for the quick reply and the fix.
I usually do not build maven myself so it would be kind of extra work to try 
the patch for me.
I just wanted to tell you about what i found out, so it is not lost.
It should be easy to make a unit test, so you can close the issue yourself once 
the test passes.

Which will be the next release containing this patch?

Concerning the strange build times, I still have to investigate this, 
but this is maybe a different and more tricky issue.
All our builds are below one hour.

I remember measuring negative times (not with maven), 
when the start and end were determined on different processors. 
This happens especially when the system has been running for a long time.
This is probably true for our build machines, which are also virtual machines.

Maybe you know better how maven measures the times and if this could happen 
there as well.



> Exception when printing Reactor Summary
> ---------------------------------------
>
>                 Key: MNG-5623
>                 URL: https://jira.codehaus.org/browse/MNG-5623
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Logging
>    Affects Versions: 3.2.1
>            Reporter: Christian Jung
>            Assignee: Michael Osipov
>         Attachments: MNG-5626.patch
>
>
> We get the following exception in maven 3.2.1:
> {code}
> 17:14:29,313 INFO  - org.emftext.commons.antlr3_4_0 .................... 
> SUCCESS [ 13.624 s]
> 17:14:29,313 INFO  - acceleo-maven ..................................... 
> SUCCESS [ 0.811 s]
> 17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec ................... 
> SUCCESS [ 6.208 s]
> 17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.resource.dfspec ... 
> SUCCESS [ 9.181 s]
> 17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.generator ......... 
> SUCCESS [ 27.518 s]
> 17:14:29,313 INFO  - df7-java-generator ................................ 
> SUCCESS [ 12.459 s]
> 17:14:29,313 INFO  - df7-cpp-generator ................................. 
> SUCCESS [ 16.046 s]
> 17:14:29,313 INFO  - df7-wiki-generator ................................ 
> SUCCESS [ 8.318 s]
> 17:14:29,313 INFO  - dfutils ........................................... 
> SUCCESS [ 17.114 s]
> 17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.resource.dfspec.ui 
> SUCCESS [ 7.206 s]
> 17:14:29,313 INFO  - com.ptvgroup.geoplatform.dfspec.validation ........ 
> SUCCESS [ 10.988 s]
> 17:14:29,313 INFO  - df7-cpp-testgenerator ............................. 
> SUCCESS [01:11 min]
> 17:14:29,313 INFO  - df7-java-testgenerator ............................ 
> SUCCESS [01:10 min]
> 17:14:29,313 INFO  - df7-wiki-testgenerator ............................ 
> SUCCESS [ 10.267 s]
> 17:14:29,324 ERROR - Internal error: java.lang.NegativeArraySizeException -> 
> [Help 1]
> 17:14:29,327 ERROR - org.apache.maven.InternalErrorException: Internal error: 
> java.lang.NegativeArraySizeException
> 17:14:29,327 ERROR -     at 
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
> 17:14:29,327 ERROR -     at 
> org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
> 17:14:29,327 ERROR -     at 
> org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
> 17:14:29,327 ERROR -     at 
> org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
> 17:14:29,327 ERROR -     at 
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 17:14:29,327 ERROR -     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 17:14:29,327 ERROR -     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 17:14:29,327 ERROR -     at java.lang.reflect.Method.invoke(Method.java:606)
> 17:14:29,327 ERROR -     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
> 17:14:29,327 ERROR -     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
> 17:14:29,327 ERROR -     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
> 17:14:29,327 ERROR -     at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> 17:14:29,327 ERROR - Caused by: java.lang.NegativeArraySizeException
> 17:14:29,328 ERROR -     at 
> java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:64)
> 17:14:29,328 ERROR -     at 
> java.lang.StringBuilder.<init>(StringBuilder.java:97)
> 17:14:29,328 ERROR -     at 
> org.apache.maven.cli.event.ExecutionEventLogger.chars(ExecutionEventLogger.java:67)
> 17:14:29,328 ERROR -     at 
> org.apache.maven.cli.event.ExecutionEventLogger.logReactorSummary(ExecutionEventLogger.java:155)
> 17:14:29,328 ERROR -     at 
> org.apache.maven.cli.event.ExecutionEventLogger.sessionEnded(ExecutionEventLogger.java:111)
> 17:14:29,328 ERROR -     at 
> org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:64)
> 17:14:29,328 ERROR -     at 
> org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
> 17:14:29,329 ERROR -     at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:125)
> 17:14:29,329 ERROR -     at 
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
> 17:14:29,329 ERROR -     at 
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
> 17:14:29,329 ERROR -     ... 11 more
> 17:14:29,329 ERROR - 
> {code}
> It occurs not every build, but maybe every second or third.
> I downloaded the source tar.gz and found that indeed in line 155 of 
> ExecutionEventLogger.java we have 
> {code}
> 154:                String buildTimeDuration = formatDuration( 
> buildSummary.getTime() ); 
> 155:                buffer.append( chars( ' ', BUILD_TIME_DURATION_LENGTH - 
> buildTimeDuration.length() ) );
> {code}
> where
> {code}
> 47:    private static final int BUILD_TIME_DURATION_LENGTH = 9;
> {code}
> However, in {{formatDuration}}, from {{CLIReportingUtils.java}} , it seems 
> that the generated strings can well exceed this length:
> {code}
> 177:            format = "%d d %02d:%02d h";
> {code}
> This has, as far as I understand, at least 6 characters, if we add two for 
> minutes and minimum one for hour and one for day, this will already exceed 
> the BUILD_TIME:DURATION_LENGTH. This seems an obvious bug to me.
> However our build times are usually less than one hour, so there must be some 
> other reason for our strange long build time duration string.
> If the bug above was fixed, we could see better what's going on.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to