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

serialize()\deserialize() crashes #16746

Closed
tmptrash opened this issue Jun 3, 2016 · 0 comments
Closed

serialize()\deserialize() crashes #16746

tmptrash opened this issue Jun 3, 2016 · 0 comments
Labels
parallelism Parallel or distributed computation

Comments

@tmptrash
Copy link

tmptrash commented Jun 3, 2016

Good evening.

I have been working on serialization logic in my app last week and i found an asynchronous crashes in one of these two functions - serialize()/deserialize(). It somehow related to amount of requests and amount of data, which goes through socket. Because, if i send few data using my Client/Server modules, it works fine. So, on a high level i have a Server and Client modules, which do the job. Here is a server side:

include("../src/ImportFolders.jl")

import Config
import Server
import Connection
import Event
import Helper

function onBeforeResponse(sock::Base.TCPSocket, cmd::Connection.Command, ans::Connection.Answer)
  # this is response data for client
  ans.data = Array{Float64, 1}(100)
  # just server to client requests with some custom (Helper.Point) data to produce the issue
  for i = 1:1000 Server.request(sock, 1, Helper.Point(rand(1:200), rand(1:200))) end
end

con = Server.create(ip"127.0.0.1", 2000)
Event.on(con.observer, Server.EVENT_BEFORE_RESPONSE, onBeforeResponse)
Server.run(con)

I run it in command line like this:

julia -i --color=yes tmp\AppServerTest.jl

The client:

include("../src/ImportFolders.jl")

import Config
import Client
import Connection
import Event
import Helper

function _onBeforeResponse(data::Connection.Command, ans::Connection.Answer)
  # just some answer data for server
  ans.data = Array{Int, 1}(20)
end

con = Client.create(ip"127.0.0.1", Config.val(:CONNECTION_SERVER_PORT))
Event.on(con.observer, Client.EVENT_BEFORE_RESPONSE, _onBeforeResponse)

I run this using this command line:

julia -i --color=yes tmp\AppClientTest.jl

After correct running of client and server i use this commands on a client side:

Client.request(con, 1, 2)
Client.request(con, 1, 2)
Client.request(con, 1, 2)

They produce these errors on a server side.

julia> WARNING: Server._answer(): BoundsError(Any[Symbol,Int8,UInt8,Int16,UInt16,Int32,UInt32,Int64,UInt64,Int128,UInt128,Float32,Float64,Char,Ptr{T},DataType,Union,Function,Tuple,Array{T,N
},Expr,Symbol,Tuple,Expr,LineNumberNode,SymbolNode,LabelNode,GotoNode,QuoteNode,TopNode,TypeVar,Box,LambdaStaticData,Module,Symbol,Task,ASCIIString,UTF8String,UTF16String,UTF32String,Float1
6,SimpleVector,Symbol,:reserved11,:reserved12,(),Bool,Any,:Any,Union{},:reserved21,:reserved22,Type{T},:Array,:TypeVar,:Box,:lambda,:body,:return,:call,:(::),:(=),:null,:gotoifnot,:A,:B,:C,
:M,:N,:T,:S,:X,:Y,:a,:b,:c,:d,:e,:f,:g,:h,:i,:j,:k,:l,:m,:n,:o,:p,:q,:r,:s,:t,:u,:v,:w,:x,:y,:z,:add_int,:sub_int,:mul_int,:add_float,:sub_float,:mul_float,:unbox,:box,:eq_int,:slt_int,:sle
_int,:ne_int,:arrayset,:arrayref,:Core,:Base,svec(),Tuple{},:reserved17,:reserved18,:reserved19,:reserved20,false,true,nothing,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,
24,25,26,27,28,29,30,31,32],(0,))
BoundsError: attempt to access 157-element Array{Any,1}:
   Symbol
   Int8
   UInt8
   Int16
   UInt16
   Int32
   UInt32
   Int64
   UInt64
   Int128
   UInt128
   Float32
   Float64
   Char
   Ptr{T}
   DataType
   Union
   Function
   Tuple
   Array{T,N}
   Expr
  ?
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
  at index [0]WARNING: Server._answer(): MethodError(convert,(Tuple{Vararg{Int64}},symbol("")))
MethodError: `convert` has no method matching convert(::Type{Tuple{Vararg{Int64}}}, ::Symbol)
This may have arisen from a call to the constructor Tuple{Vararg{Int64}}(...),
since type constructors fall back to convert methods.
Closest candidates are:
  call{T}(::Type{T}, ::Any)
  convert{T}(::Type{Tuple{Vararg{T}}}, ::Tuple)

To be onest, there are many related to bugs to current, but this one is a most common. The same error sometimes occures on a client as well.

You may checkout my repo from https://github.com/tmptrash/jevo. I've tested this on a commit: da420f8e5f681ffcb2e291f16a770b06847aaf19

Thanks.

@ivarne ivarne added the parallelism Parallel or distributed computation label Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parallelism Parallel or distributed computation
Projects
None yet
Development

No branches or pull requests

3 participants