B4J Question terminate called after throwing an instance of 'std::bad_alloc'

sunil thomas

Member
Licensed User
Longtime User
i used the same code in raspberry pi 2
in pc it is working fine
i am getting error while running in raspberry pi 3
in beginning it was working fine and suddenly start giving error
i reinstalled raspberry pi but the problem exists
giving error at
astream.Initialize(myserial.GetInputStream,myserial.GetOutputStream,"astream")

output
Waiting for debugger to connect...
Program started.
Started
1 a
1 b
/dev/ttyAMA0
1 c
1 d
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

************************************************
Program part

Sub AppStart (Args() As String)

Log("Started")
myserial.Initialize("")
Log("1 a")
uart_list = myserial.ListPorts
Log("1 b")
myserial.Open(uart_list.Get(0))
Log(uart_list.Get(0))
Log("1 c") myserial.SetParams(9600,8,1,0)
Log("1 d")
astream.Initialize(myserial.GetInputStream,myserial.GetOutputStream,"astream")
Log("1 e")
 

sunil thomas

Member
Licensed User
Longtime User
i tried some other programs and also give the same error in
astream.Initialize(myserial.GetInputStream,myserial.GetOutputStream,"astream")
if i changed to
astream.Initialize(myserial.GetInputStream,NULL,"astream")
then same error at the next line
i thing the problem is with the serial lib jserial 1.2
and my pi 3 is fresh installation and only apache server is running other than b4j-bridge
 
Upvote 0
Top