rjust / defects4j

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

error when compile bugs #451

Closed kevinGit777 closed 1 day 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 2 years 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 10 months ago

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

lemon1-ui commented 2 days ago

Hello,I have also encountered the same problem. How can I solve it? @rjust @wang-weishi

rjust commented 2 days ago

@lemon1-ui,

Are you observing compilation issues for Defects4J version 3?

Can you please provide the exact commands that you issued and the corresponding outputs that show the error?

Additionally, can you please let us know:

(Note that in the above reports, there are two distinct issues related to compiling D4J artifacts.)

Thanks, René

lemon1-ui commented 2 days ago

@rjust Hello,when I compile Math96,I encountered some errors,The following is the error message: BUILD FAILED /home/yinyuanyuan/SelfAPR-main/Math96/build.xml:46: Compile failed; see the compiler error output for details. Total time: 0 seconds Cannot compile sources! at /home/yinyuanyuan/software/defects4j/framework/bin/d4j/d4j-compile line 82. Compilation failed in require at /home/yinyuanyuan/software/defects4j/framework/bin/defects4j line 195.") 1

(lucky6) yinyuanyuan@GPU-Server:~/SelfAPR-main$ locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:en LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC=zh_CN.UTF-8 LC_TIME=zh_CN.UTF-8 LC_COLLATE="zh_CN.UTF-8" LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES="zh_CN.UTF-8" LC_PAPER=zh_CN.UTF-8 LC_NAME=zh_CN.UTF-8 LC_ADDRESS=zh_CN.UTF-8 LC_TELEPHONE=zh_CN.UTF-8 LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=zh_CN.UTF-8 LC_ALL= and (lucky6) yinyuanyuan@GPU-Server:~/SelfAPR-main$ java -version java version "1.8.0_411" Java(TM) SE Runtime Environment (build 1.8.0_411-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.411-b09, mixed mode) and (lucky6) yinyuanyuan@GPU-Server:~/SelfAPR-main$ git --version git version 2.25.1

rjust commented 2 days ago

What version of Defects4J are you using?

Also, based on the provided trace, it looks like the defects4j compile command is executed as a subprocess in a different tool -- presumably some APR tool?

What's the output of the following two commands?

defects4j checkout -p Math -v 96b -w /tmp/Math96
defects4j compile -w /tmp/Math96
lemon1-ui commented 2 days ago

@rjust May be I use the defects4j-2.0. I installed it by using git clone https://github.com/rjust/defects4j. Yes, I use it in an APR tool. The output as follow. 1

lemon1-ui commented 2 days ago

@rjust Well, how to view the version of Defects4J?

rjust commented 2 days ago

Since the defects4j commands succeed, it looks like the compilation error is either caused by the APR tool's environment or perhaps the tool incorrectly patched a source file such that a compilation error is expected?

Re defects4j version: You can check the commit hash of the HEAD revision in your cloned defects4j repository. Based on the outputs, I am pretty confident that this is version 2 (the actual commit may differ slightly from the tagged version 2). That said, these compilation errors seem unrelated to Defects4J, so version 2 vs. version 3 probably does not matter.

lemon1-ui commented 2 days ago

Thanks so much. I will check them in others.