#125 again Cilly Kernel - cab2cil hangs on vdso32-setup


I've had hangs on vdso32-setup as in the previous bug:
Cilly Kernel - cab2cil hangs parsing vdso32-setup - ID: 3089792

It stack overflows in the nest of mutually recursive functions in cabs2cil.ml


cilly.asm.exe hangs.c

// hangs.c
void hangs_on_case()
int q;
switch(q) {
case 0x6000000d ... 0x6ffff000 -1:



  • Gabriel Kerneis

    Gabriel Kerneis - 2012-05-29
    • assigned_to: nobody --> kerneis
  • Gabriel Kerneis

    Gabriel Kerneis - 2012-06-05

    I have committed a few fixes to mitigate the issue. CIL is now able to parse and print a similar example without stack-overflow. However:
    - you must use --keep-unused, because visiting labels in a visitor will overflow the stack,
    - similarly, if you need to write your own visitors, you are likely to be bitten too (maybe overwriting some methods wisely would work),
    - in fact, it only works for the reduced case range 0x6000000d ... 0x600ff000 -1, not for your original example, and it outputs a file of 20MB.

    There is no way to solve this issue correctly within the current CIL architecture, translating a case range into an explicit list of cases does not scale. I have fixed the most obvious non-tail-recursive calls nonetheless, but it will probably not be enough for you, sorry.

  • Gabriel Kerneis

    Gabriel Kerneis - 2012-06-05
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks