Re: [Cocci] Using SmPL script to switch to formatted log/print function
> This discussion is about parsing the source code. It seems that an acceptable solution was found according to your advice yesterday. I could offer other ideas for another bit of software fine-tuning. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] Using SmPL script to switch to formatted log/print function
On Sat, 28 Mar 2020, Markus Elfring wrote: > > I have this all working with the following script with the caveat that > > running it on moderately complicated source files makes it never > > finish (after an hour or so the spatch process crashes with a stack > > overflow error). > > Do you find any information interesting from a previous bug report? > https://github.com/coccinelle/coccinelle/issues/30 This discussion is about parsing the source code. George, if you still get a stack overflow, you could try spatch -parse-c . but that would be disjoint from the problems with the semantic patch. julia > > > > Any suggestions on changes to my script that would make this work on > > lengthy source files would be greatly appreciated! > > Additional adjustments can be considered for transformation approaches. > > Regards, > Markus > ___ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci > ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] Using SmPL script to switch to formatted log/print function
> I have this all working with the following script with the caveat that > running it on moderately complicated source files makes it never > finish (after an hour or so the spatch process crashes with a stack > overflow error). Do you find any information interesting from a previous bug report? https://github.com/coccinelle/coccinelle/issues/30 > Any suggestions on changes to my script that would make this work on > lengthy source files would be greatly appreciated! Additional adjustments can be considered for transformation approaches. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [v3 05/10] mmap locking API: Checking the Coccinelle software
> The problem can be seen with the --debug option: > > FLOW: can't jump to VMALLOC_FAULT_TARGET: because we can't find this label > > It's not apparent with the --parse-c option because it's not a parsing > problem. Thanks for such information. Can the example be transformed even if extra source code was intentionally deleted for the easier clarification of the shown software test? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [v3 05/10] mmap locking API: Checking the Coccinelle software
> // deleted part > retry: > down_read(>mmap_sem); > vma = find_vma(mm, address); > if (!vma) > goto bad_area; > // deleted part > } > // deleted part > > > Application of the software “Coccinelle 1.0.8-00029-ga549b9f0” (OCaml 4.10.0) > > elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-c > do_page_fault-excerpt3.c > … > NB total files = 1; perfect = 1; pbs = 0; timeout = 0; => 100% > nb good = 15, nb passed = 1 => 6.25% passed > nb good = 15, nb bad = 0 => 100.00% good or passed > > > The discussed transformation approach can also be reduced for a test > to the following script for the semantic patch language. > > @replacement@ > expression x; > @@ > -down_read > +mmap_read_lock > ( > - & > x > - ->mmap_sem > ) > > > elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch > use_mmap_locking_API_3.cocci do_page_fault-excerpt3.c > > > The desired diff is not generated so far. > How would you like to fix this situation? The problem can be seen with the --debug option: FLOW: can't jump to VMALLOC_FAULT_TARGET: because we can't find this label It's not apparent with the --parse-c option because it's not a parsing problem. julia___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [v3 05/10] mmap locking API: Checking the Coccinelle software
On Sat, 28 Mar 2020, Markus Elfring wrote: > >> How will corresponding software development resources evolve? > > > > I don't think I understand the question, or, actually, are you asking > > me or the coccinelle developers ? > > I hope that another communication approach can eventually increase > the chances for a better common understanding of development challenges. > > The code from a mentioned source file can be reduced to the following > test file. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/mm/fault.c?id=69c5eea3128e775fd3c70ecf0098105d96dee330#n34 > > // deleted part > static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long > write, > unsigned long address) > { > struct vm_area_struct * vma = NULL; > struct task_struct *tsk = current; > struct mm_struct *mm = tsk->mm; > // deleted part > retry: > down_read(>mmap_sem); > vma = find_vma(mm, address); > if (!vma) > goto bad_area; > // deleted part > } > // deleted part > > > Application of the software “Coccinelle 1.0.8-00029-ga549b9f0” (OCaml 4.10.0) > > elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-c > do_page_fault-excerpt3.c > … > NB total files = 1; perfect = 1; pbs = 0; timeout = 0; => 100% > nb good = 15, nb passed = 1 => 6.25% passed > nb good = 15, nb bad = 0 => 100.00% good or passed > > > The discussed transformation approach can also be reduced for a test > to the following script for the semantic patch language. > > @replacement@ > expression x; > @@ > -down_read > +mmap_read_lock > ( > - & > x > - ->mmap_sem > ) > > > elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch > use_mmap_locking_API_3.cocci do_page_fault-excerpt3.c > > > The desired diff is not generated so far. > How would you like to fix this situation? The problem is due to a preceding goto where the destination is expressed as a macro name. Maybe there should be a warning in this case. julia > > Regards, > Markus > ___ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci >___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [v3 05/10] mmap locking API: Checking the Coccinelle software
>> How would you like to fix this situation? > > Who exactly do you think "you" is? Every contributor with helpful software development resources for this issue. > I will look at it, Thanks for another promising feedback. > but it is not very polite to ask a user of Coccinelle such a question. We come along different views for the handling of such a bug report. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [v3 05/10] mmap locking API: Checking the Coccinelle software
On Sat, 28 Mar 2020, Markus Elfring wrote: > >> How will corresponding software development resources evolve? > > > > I don't think I understand the question, or, actually, are you asking > > me or the coccinelle developers ? > > I hope that another communication approach can eventually increase > the chances for a better common understanding of development challenges. > > The code from a mentioned source file can be reduced to the following > test file. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/mm/fault.c?id=69c5eea3128e775fd3c70ecf0098105d96dee330#n34 > > // deleted part > static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long > write, > unsigned long address) > { > struct vm_area_struct * vma = NULL; > struct task_struct *tsk = current; > struct mm_struct *mm = tsk->mm; > // deleted part > retry: > down_read(>mmap_sem); > vma = find_vma(mm, address); > if (!vma) > goto bad_area; > // deleted part > } > // deleted part > > > Application of the software “Coccinelle 1.0.8-00029-ga549b9f0” (OCaml 4.10.0) > > elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-c > do_page_fault-excerpt3.c > … > NB total files = 1; perfect = 1; pbs = 0; timeout = 0; => 100% > nb good = 15, nb passed = 1 => 6.25% passed > nb good = 15, nb bad = 0 => 100.00% good or passed > > > The discussed transformation approach can also be reduced for a test > to the following script for the semantic patch language. > > @replacement@ > expression x; > @@ > -down_read > +mmap_read_lock > ( > - & > x > - ->mmap_sem > ) > > > elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch > use_mmap_locking_API_3.cocci do_page_fault-excerpt3.c > > > The desired diff is not generated so far. > How would you like to fix this situation? Who exactly do you think "you" is? I will look at it, but it is not very polite to ask a user of Coccinelle such a question. julia > > Regards, > Markus > ___ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci >___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [v3 05/10] mmap locking API: Checking the Coccinelle software
>> How will corresponding software development resources evolve? > > I don't think I understand the question, or, actually, are you asking > me or the coccinelle developers ? I hope that another communication approach can eventually increase the chances for a better common understanding of development challenges. The code from a mentioned source file can be reduced to the following test file. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/mm/fault.c?id=69c5eea3128e775fd3c70ecf0098105d96dee330#n34 // deleted part static void __kprobes __do_page_fault(struct pt_regs *regs, unsigned long write, unsigned long address) { struct vm_area_struct * vma = NULL; struct task_struct *tsk = current; struct mm_struct *mm = tsk->mm; // deleted part retry: down_read(>mmap_sem); vma = find_vma(mm, address); if (!vma) goto bad_area; // deleted part } // deleted part Application of the software “Coccinelle 1.0.8-00029-ga549b9f0” (OCaml 4.10.0) elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-c do_page_fault-excerpt3.c … NB total files = 1; perfect = 1; pbs = 0; timeout = 0; => 100% nb good = 15, nb passed = 1 => 6.25% passed nb good = 15, nb bad = 0 => 100.00% good or passed The discussed transformation approach can also be reduced for a test to the following script for the semantic patch language. @replacement@ expression x; @@ -down_read +mmap_read_lock ( - & x - ->mmap_sem ) elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch use_mmap_locking_API_3.cocci do_page_fault-excerpt3.c The desired diff is not generated so far. How would you like to fix this situation? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [v3 05/10] mmap locking API: convert mmap_sem call sites missed by coccinelle
> I would be interested to find out why coccinelle wasn't able to do the > last 1%, but only as part of a long-term learning process on getting > better with coccinelle - … How will corresponding software development resources evolve? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
Re: [Cocci] [PATCH v3 05/10] mmap locking API: convert mmap_sem call sites missed by coccinelle
> Convert the last few remaining mmap_sem rwsem calls to use the new > mmap locking API. These were missed by coccinelle for some reason Will the clarification of this software situation become more interesting? > (I think coccinelle does not support some of the preprocessor > constructs in these files ?) I suggest to omit this information from the final change description. Would you like to help any more to find nicer solutions for remaining open issues? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci