Ivy
  1. Ivy
  2. IVY-1253

ivy.xml that contains UTF-8 encoded umlauts cannot be bigger than 10000 bytes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0-RC1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Debian Testing
      java version "1.6.0_18"
      OpenJDK Runtime Environment (IcedTea6 1.8.2) (6b18-1.8.2-3)
      OpenJDK Client VM (build 16.0-b13, mixed mode, sharing)

      Description

      When an ivy.xml contains a <conf> with a description, and that description includes a non-ASCII character (or at least an 'ä'), the
      ivy.xml must not be bigger than exactly 10000 Bytes. When the file is even one byte bigger, the following exception is thrown:

      $ java -jar /usr/share/ant/lib/ivy-2.1.0.jar -verbose -confs core
      :: loading settings :: url = jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
      no default ivy user dir defined: set to /home/dennis/.ivy2
      including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml
      no default cache defined: set to /home/dennis/.ivy2/cache
      including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml
      including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml
      including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml
      including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
      settings loaded (141ms)
      default cache: /home/dennis/.ivy2/cache
      default resolver: default
      – 5 resolvers:
      shared [file]
      default [chain] [local, main]
      local [file]
      public [ibiblio]
      main [chain] [shared, public]
      using ivy parser to parse file:/tmp/ivy.xml
      :: resolving dependencies :: test#test;working@thinky
      confs: [core]
      validate = true
      refresh = false
      resolving dependencies for configuration 'core'
      == resolving dependencies for test#test;working@thinky [core]
      Exception in thread "main" java.io.IOException: Resetting to invalid mark
      at java.io.BufferedInputStream.reset(BufferedInputStream.java:433)
      at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:743)
      at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:139)
      at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.toIvyFile(XmlModuleDescriptorParser.java:143)
      at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.toIvyFile(DefaultModuleDescriptor.java:527)
      at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:246)
      at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:193)
      at org.apache.ivy.Ivy.resolve(Ivy.java:502)
      at org.apache.ivy.Main.run(Main.java:270)
      at org.apache.ivy.Main.main(Main.java:179)

      This happens with both 2.1.0 and 2.2.0, haven't tried 2.0 so far.

      I've attached the test file. As already stated, either removing the "ä" from "testä" or making the file 10000 bytes or less gets rid of the problem.
      It seems like even an Umlaut in a comment leads to this problem. Just adding one byte in front of the umlaut (to see if a streaming reader
      unintentionally split the utf-8 byte) does not seem to help either.

      1. ivy.xml
        10 kB
        Dennis Brakhane

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          15d 6h 48m 1 Maarten Coene 21/Dec/10 22:51
          Resolved Resolved Closed Closed
          15h 19m 1 Dennis Brakhane 22/Dec/10 14:10
          Maarten Coene made changes -
          Link This issue is duplicated by IVY-1289 [ IVY-1289 ]
          Hide
          Dennis Brakhane added a comment -

          Yes, the alternative fix does also work.

          Show
          Dennis Brakhane added a comment - Yes, the alternative fix does also work.
          Hide
          Maarten Coene added a comment -

          Thanks for giving it a try. Unfortunately, I had to revert my patch because it caused other problems.
          But I was able to fix it another way, could you give it a try again to check if your problem is still solved with current trunk version?

          thanks,
          Maarten

          Show
          Maarten Coene added a comment - Thanks for giving it a try. Unfortunately, I had to revert my patch because it caused other problems. But I was able to fix it another way, could you give it a try again to check if your problem is still solved with current trunk version? thanks, Maarten
          Dennis Brakhane made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Dennis Brakhane added a comment -

          I've check the latest SVN with the original file and it works flawlessly. Thanks for the quick fix.

          Show
          Dennis Brakhane added a comment - I've check the latest SVN with the original file and it works flawlessly. Thanks for the quick fix.
          Maarten Coene made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Maarten Coene [ maartenc ]
          Fix Version/s trunk [ 12313426 ]
          Resolution Fixed [ 1 ]
          Hide
          Maarten Coene added a comment -

          I've committed a patch in SVN trunk that hopefully will fix the problem.
          Could you give it a try and post your feedback here?

          thanks,
          Maarten

          Show
          Maarten Coene added a comment - I've committed a patch in SVN trunk that hopefully will fix the problem. Could you give it a try and post your feedback here? thanks, Maarten
          Dennis Brakhane made changes -
          Summary ivy.xml that contains UTF-8 encoded umlauts in conf description cannot be bigger than 10000 bytes ivy.xml that contains UTF-8 encoded umlauts cannot be bigger than 10000 bytes
          Description When an ivy.xml contains a <conf> with a description, and that description includes a non-ASCII character (or at least an 'ä'), the
          ivy.xml must not be bigger than exactly 10000 Bytes. When the file is even one byte bigger, the following exception is thrown:

          $ java -jar /usr/share/ant/lib/ivy-2.1.0.jar -verbose -confs core
          :: loading settings :: url = jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
          no default ivy user dir defined: set to /home/dennis/.ivy2
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml
          no default cache defined: set to /home/dennis/.ivy2/cache
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
          settings loaded (141ms)
          default cache: /home/dennis/.ivy2/cache
          default resolver: default
          -- 5 resolvers:
          shared [file]
          default [chain] [local, main]
          local [file]
          public [ibiblio]
          main [chain] [shared, public]
          using ivy parser to parse file:/tmp/ivy.xml
          :: resolving dependencies :: test#test;working@thinky
          confs: [core]
          validate = true
          refresh = false
          resolving dependencies for configuration 'core'
          == resolving dependencies for test#test;working@thinky [core]
          Exception in thread "main" java.io.IOException: Resetting to invalid mark
          at java.io.BufferedInputStream.reset(BufferedInputStream.java:433)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:743)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:139)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.toIvyFile(XmlModuleDescriptorParser.java:143)
          at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.toIvyFile(DefaultModuleDescriptor.java:527)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:246)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:193)
          at org.apache.ivy.Ivy.resolve(Ivy.java:502)
          at org.apache.ivy.Main.run(Main.java:270)
          at org.apache.ivy.Main.main(Main.java:179)

          This happens with both 2.1.0 and 2.2.0, haven't tried 2.0 so far.

          I've attached the test file. As already stated, either removing the "ä" from "testä" or making the file 10000 bytes or less gets rid of the problem.
          When an ivy.xml contains a <conf> with a description, and that description includes a non-ASCII character (or at least an 'ä'), the
          ivy.xml must not be bigger than exactly 10000 Bytes. When the file is even one byte bigger, the following exception is thrown:

          $ java -jar /usr/share/ant/lib/ivy-2.1.0.jar -verbose -confs core
          :: loading settings :: url = jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
          no default ivy user dir defined: set to /home/dennis/.ivy2
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml
          no default cache defined: set to /home/dennis/.ivy2/cache
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
          settings loaded (141ms)
          default cache: /home/dennis/.ivy2/cache
          default resolver: default
          -- 5 resolvers:
          shared [file]
          default [chain] [local, main]
          local [file]
          public [ibiblio]
          main [chain] [shared, public]
          using ivy parser to parse file:/tmp/ivy.xml
          :: resolving dependencies :: test#test;working@thinky
          confs: [core]
          validate = true
          refresh = false
          resolving dependencies for configuration 'core'
          == resolving dependencies for test#test;working@thinky [core]
          Exception in thread "main" java.io.IOException: Resetting to invalid mark
          at java.io.BufferedInputStream.reset(BufferedInputStream.java:433)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:743)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:139)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.toIvyFile(XmlModuleDescriptorParser.java:143)
          at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.toIvyFile(DefaultModuleDescriptor.java:527)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:246)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:193)
          at org.apache.ivy.Ivy.resolve(Ivy.java:502)
          at org.apache.ivy.Main.run(Main.java:270)
          at org.apache.ivy.Main.main(Main.java:179)

          This happens with both 2.1.0 and 2.2.0, haven't tried 2.0 so far.

          I've attached the test file. As already stated, either removing the "ä" from "testä" or making the file 10000 bytes or less gets rid of the problem.
          It seems like even an Umlaut in a comment leads to this problem. Just adding one byte in front of the umlaut (to see if a streaming reader
          unintentionally split the utf-8 byte) does not seem to help either.
          Dennis Brakhane made changes -
          Description When an ivy.xml contains a <conf> with a description, and that description includes a non-ASCII character (or at least an 'ä'), the
          ivy.xml must not be bigger than exactly 10000 Bytes. When the file is even one byte bigger, the following exception is thrown:

          $ java -jar /usr/share/ant/lib/ivy-2.1.0.jar -verbose -confs core
          :: loading settings :: url = jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
          no default ivy user dir defined: set to /home/dennis/.ivy2
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml
          no default cache defined: set to /home/dennis/.ivy2/cache
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
          settings loaded (141ms)
          default cache: /home/dennis/.ivy2/cache
          default resolver: default
          -- 5 resolvers:
          shared [file]
          default [chain] [local, main]
          local [file]
          public [ibiblio]
          main [chain] [shared, public]
          using ivy parser to parse file:/tmp/ivy.xml
          :: resolving dependencies :: test#test;working@thinky
          confs: [core]
          validate = true
          refresh = false
          resolving dependencies for configuration 'core'
          == resolving dependencies for test#test;working@thinky [core]
          Exception in thread "main" java.io.IOException: Resetting to invalid mark
          at java.io.BufferedInputStream.reset(BufferedInputStream.java:433)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:743)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:139)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.toIvyFile(XmlModuleDescriptorParser.java:143)
          at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.toIvyFile(DefaultModuleDescriptor.java:527)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:246)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:193)
          at org.apache.ivy.Ivy.resolve(Ivy.java:502)
          at org.apache.ivy.Main.run(Main.java:270)
          at org.apache.ivy.Main.main(Main.java:179)

          This happens with both 2.1.0 and 2.2.0, haven't tried 2.0 so far.
          I would attach the test file, but it seems I can't do this, I'll just paste a shortened version here:

          <?xml version="1.0" encoding="utf-8"?>
          <ivy-module version="2.0"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:noNamespaceSchemaLocation=
                             "http://ant.apache.org/ivy/schemas/ivy.xsd">
                  <info organisation="test" module="test"/>

              <configurations>

                      <conf name="core" description="testä"/>

              </configurations>

                  <dependencies>
                      

          <!-- just add enough bytes to make this file 10KB..-->
          <!-- ...................................................................... -->
                </dependencies>
          </ivy-module>

          As already stated, either removing the "ä" from "testä" or making the file 10000 bytes or less gets rid of the problem.
          When an ivy.xml contains a <conf> with a description, and that description includes a non-ASCII character (or at least an 'ä'), the
          ivy.xml must not be bigger than exactly 10000 Bytes. When the file is even one byte bigger, the following exception is thrown:

          $ java -jar /usr/share/ant/lib/ivy-2.1.0.jar -verbose -confs core
          :: loading settings :: url = jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
          no default ivy user dir defined: set to /home/dennis/.ivy2
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml
          no default cache defined: set to /home/dennis/.ivy2/cache
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml
          including url: jar:file:/usr/share/java/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
          settings loaded (141ms)
          default cache: /home/dennis/.ivy2/cache
          default resolver: default
          -- 5 resolvers:
          shared [file]
          default [chain] [local, main]
          local [file]
          public [ibiblio]
          main [chain] [shared, public]
          using ivy parser to parse file:/tmp/ivy.xml
          :: resolving dependencies :: test#test;working@thinky
          confs: [core]
          validate = true
          refresh = false
          resolving dependencies for configuration 'core'
          == resolving dependencies for test#test;working@thinky [core]
          Exception in thread "main" java.io.IOException: Resetting to invalid mark
          at java.io.BufferedInputStream.reset(BufferedInputStream.java:433)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:743)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorUpdater.update(XmlModuleDescriptorUpdater.java:139)
          at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.toIvyFile(XmlModuleDescriptorParser.java:143)
          at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.toIvyFile(DefaultModuleDescriptor.java:527)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:246)
          at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:193)
          at org.apache.ivy.Ivy.resolve(Ivy.java:502)
          at org.apache.ivy.Main.run(Main.java:270)
          at org.apache.ivy.Main.main(Main.java:179)

          This happens with both 2.1.0 and 2.2.0, haven't tried 2.0 so far.

          I've attached the test file. As already stated, either removing the "ä" from "testä" or making the file 10000 bytes or less gets rid of the problem.
          Dennis Brakhane made changes -
          Field Original Value New Value
          Attachment ivy.xml [ 12465382 ]
          Hide
          Dennis Brakhane added a comment -

          FIle attached

          Show
          Dennis Brakhane added a comment - FIle attached
          Dennis Brakhane created issue -

            People

            • Assignee:
              Maarten Coene
              Reporter:
              Dennis Brakhane
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development