rjust / defects4j

A Database of Real Faults and an Experimental Infrastructure to Enable Controlled Experiments in Software Engineering Research
MIT License
643 stars 281 forks source link

error when compile bugs #451

Open kevinGit777 opened 2 years ago

kevinGit777 commented 2 years ago

hi, I got this message and hope you guys can help me. Thank you so much!

Running ant (export.cp.compile)............................................ FAIL
Executed command:  cd /StaticBugCheckers/defects4j/projects/b/Closure-150 && /StaticBugCheckers/defects4j/major/bin/ant -f /StaticBugCheckers/defects4j/framework/projects/defects4j.build.xml -Dd4j.home=/StaticBugCheckers/defects4j -Dd4j.dir.projects=/StaticBugCheckers/defects4j/framework/projects -Dbasedir=/StaticBugCheckers/defects4j/projects/b/Closure-150 -Dbuild.compiler=javac1.7 -Dfile.export=/StaticBugCheckers/defects4j/projects/b/Closure-150/.export.cp.compile export.cp.compile 2>&1
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=1G; support was removed in 8.0
Buildfile: /StaticBugCheckers/defects4j/framework/projects/defects4j.build.xml

sanity.check:

compile:
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/build.xml:54: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/build.xml:60: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 343 source files to /StaticBugCheckers/defects4j/projects/b/Closure-150/build/classes
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:46: error: unmappable character for encoding ASCII
    [javac]  * Banning, John. ???An efficient way to find the side effects of procedure
    [javac]                   ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:46: error: unmappable character for encoding ASCII
    [javac]  * Banning, John. ???An efficient way to find the side effects of procedure
    [javac]                    ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:46: error: unmappable character for encoding ASCII
    [javac]  * Banning, John. ???An efficient way to find the side effects of procedure
    [javac]                     ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:47: error: unmappable character for encoding ASCII
    [javac]  *      calls and the aliases of variables.??? POPL ???79.
    [javac]                                            ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:47: error: unmappable character for encoding ASCII
    [javac]  *      calls and the aliases of variables.??? POPL ???79.
    [javac]                                             ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:47: error: unmappable character for encoding ASCII
    [javac]  *      calls and the aliases of variables.??? POPL ???79.
    [javac]                                              ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:47: error: unmappable character for encoding ASCII
    [javac]  *      calls and the aliases of variables.??? POPL ???79.
    [javac]                                                     ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:47: error: unmappable character for encoding ASCII
    [javac]  *      calls and the aliases of variables.??? POPL ???79.
    [javac]                                                      ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SideEffectsAnalysis.java:47: error: unmappable character for encoding ASCII
    [javac]  *      calls and the aliases of variables.??? POPL ???79.
    [javac]                                                       ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:248: error: unmappable character for encoding ASCII
    [javac]    * 3.    file: ???out.js???
    [javac]                  ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:248: error: unmappable character for encoding ASCII
    [javac]    * 3.    file: ???out.js???
    [javac]                   ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:248: error: unmappable character for encoding ASCII
    [javac]    * 3.    file: ???out.js???
    [javac]                    ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:248: error: unmappable character for encoding ASCII
    [javac]    * 3.    file: ???out.js???
    [javac]                           ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:248: error: unmappable character for encoding ASCII
    [javac]    * 3.    file: ???out.js???
    [javac]                            ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:248: error: unmappable character for encoding ASCII
    [javac]    * 3.    file: ???out.js???
    [javac]                             ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:267: error: unmappable character for encoding ASCII
    [javac]    * Line 5: ???lineMaps??? field is a JSON array, where each entry represents a
    [javac]              ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:267: error: unmappable character for encoding ASCII
    [javac]    * Line 5: ???lineMaps??? field is a JSON array, where each entry represents a
    [javac]               ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:267: error: unmappable character for encoding ASCII
    [javac]    * Line 5: ???lineMaps??? field is a JSON array, where each entry represents a
    [javac]                ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:267: error: unmappable character for encoding ASCII
    [javac]    * Line 5: ???lineMaps??? field is a JSON array, where each entry represents a
    [javac]                         ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:267: error: unmappable character for encoding ASCII
    [javac]    * Line 5: ???lineMaps??? field is a JSON array, where each entry represents a
    [javac]                          ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:267: error: unmappable character for encoding ASCII
    [javac]    * Line 5: ???lineMaps??? field is a JSON array, where each entry represents a
    [javac]                           ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:272: error: unmappable character for encoding ASCII
    [javac]    *     server or removing repeated prefix values in the ???sources??? entry.
    [javac]                                                           ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:272: error: unmappable character for encoding ASCII
    [javac]    *     server or removing repeated prefix values in the ???sources??? entry.
    [javac]                                                            ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:272: error: unmappable character for encoding ASCII
    [javac]    *     server or removing repeated prefix values in the ???sources??? entry.
    [javac]                                                             ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:272: error: unmappable character for encoding ASCII
    [javac]    *     server or removing repeated prefix values in the ???sources??? entry.
    [javac]                                                                     ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:272: error: unmappable character for encoding ASCII
    [javac]    *     server or removing repeated prefix values in the ???sources??? entry.
    [javac]                                                                      ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:272: error: unmappable character for encoding ASCII
    [javac]    *     server or removing repeated prefix values in the ???sources??? entry.
    [javac]                                                                       ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:273: error: unmappable character for encoding ASCII
    [javac]    * Line 10: A list of sources used by the ???mappings??? entry relative to the
    [javac]                                             ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:273: error: unmappable character for encoding ASCII
    [javac]    * Line 10: A list of sources used by the ???mappings??? entry relative to the
    [javac]                                              ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:273: error: unmappable character for encoding ASCII
    [javac]    * Line 10: A list of sources used by the ???mappings??? entry relative to the
    [javac]                                               ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:273: error: unmappable character for encoding ASCII
    [javac]    * Line 10: A list of sources used by the ???mappings??? entry relative to the
    [javac]                                                        ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:273: error: unmappable character for encoding ASCII
    [javac]    * Line 10: A list of sources used by the ???mappings??? entry relative to the
    [javac]                                                         ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:273: error: unmappable character for encoding ASCII
    [javac]    * Line 10: A list of sources used by the ???mappings??? entry relative to the
    [javac]                                                          ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:275: error: unmappable character for encoding ASCII
    [javac]    * Line 11: A list of symbol names used by the ???mapping??? entry.  This list
    [javac]                                                  ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:275: error: unmappable character for encoding ASCII
    [javac]    * Line 11: A list of symbol names used by the ???mapping??? entry.  This list
    [javac]                                                   ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:275: error: unmappable character for encoding ASCII
    [javac]    * Line 11: A list of symbol names used by the ???mapping??? entry.  This list
    [javac]                                                    ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:275: error: unmappable character for encoding ASCII
    [javac]    * Line 11: A list of symbol names used by the ???mapping??? entry.  This list
    [javac]                                                            ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:275: error: unmappable character for encoding ASCII
    [javac]    * Line 11: A list of symbol names used by the ???mapping??? entry.  This list
    [javac]                                                             ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:275: error: unmappable character for encoding ASCII
    [javac]    * Line 11: A list of symbol names used by the ???mapping??? entry.  This list
    [javac]                                                              ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:284: error: unmappable character for encoding ASCII
    [javac]    *     This can either be an string or index into the ???names??? field.
    [javac]                                                         ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:284: error: unmappable character for encoding ASCII
    [javac]    *     This can either be an string or index into the ???names??? field.
    [javac]                                                          ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:284: error: unmappable character for encoding ASCII
    [javac]    *     This can either be an string or index into the ???names??? field.
    [javac]                                                           ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:284: error: unmappable character for encoding ASCII
    [javac]    *     This can either be an string or index into the ???names??? field.
    [javac]                                                                 ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:284: error: unmappable character for encoding ASCII
    [javac]    *     This can either be an string or index into the ???names??? field.
    [javac]                                                                  ^
    [javac] /StaticBugCheckers/defects4j/projects/b/Closure-150/src/com/google/javascript/jscomp/SourceMap2.java:284: error: unmappable character for encoding ASCII
    [javac]    *     This can either be an string or index into the ???names??? field.
    [javac]                                                                   ^
    [javac] 45 errors

BUILD FAILED
/StaticBugCheckers/defects4j/projects/b/Closure-150/build.xml:60: Compile failed; see the compiler error output for details.

Total time: 0 seconds
Cannot export property cp.compile at /StaticBugCheckers/defects4j/framework/bin/d4j/d4j-export line 112.
Compilation failed in require at /StaticBugCheckers/defects4j/framework/bin/defects4j line 195.

` similar things happened in compiling Closure-149

system info: git version 2.17.1 svn, version 1.9.7 (r1800392) defect4j up to date

rjust commented 2 years ago

Hi @kevinGit777,

What's the output of the following three commands in your environment:

Thanks, René

kevinGit777 commented 2 years ago

hi, @rjust

$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)
$ echo $JAVA_HOME
/home/.sdkman/candidates/java/current
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I also try using 1.7 for java but same output

rjust commented 2 years ago

I can reproduce the issue when explicitly changing the encoding to ASCII (i.e., changing the build file to use the encoding attribute for the javac task.

Is it possible that your environment, before running defects4j, sets the file encoding to ASCII? Is there maybe a properties file that does so?

With the environment that you provided, the following two commands work on my end (and output the requested classpath):

Best, René

wang-weishi commented 1 year ago

Hi @rjust, I am facing a similar compile error when compiling and testing. Below is my approach and set-up on gcp pod.

**java -version**
openjdk  version "1.8.0_312" 
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
**echo $JAVA_HOME**
/usr/lib/jvm/java-1.8.0-openjdk-amd64/

I am able to check out the file, but when I try to compile or test, the compile issue about to happen:

**root@cpu:/export/home/defects4j/debug/lang_6_buggy$ defects4j compile**
Running ant (compile)...................................................... FAIL
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=1G; support was removed in 8.0
Buildfile: /export/home/defects4j/framework/projects/defects4j.build.xml

init:
     [echo] -------- commons-lang3 3.2-SNAPSHOT --------

compile:

BUILD FAILED
/export/home/defects4j/debug/lang_6_buggy/build.xml:63: Class not found: javac1.8

Total time: 0 seconds
Executed command:  cd /export/home/defects4j/debug/lang_6_buggy && ant -f /export/home/defects4j/framework/projects/defects4j.build.xml -Dd4j.home=/export/home/defects4j -Dd4j.dir.projects=/export/home/defects4j/framework/projects -Dbasedir=/export/home/defects4j/debug/lang_6_buggy  compile 2>&1
Cannot compile sources! at /export/home/defects4j/framework/bin/d4j/d4j-compile line 82.
Compilation failed in require at /export/home/defects4j/framework/bin/defects4j line 155.

But if I change to ant compile, it works

**ant compile**
Buildfile: /export/home/defects4j/debug/lang_6_buggy/build.xml

init:
     [echo] -------- commons-lang3 3.2-SNAPSHOT --------

compile:

BUILD SUCCESSFUL
Total time: 0 seconds

Could you please advise on this issue? Thank you for your help!

Feng-Jay commented 3 months ago

Hello! Is there any solution to this problem? I also meet this error on defects4j v2.0 dataset. @kevinGit777 @rjust