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

Uncaught null in Chrome Inspector #6270

Closed
radeusgd opened this issue Apr 13, 2023 · 7 comments
Closed

Uncaught null in Chrome Inspector #6270

radeusgd opened this issue Apr 13, 2023 · 7 comments
Assignees
Labels
--bug Type: bug -compiler -tooling Category: tooling

Comments

@radeusgd
Copy link
Member

I was able to get an error in the Chrome Inspector REPL when debugging an Enso script.

The repro is following:

Run the following script (I called it too-many-warnings.enso) with the --inspect option:

from Standard.Base import all
from Standard.Table import Table, Value_Type
from Standard.Database import Database, SQLite, In_Memory

main =
    c = Database.connect (SQLite In_Memory)
    t0 = Table.new [["X", ["a", "bc", "def"]]]
    t1 = c.upload_table "Tabela" t0
    t2 = t1.cast "X" (Value_Type.Char size=1)
    t2.print
    warnings = Warning.get_all t2 . map .value
    IO.println warnings.length
    IO.println warnings.first
    IO.println warnings.distinct.length

Set a breakpoint at line 10: t2.print and run up to this line.

When in this line, observe the following interaction in the REPL:

> t1.at "X" . value_type
  <- Value_Type (Char Nothing True)
> t2.at "X" . value_type
  <- Uncaught null
    at too-many-warnings.main (Unknown)

image

@radeusgd
Copy link
Member Author

This does not work if I just Warning.attach a warning and try to call methods on it. Something more subtle is going on here, and I don't know what exactly.

I won't be surprised if this is related to #6258.

@radeusgd
Copy link
Member Author

radeusgd commented Aug 7, 2023

Confirmed can still reproduce as of today.

Just small modifications to the repro code needed to update to changes:

from Standard.Base import all
from Standard.Table import Table, Value_Type
from Standard.Database import Database, SQLite, In_Memory

main =
    c = Database.connect (SQLite In_Memory)
    t0 = Table.new [["X", ["a", "bc", "def"]]]
    t1 = t0.select_into_database_table c "Table1"
    t2 = t1.cast "X" (Value_Type.Char size=1)
    t2.print
    warnings = Warning.get_all t2 . map .value
    IO.println warnings.length
    IO.println warnings.first
    IO.println warnings.distinct.length

yielding:
image

@JaroslavTulach
Copy link
Member

I am getting following error when I try to execute the snippet:

Execution finished with an error: Method `upload_table` of type SQLite_Connection could not be found.
        at <enso> w.main(w.enso:8:10-35)

I am using 2023.2.1-nightly.2023.8.8.

@radeusgd
Copy link
Member Author

radeusgd commented Aug 8, 2023

I am getting following error when I try to execute the snippet:

Execution finished with an error: Method `upload_table` of type SQLite_Connection could not be found.
        at <enso> w.main(w.enso:8:10-35)

I am using 2023.2.1-nightly.2023.8.8.

Right, I somehow pasted the wrong (old) snippet, I don't know how I mixed them up. Updated with up-to-date snippet (upload_table was obsoleted and replaced by select_into_database_table).

@JaroslavTulach
Copy link
Member

Yesterday I was able to reproduce the problem. Today I upgraded to 59329bd and it seems to be working fine:

image

Given there are just three fixes in between

$ git log 2023.2.1-nightly.2023.8.8...59329bd59aeacc4f60ccc4ef323dfaf6629c7710
commit 59329bd59aeacc4f60ccc4ef323dfaf6629c7710 (HEAD -> develop, origin/develop, origin/HEAD)
    New Top Bar
commit b656b336c7d239ef95a548f87deb5af2f4801368
Author: Radosław Waśko <[email protected]>
    Report `Loss_Of_Integer_Precision` when an integer is not exactly representable as a float during conversion
commit 05e8aade1f5586f011b4943ba9fb4fa221405a56
Author: Jaroslav Tulach <[email protected]>
Date:   Tue Aug 8 11:18:38 2023 +0200
    Exclusive context policy ensures EnsoContext.get returns compilation constant (#7493)

and most of #7493 actually focuses on fixing getRootNode() for many @ExportedLibrary nodes. I'd say this issue is fixed by a collateral goodness of #7493.

@github-project-automation github-project-automation bot moved this from 📤 Backlog to 🟢 Accepted in Issues Board Aug 9, 2023
@radeusgd
Copy link
Member Author

radeusgd commented Aug 9, 2023

I'd say this issue is fixed by a collateral goodness of #7493.

Awesome 🎉 and thanks for checking!

@enso-bot
Copy link

enso-bot bot commented Aug 10, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-08-09):

Progress: - Fixed NPE while debugging: #6270

Next Day: Python interop & bugfixes

Discord
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler -tooling Category: tooling
Projects
Archived in project
Development

No branches or pull requests

4 participants