Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options= or whatever to link full non-trapping ubsan runtime on request #2297

Open
nekopsykose opened this issue Jun 22, 2024 · 0 comments
Open

Comments

@nekopsykose
Copy link
Member

nekopsykose commented Jun 22, 2024

currently whenever you get an int crash the process goes something like

  • look at x/1i $pc and see which type of overflow it is (sometimes, it doesn't even have this for some reason and is missing the type..)
  • go to the source file and the function but have no line or info (:0, compiler-generated-code)
  • do some hmmm guesswork as to what the issue is (usually easy, not always)
  • ???

and if you fail, the easiest way to continue:

  • open cbuild
  • delete this lol:
    # ensure no runtime is relied upon                                  
    sflags.append(                                                      
        "-fsanitize-trap=signed-integer-overflow,integer-divide-by-zero"
    )                                                                   
    
  • add /usr/lib/clang/18/lib/x86_64-chimera-linux-musl/libclang_rt.ubsan_standalone.a to LDFLAGS in tool_flags or whatever
  • enjoy your real ubsan report

it would be nice if there was a way to say 'yes please i want to just link ubsan into everything without the trap' (options = ["fullubsan"]), but still with the same -fsanitize arg (i.e. not full ubsan, just the same thing we already pass for int) so it's fewer steps to get some info that doesn't involve manually building the project or needing to guess what tool_flags to pass (without deleting those cbuild lines the list of stuff to pass is impossible to remember)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant