question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistency between compilations

See original GitHub issue

Hi!

I was testing the project with this simple grammar rules:

{
	"<START>": [
		["<?php", "<FUZZ>", "\n?>"]
	],
	"<FUZZ>": [
		["\ntry {\n try {\n", "<DEFCLASS>", "\n} catch (Exception $e){}} catch(Error $e){}", "<FUZZ>"],[]
	],
	"<DEFCLASS>" : [
		["class ", "<CLASSNAME>", " {\n\t", "<CLASSBODY>","}\n"],[]
	],
	"<CLASSNAME>" : [
		["Class01"],
		["Class02"],
		["Class03"],
		["Class04"],
		["Class05"]
	],
	"<CLASSBODY>" : [
		["test01;\n"],
		["test02;\n"],
		["test03;\n"]
	]
}

Every time I compile (make -j$(nproc) GRAMMAR_FILE=grammars/phpexcept.json) and test the rules with the generator I obtain different results: sometimes it only picks a rule, other a small chain of rules…:

 psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   ./grammar_generator-phpexcept 100 1000 ./seeds ./trees
 psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   cat seeds/1
class Class03 {
	test01;
}
psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   make clean && make -j$(nproc) GRAMMAR_FILE=grammars/phpexcept.json && ./grammar_generator-phpexcept 100 1000 ./seeds ./trees
psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   cat seeds/1
<?php
try {
 try {
class Class04 {
	test03;

}

} catch (Exception $e){}} catch(Error $e){}
?>
psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   make clean && make -j$(nproc) GRAMMAR_FILE=grammars/phpexcept.json && ./grammar_generator-phpexcept 100 1000 ./seeds ./trees
psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   cat seeds/1
Class01

I am not sure if I am creating the rules in a wrong way (but checking documentation and the ruby example it looks fine to me).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
X-C3LLcommented, Jan 3, 2022

Hi!

I tested it on two machines with a more recent version of my distro (Debian 10) and it works like a charm (just needed to do the .py edit again):

psyconauta@insulaanglia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   cat seeds/6
<?php
try {
 try {
class Class02 {
	test02;
}

} catch (Exception $e){}} catch(Error $e){}
try {
 try {
class Class04 {
	test03;
}

} catch (Exception $e){}} catch(Error $e){}
?>%                                          

So it’s highly probable the problem is in my side. Let me upgrade the VM (currently is running Debian 9) and test it to confirm it.

0reactions
X-C3LLcommented, Jan 3, 2022

Yep, the problem was on my side. Upgrading to Debian 10 solved the issue: every time the whole chain of rules is used.

 psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   lsb_release -d                                         
Description:	Debian GNU/Linux 10 (buster)
 psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   ./grammar_generator-phpexcept 100 1000 ./seeds ./trees 
Using seed 1641239392
 psyconauta@insulaalchimia ᐓ  ~/Grammar-Mutator |stable⚡ ᐓ   cat seeds/1
<?php
try {
 try {
class Class01 {
	test03;
}

} catch (Exception $e){}} catch(Error $e){}
try {
 try {
class Class05 {
	test02;
}

} catch (Exception $e){}} catch(Error $e){}
try {
 try {

} catch (Exception $e){}} catch(Error $e){}
try {
 try {

} catch (Exception $e){}} catch(Error $e){}
?>%                                               
Read more comments on GitHub >

github_iconTop Results From Across the Web

IPO+PIE: Inconsistency between compilation and linking (#23980 ...
Inconsistent use of -fPIE and -fPIC in compile and linker arguments leads to code generation error with INTERPROCEDURAL_OPTIMIZATION enabled.
Read more >
.net - How to avoid the compilation error with inconsistent ...
Just a suggestion. There could be two PressurePartSize classes: a public one and an internal one. It's not clear from the pictures. Something ......
Read more >
How to solve version inconsistencies for a better compilation ...
In the following article, we will explain in detail why versions are updated, why your build works locally but not in Codemagic CI/CD, ......
Read more >
Compilation inconsistency when referencing the same code over ...
Problem I got the true compilation errors when referenced dependency with path. And see no errors when reference over git of version in...
Read more >
RDA Refreshers: Compilations of Works by Different Creators
A compilation of works by different creators is a collection of individual works by different creators. Examples include a collection of correspondence between...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found