LubosD / twinkle

Qt 5 port of Twinkle

Home Page:http://twinkle.dolezel.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't close and continues running keeping the cpu at 100%

mantinan opened this issue · comments

Hi!

This doesn't happen all the time, but from time to time I see this...

Firewall/NAT discovery in progress.
Please wait.

Twinkle 1.10.3, February 18, 2022
Copyright (C) 2005-2015 Michel de Boer and contributors

Users:

  • XXXXX
    XXXXX sip:XXXX@server:5060

Local IP: 255.255.255.255

XXXXX: registering phone...

Twinkle>
XXXXX: registration succeeded (expires = 600 seconds)
Registrar Date: Thu, 03 Nov 2022 21:34:11 GMT

call #22#
Twinkle>
Line 1: received 100 Trying

warning: The VAD has been replaced by a hack pending a complete rewrite

Line 1: far end supports DTMF telephone event.

Line 1: far end answered call.
200 OK
To: sip:#22#@server:5060

bye

Line 1: call ended.

Program doesn't end and cpu is at 100%, this was a test run right now on the console using latest git as of now.

Maybe I can provide some more info if you tell me what to do.

Regards.

Program doesn't end

Just to be clear, Twinkle will keep running after hanging up, and will only exit with a QUIT command. (I admit it's not made very clear, since the input prompt get swallowed by the previous output.) Is Twinkle responsive after this? Does the call hang up properly without delay at the other end?

and cpu is at 100%

Okay, that is definitely a problem. I take it that this only occurs when hanging up, and that Twinkle does not gobble all the CPU during the entire call?

(Also, was that with twinkle-console or twinkle -c?)

Hi again!

Just to be clear, Twinkle will keep running after hanging up, and will only exit with a QUIT command.

I know, but the prompt doesn't return, so the quit cannot be issued.

(I admit it's not made very clear, since the input prompt get swallowed by the previous output.) Is Twinkle responsive after this?

Nope, like I've just said, the prompt doesn't return, ^C doesn't work, only a kill -HUP or -9 works to end it.

Does the call hang up properly without delay at the other end?

I don't really know, let me explain what I'm trying to do... this is usually run on cron with something like this:

(sleep 8;echo "call #22#";sleep 4;echo bye;sleep 1;echo quit)|twinkle -c

However it also happens on normal command line, in fact, on a manual test, not scripted, right now we can see...

Twinkle> call #22#
Twinkle>
Line 1: received 100 Trying

warning: The VAD has been replaced by a hack pending a complete rewrite

Line 1: far end supports DTMF telephone event.

Line 1: far end answered call.
200 OK
To: sip:#22#
@server:5060

Twinkle>
Line 1: call ended.

Twinkle> bye

As you can see the call was terminated by the remote, then I typed bye, I cannot issue a quit as the prompt doesn't return.

I'm wondering if this may have something to do with audio (I cannot hear audio from the call right now) but to my knowledge there is no way to tell twinkle not to use audio, or do you have one?

Machine runs pulseaudio and when seen twinkle's activity on pavucontrol I can see it reproducing and recording audio through alsa's plugin, in case this matters.

and cpu is at 100%

Okay, that is definitely a problem. I take it that this only occurs when hanging up, and that Twinkle does not gobble all the CPU during the entire call?

Yes, the CPU is at 100% during all the call, or at least it starts shortly after the call starts

(Also, was that with twinkle-console or twinkle -c?)

This was twinkle -c.

I don't know what else to add, please ask for any info you see valuable.

Regards.

(sleep 8;echo "call #22#";sleep 4;echo bye;sleep 1;echo quit)|twinkle -c

(For the record, this works fine over here, so the command itself is not at fault.)

Twinkle> Line 1: call ended.
Twinkle> bye

As you can see the call was terminated by the remote, then I typed bye, I cannot issue a quit as the prompt doesn't return.

Interesting. Since the line is already hung up, the BYE should be a no-op and return right away, which probably indicates that Twinkle was already stuck at that point. If you were to type '?' instead, I suspect you wouldn't get a response either, correct? (And what about during the call? Is Twinkle still responsive then?)

I'm wondering if this may have something to do with audio (I cannot hear audio from the call right now)

Oh, then it's possible that something went wrong from the very beginning of the call, and that the freeze is merely a consequence of that.

but to my knowledge there is no way to tell twinkle not to use audio, or do you have one?

Not directly, but ALSA provides a null device that discards any sound played through it; you can set all three devices to "ALSA: other device" and "null" with the GUI, or use alsa:null in the config file.

Machine runs pulseaudio

Ah, Twinkle is known for having issues with PA (#161) -- though I don't think I've ever seen "100% CPU usage" as one of them...

Hi!

Interesting. Since the line is already hung up, the BYE should be a no-op and return right away, which probably indicates that Twinkle was already stuck at that point. If you were to type '?' instead, I suspect you wouldn't get a response either, correct? (And what about during the call? Is Twinkle still responsive then?)

I'm having trouble getting it to crash right now, thing is that I don't know what was making it crash, so I don't know how to trigger it.

I'm still thinking this is related to audio, as I have set up a null alsa device for the script and since then... it hasn't crashed.

Not directly, but ALSA provides a null device that discards any sound played through it; you can set all three devices to "ALSA: other device" and "null" with the GUI, or use alsa:null in the config file.

Thanks for the tip.

Ah, Twinkle is known for having issues with PA (#161) -- though I don't think I've ever seen "100% CPU usage" as one of them...

I'm sorry I cannot provide any more info on this, if I ever get it to hang I'll try to get more info on it.

Regards.