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

Segmentation fault on "this.tdlib.td_json_client_receive.async" #18

Closed
panda2048 opened this issue Jun 2, 2018 · 10 comments
Closed

Segmentation fault on "this.tdlib.td_json_client_receive.async" #18

panda2048 opened this issue Jun 2, 2018 · 10 comments

Comments

@panda2048
Copy link

panda2048 commented Jun 2, 2018

I just get the td lib built and trying on the sample
But I got segmentation fault even if I only new Client as below

const client = new Client({
apiId: 'YOUR_API_ID',
apiHash: 'YOUR_API_HASH',
phoneNumber: 'YOUR_PHONE_NUMBER',
})

And I go in the src and add some log to troubleshoot
I found that it is crashed after a few run of _recieve and end up in this.tdlib.td_json_client_receive.async
Is there any clue of how to resolve this issue?

_receive(timeout = 10) {
return new Promise((resolve, reject) => {
if (!this.client) {
return reject(new ClientNotCreatedError)
}
console.log(10)
this.tdlib.td_json_client_receive.async(this.client, timeout, (err, response) => {
console.log(11)
if (err) {
console.log(12)
return reject(err)
}
console.log(13)
if (!response) {
return resolve(null)
}
console.log(14)
resolve(JSON.parse(response))
})
})
}

@nodegin
Copy link
Owner

nodegin commented Jun 2, 2018

What Node.js version you currently using?

Also, please provide what OS, version you try to run with.

@panda2048
Copy link
Author

I am running node 10.1 in linux (Amazon aws)

Btw, I am doing some troubleshoot too
It crashed after “authorizationStateWaitEncryptionKey”
Seems it never goes into state for Auth code, etc

Some logs I added in Client.js to show where it dies below

loop updateAuthorizationState
auth: authorizationStateWaitTdlibParameters
loop updateAuthorizationState
auth: authorizationStateWaitEncryptionKey
loop ok
Segmentation fault

@nodegin
Copy link
Owner

nodegin commented Jun 2, 2018

Have you try other libraries in Node.js or other programming languages?

It looks the TDLib is not ready for Linux.. I think you need to open an issue in tdlib/td

@panda2048
Copy link
Author

panda2048 commented Jun 3, 2018

There is tg_cli (executable) in the tdlib build
But it is working fine

I tried another lib before but that seems to be outdated And missing message from channels

@eilvelia
Copy link

eilvelia commented Jun 3, 2018

@panda2048 What it prints with verbosityLevel 10?

@panda2048
Copy link
Author

@Bannerets I changed verbosityLevel to 10 inside Client.js but nothing new are printed
Am I changing it in the right place?

@eilvelia
Copy link

eilvelia commented Jun 3, 2018

@panda2048 You can change verbosityLevel in options:

const client = new Client({
  apiId: 'YOUR_API_ID',
  apiHash: 'YOUR_API_HASH',
  phoneNumber: 'YOUR_PHONE_NUMBER',
  verbosityLevel: 10,
})

@panda2048
Copy link
Author

@Bannerets still the same, no other message other than segmentation fault

@nodegin
Copy link
Owner

nodegin commented Jun 3, 2018

@panda2048 Please check the logs.txt located in __tglib__ for version 1.3 or above, otherwise check _td_logs.txt for logs.

@nodegin
Copy link
Owner

nodegin commented Jun 3, 2018

The TDlib messages are saved in separate text file and not displayed on console directly in order to avoid the pollution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants