openframeworks / openframeworks/openFrameworks
ofColor undefined behavior
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
today I was analyzing code in XCode with address sanitizer on, undefined behavior sanitizer and it indicates an UB on ofColor
ofColor.cpp:172:7: runtime error: 2.14748e+09 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:172:7 in
ofColor.cpp:173:7: runtime error: 2.14748e+09 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:173:7 in
ofColor.cpp:174:7: runtime error: 2.14748e+09 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:174:7 in
ofColor.cpp:175:7: runtime error: 2.14748e+09 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:175:7 in
ofColor.cpp:172:7: runtime error: 4.29497e+09 is outside the range of representable values of type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:172:7 in
ofColor.cpp:173:7: runtime error: 4.29497e+09 is outside the range of representable values of type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:173:7 in
ofColor.cpp:174:7: runtime error: 4.29497e+09 is outside the range of representable values of type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:174:7 in
ofColor.cpp:175:7: runtime error: 4.29497e+09 is outside the range of representable values of type 'unsigned int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:175:7 in
ofColor.cpp:172:7: runtime error: 9.22337e+18 is outside the range of representable values of type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:172:7 in
ofColor.cpp:173:7: runtime error: 9.22337e+18 is outside the range of representable values of type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:173:7 in
ofColor.cpp:174:7: runtime error: 9.22337e+18 is outside the range of representable values of type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:174:7 in
ofColor.cpp:175:7: runtime error: 9.22337e+18 is outside the range of representable values of type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:175:7 in
ofColor.cpp:172:7: runtime error: 1.84467e+19 is outside the range of representable values of type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:172:7 in
ofColor.cpp:173:7: runtime error: 1.84467e+19 is outside the range of representable values of type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:173:7 in
ofColor.cpp:174:7: runtime error: 1.84467e+19 is outside the range of representable values of type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:174:7 in
ofColor.cpp:175:7: runtime error: 1.84467e+19 is outside the range of representable values of type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ofColor.cpp:175:7 in
setFbo
and another one in ofGLProgrammableRenderer::draw
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining ofColor.cpp around lines 172–175 and the setFbo path, then inspect the reported ofGLProgrammableRenderer::draw location. Reproduce the issue with XCode AddressSanitizer and UndefinedBehaviorSanitizer enabled, and determine the inputs that trigger the reported out-of-range conversions. Done means the sanitizer reports no undefined behavior in these paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100