codinuum / cca

Code Continuity Analysis Framework
https://codinuum.github.io/gallery-cca/
Apache License 2.0
20 stars 5 forks source link

[C] Non-terminating parsing #31

Closed petr-bauch closed 1 year ago

petr-bauch commented 1 year ago

Hey Codinnuum team,

Your parser is amazing and this is the only issue in a while that we found.

With this file as input: https://git.yoctoproject.org/linux-yocto-contrib/plain/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c

Cca does not produce any output (or terminate) for minutes. There is no memory consumption so I assume it's some recursion but we haven't found the problematic part of the code.

codinuum commented 1 year ago

Thank you for reporting! We have fixed the non-termination bug in the develop branch.

petr-bauch commented 1 year ago

:heart: Yep it works for this file.

Could you please also have a look at this file: https://github.com/MidnightBSD/src/blob/master/sys/kern/kern_timeout.c

Similar problem but this time the parser produces this output (continuously):

[parsesrc.opt][WARNING][/home/petr/code/src/sys/kern/kern_timeout.c][969L,34C-33C(28290-28289)] unmatched parenthesis
codinuum commented 1 year ago

Hmm, the infinite loop begins at an odd preprocessor branch... We've just fixed it. Does it work?

petr-bauch commented 1 year ago

Perfect. All works now. Thank you so much.