Dear Monks,

My apologies if I'm breaking a rule from your forum with this question.

I've been helping a github project asbru-cm / gtk3 branch, written en perl and gtk3.

The application is a connection manager for : ssh, rdp, telnet, etc. With some useful options like clustering connections.

Many years back known as PAC Manager

We have a very strange and challenging bug to solve, I have already spent 2 weeks and I'm not getting any closer to solve it.

I need some information on how to be able to debug this or guide me through the process, or If by any chance anyone has had a similar problem with the WINCH signal.

You may find the transcripts of the bug on this thread

Issue #232

The summary is this:

The original code located at : pac_conn
If I comment the following code, the application session does not dies, but we loose terminal resize functionality.

$SIG{'WINCH'} = sub { if (!$CONNECTED) { return 1; } while (! $EXP -> slave) { select(undef, undef, undef, 0.25); }; $EXP -> slave -> clone_winsize_from(\*STDIN); kill WINCH => $EXP -> pid if $EXP -> pid; };
The code comes from example use in the module Expect

I have used strace on the process that gets killed and this is what I got, but I do not see how to use the information to get closer to the problem.
During the first part I resize (enlarge) the window and it can be seen the terminal receives the SGWINCH signal and the size, correctly.
When I begin to shrink it, suddenly an IO/ERROR is genereted an the hup sugnal is sent to the terminal and closes.

I separated the lines to show the moment it happens.

strace: Process 1467 attached
21:01:07.691091 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:20.484590 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:20.484731 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:20.485366 ioctl(0, TIOCGWINSZ, {ws_row=25, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:20.485743 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:20.485844 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:20.670434 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:20.670485 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:20.670576 ioctl(0, TIOCGWINSZ, {ws_row=26, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:20.670644 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:20.670754 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:21.463879 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:21.463975 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:21.464092 ioctl(0, TIOCGWINSZ, {ws_row=27, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:21.464213 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:21.464488 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:22.121628 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:22.121696 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:22.121782 ioctl(0, TIOCGWINSZ, {ws_row=28, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:22.121878 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:22.121964 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:22.346570 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:22.346630 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:22.346702 ioctl(0, TIOCGWINSZ, {ws_row=29, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:22.346788 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:22.346867 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:23.782493 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:23.782719 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:23.782866 ioctl(0, TIOCGWINSZ, {ws_row=27, ws_col=82, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:23.782993 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:23.783095 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:23.784337 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:23.784411 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:23.784514 ioctl(0, TIOCGWINSZ, {ws_row=28, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:23.784624 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:23.785580 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:24.098243 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:24.098288 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:24.098342 ioctl(0, TIOCGWINSZ, {ws_row=27, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:24.098397 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:24.098449 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:24.657126 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:24.657237 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:24.657484 ioctl(0, TIOCGWINSZ, {ws_row=26, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:24.657886 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:24.658059 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:24.916138 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:24.916197 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:24.916302 ioctl(0, TIOCGWINSZ, {ws_row=25, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:24.916366 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:24.916417 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:25.176208 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:25.176274 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:25.176346 ioctl(0, TIOCGWINSZ, {ws_row=24, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:25.176417 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:25.176474 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:25.514431 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:25.514524 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:25.514629 ioctl(0, TIOCGWINSZ, {ws_row=23, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:25.514732 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:25.514823 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:25.883280 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:25.883326 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:25.883383 ioctl(0, TIOCGWINSZ, {ws_row=22, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:25.883487 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:25.883629 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:26.067849 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:26.067955 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:26.068159 ioctl(0, TIOCGWINSZ, {ws_row=21, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:26.068354 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:26.068517 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:26.333576 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:26.333677 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:26.333808 ioctl(0, TIOCGWINSZ, {ws_row=20, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:26.334101 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:26.334276 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:26.647874 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:26.647940 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:26.648061 ioctl(0, TIOCGWINSZ, {ws_row=18, ws_col=82, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:26.648157 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:26.648281 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:26.648731 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:26.648777 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:26.648844 ioctl(0, TIOCGWINSZ, {ws_row=19, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:26.648918 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:26.648989 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:26.960521 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:26.960644 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:26.960928 ioctl(0, TIOCGWINSZ, {ws_row=18, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:26.961082 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:26.961248 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:27.195750 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:27.195806 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:27.195886 ioctl(0, TIOCGWINSZ, {ws_row=17, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:27.195964 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:27.196030 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)
21:01:27.533598 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:27.533722 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:27.533870 ioctl(0, TIOCGWINSZ, {ws_row=16, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:27.534025 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:27.534167 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = ? ERESTARTNOHAND (To be restarted if no handler)


====================================
ERROR SHOWS AT THIS POINT
====================================


21:01:27.719245 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1460, si_uid=1000} ---
21:01:27.719345 rt_sigreturn({mask=[]}) = -1 EINTR (Llamada al sistema interrumpida)
21:01:27.719584 ioctl(0, TIOCGWINSZ, {ws_row=15, ws_col=85, ws_xpixel=0, ws_ypixel=0}) = 0
21:01:27.719733 write(2, "\r\33K\330;test@test-VirtualBox: ~\7"..., 82) = 82
21:01:27.719858 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0])
21:01:28.128019 read(0, 0x7ffce7ed958f, 1) = -1 EIO (Error de entrada/salida)
21:01:28.128066 ioctl(0, TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
21:01:28.128094 ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
21:01:28.128116 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
21:01:28.128138 rt_sigaction(SIGINT, {sa_handler=0x55d4bff0d9a0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, {sa_handler=0x55d4bff63590, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, 8) = 0
21:01:28.128276 rt_sigaction(SIGTERM, {sa_handler=0x55d4bff0d470, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f5d213e3470}, {sa_handler=0x55d4bff63590, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, 8) = 0
21:01:28.128319 rt_sigaction(SIGHUP, {sa_handler=0x55d4bff0dd60, sa_mask=HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS, sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, {sa_handler=0x55d4bff63590, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, 8) = 0
21:01:28.128382 rt_sigaction(SIGALRM, {sa_handler=0x55d4bff0dd60, sa_mask=HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS, sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, {sa_handler=0x55d4bff63590, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, 8) = 0
21:01:28.128440 rt_sigaction(SIGWINCH, {sa_handler=0x55d4bff0d460, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f5d213e3470}, {sa_handler=0x55d4bff629f0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f5d213e3470}, 8) = 0
21:01:28.128495 rt_sigaction(SIGINT, {sa_handler=0x55d4bff0d9a0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, {sa_handler=0x55d4bff0d9a0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, 8) = 0
21:01:28.128560 openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
21:01:28.128755 fstat(3, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0
21:01:28.128834 read(3, "# Locale name alias data base.\n#"..., 4096) = 2995
21:01:28.128925 read(3, "", 4096)       = 0
21:01:28.128975 close(3)                = 0
21:01:28.129029 openat(AT_FDCWD, "/usr/share/locale/es_MX/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No existe el archivo o el directorio)
21:01:28.129088 openat(AT_FDCWD, "/usr/share/locale/es/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No existe el archivo o el directorio)
21:01:28.129140 openat(AT_FDCWD, "/usr/share/locale-langpack/es_MX/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No existe el archivo o el directorio)
21:01:28.129195 openat(AT_FDCWD, "/usr/share/locale-langpack/es/LC_MESSAGES/bash.mo", O_RDONLY) = 3
21:01:28.129248 fstat(3, {st_mode=S_IFREG|0644, st_size=157610, ...}) = 0
21:01:28.129294 mmap(NULL, 157610, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5d203c5000
21:01:28.129349 close(3)                = 0
21:01:28.129392 write(2, "logout\n", 7) = 7
21:01:28.129451 openat(AT_FDCWD, "/home/test/.bash_logout", O_RDONLY) = 3
21:01:28.129518 fstat(3, {st_mode=S_IFREG|0644, st_size=220, ...}) = 0
21:01:28.129570 read(3, "# ~/.bash_logout: executed by ba"..., 220) = 220
21:01:28.133518 --- SIGHUP {si_signo=SIGHUP, si_code=SI_KERNEL} ---
21:01:28.133542 --- SIGCONT {si_signo=SIGCONT, si_code=SI_KERNEL} ---
21:01:28.133556 rt_sigreturn({mask=[]}) = 220
21:01:28.133581 close(3)                = 0
21:01:28.133611 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
21:01:28.133651 rt_sigprocmask(SIG_BLOCK, CHLD TSTP TTIN TTOU, [], 8) = 0
21:01:28.133674 ioctl(255, TIOCSPGRP, 1467) = -1 ENOTTY (Función ioctl no apropiada para el dispositivo)
21:01:28.133702 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
21:01:28.133723 setpgid(0, 1467)        = -1 EPERM (Operación no permitida)
21:01:28.133750 rt_sigaction(SIGHUP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, {sa_handler=0x55d4bff0dd60, sa_mask=HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS, sa_flags=SA_RESTORER, sa_restorer=0x7f5d213e3470}, 8) = 0
21:01:28.133775 getpid()                = 1467
21:01:28.133793 kill(1467, SIGHUP)      = 0
21:01:28.133813 --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=1467, si_uid=1000} ---
21:01:28.134085 +++ killed by SIGHUP +++

I have run perl -d:Trace, but is extremly long and it could not see any different information, the application runs the WINCH subroutine, until it suddenly receives the hup signal.

Thanks for your help


In reply to application crash during WINCH Signal by hanspr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.