Making Analysis in Chord Object-Sensitive

65 views
Skip to first unread message

Suvam Mukherjee

unread,
Dec 17, 2015, 2:39:33 AM12/17/15
to chord-discuss
Hi,

I am trying to run the Java static datarace analysis, and I am getting a lot of spurious data races. I think it is mainly due to lack of object sensitivity in the analysis: there are races reported on local fields of objects.

How do I enable object sensitivity in the analysis?

Sincerely,
Suvam.

Mayur Naik

unread,
Dec 17, 2015, 9:19:09 AM12/17/15
to chord-discuss, Aditya Kamath, Sulekha Kulkarni
Hi Suvam,

If you can wait for a week, we are in the process of releasing Petablox, the successor to Chord.  It will include a highly configurable datarace analysis, including the ability to use a highly context- and object-sensitive analysis (based on the algorithm from our PLDI'14 paper http://www.cc.gatech.edu/~naik/pubs/pldi14a.pdf).  I'm including my students Aditya and Sulekha, who are working on this at the moment.  They will inform you once Petablox is released.

-- Mayur

--
You received this message because you are subscribed to the Google Groups "chord-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chord-discus...@googlegroups.com.
To post to this group, send email to chord-...@googlegroups.com.
Visit this group at https://groups.google.com/group/chord-discuss.
For more options, visit https://groups.google.com/d/optout.

Suvam Mukherjee

unread,
Dec 18, 2015, 3:15:31 AM12/18/15
to chord-discuss, aditya...@gmail.com, sulekha....@gmail.com
Hi Mayur,

That would be tremendously useful. Thanks so much!

Sincerely,
Suvam.

Suvam Mukherjee

unread,
Apr 20, 2016, 5:24:21 AM4/20/16
to chord-discuss, aditya...@gmail.com, sulekha....@gmail.com
Hi,

I am trying out the static datarace detector in Petablox, on a simple multi-threaded Java program. I am running the analysis using the command:

java -cp petablox.jar -Dpetablox.work.dir=../concExp/ -Dpetablox.run.analyses=datarace-java -Dpetablox.exclude.datarace.init=false -Dpetablox.datarace.exclude.eqth=false petablox.project.Boot

However, this results in a terminated run with the following error in the log file:

ava.lang.Error: ERROR: ClassicProject: Multiple tasks (dynLocE-queryE-dlog queryE) producing target 'queryE'; include exactly one of them via property 'petablox.run.analyses'.
at petablox.project.Messages.fatal(Messages.java:24)
at petablox.project.ClassicProject.getTaskProducingTrgt(ClassicProject.java:366)
at petablox.project.ClassicProject.runTask(ClassicProject.java:400)
at petablox.project.ClassicProject.runTask(ClassicProject.java:401)
at petablox.project.ClassicProject.runTask(ClassicProject.java:425)
at petablox.analyses.datarace.DataraceAnalysis.run(DataraceAnalysis.java:93)
at petablox.project.ClassicProject.runTask(ClassicProject.java:404)
at petablox.project.ClassicProject.runTask(ClassicProject.java:425)
at petablox.project.ClassicProject.run(ClassicProject.java:118)
at petablox.project.Main.run(Main.java:78)
at petablox.project.Main.main(Main.java:50)

What is the issue here? Am I making some mistake?
I have attached the log file with this email.

Sincerely,
Suvam.
log.txt

Sulekha Kulkarni

unread,
Apr 21, 2016, 7:16:04 PM4/21/16
to Suvam Mukherjee, chord-discuss, Aditya Kamath
Hi Suvam,

As the error message suggests, please add queryE to to the petablox.run.analyses property as follows:

java -cp petablox.jar -Dpetablox.work.dir=../concExp/ -Dpetablox.run.analyses=queryE,datarace-java -Dpetablox.exclude.datarace.init=false -Dpetablox.datarace.exclude.eqth=false petablox.project.Boot

Thanks,
Sulekha

Suvam Mukherjee

unread,
Apr 22, 2016, 5:31:30 AM4/22/16
to chord-discuss, suvamth...@gmail.com, aditya...@gmail.com, sulekha....@gmail.com, Dr Deepak D Souza
Hi Sulekha,

Thanks for the reply!

Using this command yields the following exception:

Exception in thread "main" java.lang.ClassCastException: soot.tagkit.SignatureTag cannot be cast to soot.tagkit.SourceFileTag
at petablox.analyses.alloc.DomH.toXMLAttrsString(DomH.java:165)
at petablox.project.analyses.ProgramDom.saveToXMLFile(ProgramDom.java:121)
at petablox.analyses.datarace.DataraceAnalysis.printResults(DataraceAnalysis.java:238)
at petablox.analyses.datarace.DataraceAnalysis.run(DataraceAnalysis.java:101)
at petablox.project.ClassicProject.runTask(ClassicProject.java:404)
at petablox.project.ClassicProject.runTask(ClassicProject.java:425)
at petablox.project.ClassicProject.run(ClassicProject.java:118)
at petablox.project.Main.run(Main.java:78)
at petablox.project.Main.main(Main.java:50)

I have attached the full log file, along with the sources of the Java files I am analysing.

Look forward to your help.

Sincerely,
Suvam.
Data.java
Driver.java
Thread1.java
log.txt

Sulekha Kulkarni

unread,
Apr 22, 2016, 5:44:41 AM4/22/16
to Suvam Mukherjee, chord-discuss, Aditya Kamath, Dr Deepak D Souza
Hi Suvam,

You will have to comment out lines 236 to 271 (both inclusive) in file petablox.analyses.datarace.DataraceAnalysis.java since some features like converting to XML attribute string, etc have not yet been ported.

Thanks,
Sulekha

Suvam Mukherjee

unread,
Apr 22, 2016, 5:47:31 AM4/22/16
to chord-discuss, suvamth...@gmail.com, aditya...@gmail.com, dee...@csa.iisc.ernet.in, sulekha....@gmail.com
Hi Sulekha,

Thanks so much.

I'll comment those lines out and check. 
Previously the outputs used to be in HTML format. What would be the format of the output now?

Thanks,
Suvam.

Suvam Mukherjee

unread,
Apr 22, 2016, 6:14:16 AM4/22/16
to chord-discuss, Suvam Mukherjee, aditya...@gmail.com, Dr Deepak D Souza, sulekha....@gmail.com
Hi Sulekha,

I removed the lines and built Petablox. I am trying to detect races on a simple program, where two threads simultaneously write to the same field of a shared object. There is clearly a write-write race.

With lines 236-271 removed, the datarace analysis runs to completion. But how do I view the list of races? datarace.xml is empty, and I guess this is expected with the changes I made. 

Do I need to write my own output format for the races?

Thanks,
Suvam.

Sulekha Kulkarni

unread,
Apr 22, 2016, 6:48:35 AM4/22/16
to Suvam Mukherjee, chord-discuss, Aditya Kamath, Dr Deepak D Souza, ravi teja p
Hi Suvam,

Can you please try this one fix: 

Change line 165 (containing "Orig content" below) in petablox/src/petablox/analyses/alloc/DomH.java  (replace with "New content")

Orig content:     String file = ((SourceFileTag)m.getDeclaringClass().getTags().get(0)).getSourceFile();

New content:   String file = ((SourceFileTag)m.getDeclaringClass().getTag("SourceFileTag")).getSourceFile();

Also, uncomment the lines I asked you to comment out earlier. If this fix does not work, I will get back to you later on this.

Thanks,
Sulekha

Suvam Mukherjee

unread,
Apr 22, 2016, 11:42:02 AM4/22/16
to Sulekha Kulkarni, chord-discuss, Aditya Kamath, Dr Deepak D Souza, ravi teja p
Hi Sulekha,

With the changes you suggested, I am getting the following exception (the log is attached):

Exception in thread "main" java.lang.ClassCastException: soot.jimple.internal.JInvokeStmt cannot be cast to soot.jimple.internal.JAssignStmt
at petablox.analyses.invk.DomI.toXMLAttrsString(DomI.java:76)
at petablox.analyses.invk.DomI.toXMLAttrsString(DomI.java:26)
at petablox.project.analyses.ProgramDom.saveToXMLFile(ProgramDom.java:121)
at petablox.analyses.datarace.DataraceAnalysis.printResults(DataraceAnalysis.java:239)
at petablox.analyses.datarace.DataraceAnalysis.run(DataraceAnalysis.java:101)
at petablox.project.ClassicProject.runTask(ClassicProject.java:404)
at petablox.project.ClassicProject.runTask(ClassicProject.java:425)
at petablox.project.ClassicProject.run(ClassicProject.java:118)
at petablox.project.Main.run(Main.java:78)
at petablox.project.Main.main(Main.java:50)

Sincerely,
Suvam.

log.txt

Sulekha Kulkarni

unread,
Apr 22, 2016, 11:53:40 AM4/22/16
to Suvam Mukherjee, chord-discuss, Aditya Kamath, Dr Deepak D Souza, ravi teja p
Hi Suvam,

At present we are busy with some urgent work. We will look into it when we are able to devote some time to this.

Thanks,
Sulekha

Suvam Mukherjee

unread,
Apr 22, 2016, 2:11:01 PM4/22/16
to Sulekha Kulkarni, ravi teja p, Dr Deepak D Souza, Aditya Kamath, chord-discuss

O Ok, sure no problem. Thanks for the help!

Sincerely,
Suvam.

Reply all
Reply to author
Forward
0 new messages