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

Displaying a table with a BigDecimal column crashes the web UI #1607

Closed
jcferretti opened this issue Nov 27, 2021 · 3 comments
Closed

Displaying a table with a BigDecimal column crashes the web UI #1607

jcferretti opened this issue Nov 27, 2021 · 3 comments
Assignees
Labels
bug Something isn't working triage
Milestone

Comments

@jcferretti
Copy link
Member

The following code crashes the web UI:

import deephaven.Types as dh
import jpy
jbigdecimal = jpy.get_type('java.math.BigDecimal')
t = dh.table_of([[jbigdecimal.valueOf(301, 2)], [jbigdecimal.valueOf(201,2)], [jbigdecimal.valueOf(101,2)]], [('decimal_value', dh.bigdecimal)])

Visually it looks like the two window captures below; the display stays for a few seconds as the first one, then chrome sees it crash as per the second one.

Deephaven - Google Chrome_130

Deephaven - Google Chrome_131

@jcferretti jcferretti added bug Something isn't working triage labels Nov 27, 2021
@jcferretti jcferretti added this to the Nov 2021 milestone Nov 27, 2021
@niloc132
Copy link
Member

Not sure specifically why you're getting a sigkill (linux killing the chrome process for oom?).

#513 is the issue to track the server implementing BigDecimal/BigInteger - the client has an attempt at reading it, but without the server speaking the same language, I didn't put any real effort into it.

However, if the server encounters a type that it can't send, it can turn it into a string and send that instead. We have support for that on the server, but in this case the client is incorrectly only reading the deephaven:type metadata and not checking the actual arrow type for the buffer. Right now this is unofficially part of #188, the rest of the js api's handling is "good enough".

Both of these should be resolve anyway, but handling either one will probably fix your issue. It would be worth trying to understand why chrome is getting its process killed though, to see if there is something else we can do to prevent it in general.

@jcferretti
Copy link
Member Author

jcferretti commented Nov 28, 2021

Not sure specifically why you're getting a sigkill (linux killing the chrome process for oom?).

Note the signal is SIGILL (Illegal Instruction), not SIGKILL (Kill signal). Which arguably makes it even weirder.
Thanks for the details and the reference issues, I'll take a peek at adding an InputStreamGenerator (per issue #513) for a decilmal128 equivalent type. There is an issue having to do with no perfect mapping for an arrow decimal type and DH's use of Java's BigDecimal: arrow decimal type is not one type but a family of decimal(precision,scale,bitwidth) types, where bitwidth is either 128 or 256, and precision is compatible with that; so some amount of guessing and hacking here is going to be required; what I am thinking here is essentially fitting a subset of the possible BigDecimals, which are likely the most common ones (eg, quantities representing amounts of currency), and a minimally user friendly way to blow up when you have actual data that can't be mapped, eg, a BigDecimal that has a huge precision that doesn't fit etc.

@niloc132
Copy link
Member

Yikes you're right. And you were right, I should have waited until monday to look at this.

My brain replaced IG with somthing like K, while still leaving in the I and the G along the way. It would be nice to know what abuse of typedarrays is causing chrome to crash though, instead of a JS runtime error...

My best guess was that by misreading the flight schema I was allocating too much space and the JS runtime was crashing out rather than listen to me, but I'm not so sure now.

mofojed pushed a commit that referenced this issue Nov 3, 2023
Release notes https://github.com/deephaven/web-client-ui/releases/tag/v0.53.0

# [0.53.0](deephaven/web-client-ui@v0.52.0...v0.53.0) (2023-11-03)


### Bug Fixes

* DH-15864: Scroll position StuckToBottom shouldn't trigger sharing dot ([#1617](deephaven/web-client-ui#1617)) ([3d4499b](deephaven/web-client-ui@3d4499b))
* Panel focus throwing an exception ([#1609](deephaven/web-client-ui#1609)) ([9e8b7ae](deephaven/web-client-ui@9e8b7ae))
* Plugins were re-registering on every re-render ([#1613](deephaven/web-client-ui#1613)) ([5977389](deephaven/web-client-ui@5977389))


### Features

* Add support for multi-partition parquet:kv tables ([#1580](deephaven/web-client-ui#1580)) ([d92c91e](deephaven/web-client-ui@d92c91e)), closes [#1143](deephaven/web-client-ui#1143) [#1438](deephaven/web-client-ui#1438)
* Babel Plugin - Mock css imports ([#1607](deephaven/web-client-ui#1607)) ([787c542](deephaven/web-client-ui@787c542)), closes [#1606](deephaven/web-client-ui#1606)
* Convert DashboardPlugins to WidgetPlugins ([#1598](deephaven/web-client-ui#1598)) ([a260842](deephaven/web-client-ui@a260842)), closes [#1573](deephaven/web-client-ui#1573)


### Reverts

* "fix: stuck to bottom on filter clear" ([#1616](deephaven/web-client-ui#1616)) ([806a6b6](deephaven/web-client-ui@806a6b6)), closes [deephaven/web-client-ui#1579](deephaven/web-client-ui#1579) [#1615](deephaven/web-client-ui#1615)

Co-authored-by: deephaven-internal <deephaven-internal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants