{"id":15598014,"url":"https://github.com/ibob/ubsan-fp","last_synced_at":"2026-01-27T12:37:01.228Z","repository":{"id":145864099,"uuid":"270624468","full_name":"iboB/ubsan-fp","owner":"iboB","description":"A false positive in the undefined behavior sanitizer (pre clang 9)","archived":false,"fork":false,"pushed_at":"2020-06-08T11:24:08.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T14:56:02.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iboB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-08T10:24:27.000Z","updated_at":"2020-06-08T11:25:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"54b52729-7fbe-4671-952a-a5f63993fb6d","html_url":"https://github.com/iboB/ubsan-fp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fubsan-fp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fubsan-fp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fubsan-fp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fubsan-fp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iboB","download_url":"https://codeload.github.com/iboB/ubsan-fp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247909136,"owners_count":21016475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T01:26:13.205Z","updated_at":"2026-01-27T12:37:01.222Z","avatar_url":"https://github.com/iboB.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ubsan-fp\n\n**It seems this false positive has been fixed in clang 9. It can be reporduced in previous versions**\n\nA false positive in the undefined behavior sanitizer\n\n## Repro steps\n\n* Have a shared library which exports a type `argument`\n    * In this example this library is `core`\n* Have another shared library which produces a function pointer to a function which takes `argument` as an argument\n\t* In this example this library is `other` through the function `get_fptr`\n* In a third library or an executable get the function pointer and invoke it\n* Receive a false positive undefined behavior error from ubsan:\n\n```\nexecutable.cpp:5:5: runtime error: call to function (unknown) through pointer to incorrect function type 'void (*)(argument *)'\n(libotherlib.so+0x9e0): note: (unknown) defined here\nSUMMARY: UndefinedBehaviorSanitizer: executable.cpp:5:5 in\n```\n\n## Checked invariants\n\n* How I produce the pointer doesn't seem to matter. I get the same error with a static free function and a captureless lambda.\n* `argument` needs to be defined in a shared library which is not the one that produces the function pointer. If we move the definition and export of `argument` to `other` there is no error from ubsan\n* Whether the definition of `argument` is available to the call site (executable) doesn't seem to matter. I get the same error with or without including `corelib.hpp`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibob%2Fubsan-fp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibob%2Fubsan-fp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibob%2Fubsan-fp/lists"}