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

[CRASH] when loading a big map #4433

Closed
hiiamboris opened this issue May 7, 2020 · 3 comments
Closed

[CRASH] when loading a big map #4433

hiiamboris opened this issue May 7, 2020 · 3 comments
Assignees
Labels
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

@hiiamboris
Copy link
Collaborator

Describe the bug

load https://raw.githubusercontent.com/hiiamboris/whatever/master/idx

*** Runtime Error 1: access violation
*** in file: /D/devel/red/red-src/red/runtime/hashtable.reds
*** at line: 61
***
***   stack: red/hash-string 02E3BBC0h false
***   stack: red/_hashtable/hash-value 02E3BBC0h false
***   stack: red/_hashtable/get 0222BFB8h 02E3BBC0h 0 0 2 false false
***   stack: red/_hashtable/put-all 0222BFB8h 0 2
***   stack: red/_hashtable/init 966 02B3B460h 1 1
***   stack: red/map/make-at 02B3B460h 02B3B460h 966
***   stack: red/lexer/scan-paren-close 0018FAF0h 0AE3E14Dh 0AE3E14Dh 0 true
***   stack: red/lexer/scan-tokens 0018FAF0h false false
***   stack: red/lexer/scan 02A89384h 0AE10028h 15148892 false true true false 0018FBE4h 00000000h 02A89374h
***   stack: red/natives/transcode* true -1 -1 -1 -1 -1 -1 -1
***   stack: load
***   stack: red/_function/call 02A891D4h 003D3884h
***   stack: red/interpreter/eval-code 02A891D4h 02DC8940h 02DC8940h false 00000000h 00000000h 02B703F8h
***   stack: red/interpreter/eval-expression 02DC8930h 02DC8940h false false false
***   stack: red/interpreter/eval 02A891B4h true
***   stack: red/natives/catch* true 1
***   stack: ctx||528~try-do 003F1FACh
***   stack: ctx||528~do-command 003F1FACh
***   stack: ctx||528~eval-command 003F1FACh
***   stack: ctx||528~run 003F1FACh
***   stack: ctx||528~launch 003F1FACh
***   stack: ctx||561~launch 003F1700h

The bug is random, starts at ~2000 lines but depends on the build. Then the more lines are there the more chances of it crashing.

To reproduce

Download the file locally so it loads fast.
On master it may take minutes to load, so not viable for testing.

Platform version (please complete the following information)

Red 0.6.4 for Windows built 7-May-2020/22:50:22+03:00
master & fast-lexer

Build #4097 doesn't crash

@greggirwin
Copy link
Contributor

>> s: read https://raw.githubusercontent.com/hiiamboris/whatever/master/idx
== {#(^/    "Red" #(^/        %1.red [1]^/        %1.reds [1]^/        %2.red [1]^/        %2.reds [1]^/        %4.red [1]^/      ...
>> length? s
== 15148830
>> format-bytes length? s
== "14MiB"

Nice stress test. Crash reproduced here.

@qtxie
Copy link
Contributor

qtxie commented May 8, 2020

It's a GC issue, no crashes if turn off the GC.

@hiiamboris Did you merge #4097 into fast-lexer or just use a build from #4097?

@hiiamboris
Copy link
Collaborator Author

hiiamboris commented May 8, 2020

@qtxie the latter. I have that build stashed for testing purposes. Actually, just tested: the master build from Oct 18, 2019 doesn't crash either, so disregard that - I doubt that build contains a fix.

@qtxie qtxie self-assigned this May 9, 2020
@qtxie qtxie added the type.bug Ticket describes an abnormal behavior, not conforming to the specs or expectation. label May 9, 2020
qtxie added a commit that referenced this issue May 9, 2020
Marks values in lexer's buffer.
@qtxie qtxie added the status.built A change in codebase has been done to address the ticket. label May 9, 2020
dockimbel pushed a commit that referenced this issue May 16, 2020
Marks values in lexer's buffer.
@qtxie qtxie added this to the 0.6.5 milestone May 18, 2020
@qtxie qtxie added the status.tested The change in code has been manually tested and verified to fix the issue. label May 29, 2020
@qtxie qtxie closed this as completed May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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