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

Web REPL frozen by single token expressions. #416

Closed
pygy opened this issue Feb 20, 2012 · 17 comments
Closed

Web REPL frozen by single token expressions. #416

pygy opened this issue Feb 20, 2012 · 17 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@pygy
Copy link
Contributor

pygy commented Feb 20, 2012

On OS X 10.6.8, 32-bi CPU.

After launching launch-server, the web UI works fine and you get the julia> prompt. However, if you try to evaluate an expression, you don't get any answer. If you reload the page, or try to open another one, it takes ages to get past the <initializing> stage. You can still change the color theme.

The activity of julia-server shoots even higher than reportred in #300 (~ one full core).

I get the following error at the console:

2012-02-20 15:37:20: (network_writev.c.115) writev failed: Socket is not connected 6

@ghost ghost assigned stepchowfun Feb 20, 2012
@ViralBShah
Copy link
Member

@boyers would you be able to look into this?

@ViralBShah
Copy link
Member

Would this have anything to do with the firewall on OS X, in case it is enabled?

@BinarySplit
Copy link

I'm running the latest Git source(3c3e0ae) on a Kubuntu machine.
Expressions and function calls work correctly for me; but, if I hit enter after only typing a single word, number, etc. then it freezes.
Examples:

julia> 1+2         #works correctly
julia> 1           #freezes
julia> +1          #works correctly
julia> 2b          #works correctly(assuming b is defined)
julia> b           #freezes(regardless of whether b is defined)
julia> Array     #freezes

It appears that if there is only a single "token", the web interface will freeze. Reloading the page fixes it(after about 5 seconds of ).

@ViralBShah
Copy link
Member

Yes, just putting the single token makes it freeze for me too.

@pygy
Copy link
Contributor Author

pygy commented Feb 21, 2012

That's what I'm experiencing too, actually.

Since the most simple test didn't work, I didn't investigate more complex ones.

@ViralBShah
Copy link
Member

The more complex stuff works. Sigh.

-viral

On 21-Feb-2012, at 5:14 PM, pygy wrote:

That's what I'm experiencing too, actually.

Since the most simple test didn't work, I didn't investigate more complex ones.


Reply to this email directly or view it on GitHub:
#416 (comment)

@6e441f9c
Copy link

Hm, the bug seems to be quite obvious after a few debugging statements added... Single-token expr gets parsed to this token, not to a full Expr structure, so 1.head leads to an error.

@6e441f9c
Copy link

--- ui/webserver/julia_web_base.jl      2012-04-11 13:49:40.840746107 +0400
+++ ui/webserver/julia_web_base.jl      2012-04-11 13:49:41.840746107 +0400
@@ -127,13 +127,15 @@
             end
             __all_nothing = false

+            __expr_multitoken = isa(__expr, Expr)
+            
             # stop now if there was a parsing error
-            if __expr.head == :error
+            if __expr_multitoken && __expr.head == :error
                 return __write_message(__Message(__MSG_OUTPUT_PARSE_ERROR, {__expr.args[1]}))
             end

             # if the expression was incomplete, just keep going
-            if __expr.head == :continue
+            if __expr_multitoken && __expr.head == :continue
                 continue
             end

@StefanKarpinski
Copy link
Member

Ah, nice catch. Can you make a pull request?

@6e441f9c
Copy link

I know Git exactly enough to hate it... Isn't it quicker to just apply the patch in this case? Looks like a trivial typo-fix, not worth a review or pull request or attribution or anything.

@StefanKarpinski
Copy link
Member

I guess, but in general that makes me do more work so that you can do less work, which doesn't scale very well since there are more contributors to open source projects than there are maintainers.

@StefanKarpinski
Copy link
Member

Also, this isn't even a valid patch fragment because the first line of the diff is missing, meaning that git and patch won't accept it. This makes it even more work for me: I either have to try to reconstruct the missing diff line in such a manner that git/patch will accept it, or I have to make the edit by hand, which although not terribly difficult in this case is tedious and error-prone.

@6e441f9c
Copy link

It was a correct "patch" patch, just not a "git patch" patch.

Created a fork, I guess I will do a few things where creating pull request is less work than the code itself sooner or later.

@StefanKarpinski
Copy link
Member

Git's not so bad, even after just a little experience using it. And having a powerful distributed version control system completely changes the way you work after you get used to it. Your patch is much appreciated in any case.

@6e441f9c
Copy link

I have used Bazaar, Mercurial, Monotone, Subversion and Git. I am keeping an eye on Veracity (just in case) and Fossil. Of all those, I hate only Git.

@StefanKarpinski
Copy link
Member

Ah, well, in that case, I'm sure you have your reasons. I've tried all of those too — and Git is by far my favorite.

@stepchowfun
Copy link

Nice! This bug randomly cropped up a few months ago -- I'm guessing that parse_input_line used to return an expression or nothing, and it was modified to also return single tokens.

StefanKarpinski pushed a commit that referenced this issue Feb 8, 2018
This reverts commit 5ab47d1 due to
method ambiguities.

add at-compat for finalizer instead

at-compat finalizer
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Oct 11, 2021
cmcaine pushed a commit to cmcaine/julia that referenced this issue Nov 11, 2022
Keno pushed a commit that referenced this issue Oct 9, 2023
Fix a couple of new breakages on nightly
ViralBShah pushed a commit that referenced this issue Oct 16, 2023
Stdlib: SparseArrays
URL: https://github.com/JuliaSparse/SparseArrays.jl.git
Stdlib branch: main
Julia branch: master
Old commit: 4e6776a
New commit: 0f8bbda
Julia version: 1.11.0-DEV
SparseArrays version: 1.11.0
Bump invoked by: @ViralBShah
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaSparse/SparseArrays.jl@4e6776a...0f8bbda

```
$ git log --oneline 4e6776a..0f8bbda
0f8bbda Interpolate SparseVector in display test (#455)
d884072 Merge pull request #427 from JuliaSparse/jishnub/sparsevecshow
9e68b7e Merge branch 'main' into jishnub/sparsevecshow
12a1c30 remove unnecessary inequality change
4217641 don't set Documenter compat
e86b148 Adapt to Documenter v1 (#444)
8c72535 Merge branch 'main' into jishnub/sparsevecshow
8c20ba1 Test for truncation
8f925f8 Interpolate Int in expected string
c53e1f2 interpolate struct in display test
33d4bf5 Undef show with MIME text/plain
034d234 Hook into new factorization dispatch mechanisms (#437)
248d0e6 Merge branch 'main' into jishnub/sparsevecshow
713ab9b Fix documentation of `findall` behaviour (#452)
cb9b31f rowvals instead of nonzeroinds
05ac950 Add example for UMFPACK control vector (#449)
605237e Add JL_UMFPACK_PIVOT_TOLERANCE to umfpack.jl (#447)
5dac134 Use a single header wrapper for all platforms. (#446)
47e26dd Explicit types in test RHS
c123952 Interpolate vectors in show test
b309da7 Explicit types
d21fc79 Add test for showing a vector of sparsevec
3e918e4 Restore unfilled sparsevec display
b533818 Don't add SparseArrays to docs/Project.toml
4449100 Remove commented out method
728e116 ignore docs/build
99a0db2 Merge show methods
ac5c8ed Switch from internal 5-arg `searchsorted*` methods to views (#440)
ada9edd sparse vector views remain sparse (#416)
c93065c Improved the dot product between two vectors and a sparse matrix (#410)
2fae1a1 Correctly set zeros with `fill!(::SubArray)` and fix its return value (#433)
03ed9e3 Code quality cleanup (#438)
559a74e Merge branch 'main' into jishnub/sparsevecshow
8944160 fix empty show
e72223d One-line show for SparseVector
```

Co-authored-by: Dilum Aluthge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants