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

A CRASH when calling offset-to-caret inside a face actor. #5470

Closed
luce80 opened this issue Jan 23, 2024 · 1 comment
Closed

A CRASH when calling offset-to-caret inside a face actor. #5470

luce80 opened this issue Jan 23, 2024 · 1 comment
Assignees
Labels
GUI status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue. type.bug Ticket describes an abnormal behavior, not conforming to the specs or expectation.

Comments

@luce80
Copy link

luce80 commented Jan 23, 2024

Describe the bug
A CRASH when calling offset-to-caret inside a face actor.

To reproduce

view [base "hoi" ON-down [offset-to-caret face event/offset]]

Expected behavior
No crash.

Platform version

>> about/debug
-----------RED & PLATFORM VERSION----------- 
RED: [ branch: "master" tag: #v0.6.4 ahead: 5075 date: 22-Dec-2023/9:07:34 commit: #6cb7d502bcbfae8b00630adee6561909eee2b478 ]
PLATFORM: [ name: "Windows 11" OS: 'Windows arch: 'x86-64 version: 10.0.0 build: 22631 ]
--------------------------------------------
@dockimbel dockimbel added type.bug Ticket describes an abnormal behavior, not conforming to the specs or expectation. GUI labels Jan 23, 2024
@dockimbel
Copy link
Member

dockimbel commented Jan 23, 2024

Related call stack:

*** Runtime Error 98: assertion failed
*** in file: /C/dev/Red/runtime/datatypes/block.reds
*** at line: 51
***
***   stack: red/block/rs-head 05805228h
***   stack: gui/OS-text-box-metrics 05805228h 0545CBD4h 1
***   stack: ctx||475~text-box-metrics 0545CBC4h 0545CBD4h 1
***   stack: offset-to-caret
***   stack: red/interpreter/call 0545CB94h 04B73884h 0580B428h 0
***   stack: red/interpreter/eval-code 05545938h 0580B468h 0580B468h 0580B3C0h false 00000000h 00000000h 05545938h 0 false
...

There is not enough protection internally in calls to offset-to-caret function against inadequate face objects. In the above case, the face does not have a FACE_OBJ_EXT3 field, so an invalid memory is accessed instead, resulting in a crash.

@qtxie qtxie added status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue. labels Jan 24, 2024
@qtxie qtxie closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue. type.bug Ticket describes an abnormal behavior, not conforming to the specs or expectation.
Projects
None yet
Development

No branches or pull requests

3 participants