Newsgroup: it.comp.os.linux.sys
Titolo: HylaFax: solo per chi vuole cimentarsi...

Salve,
	ho installato l'ultima versione di Hylafax disponibile sul
server in azienda, tutto funziona alla perfezione, tranne il fatto che
ogni tanto (2 o 3 volte a settimana) il sistema sembra impazzire
all'improvviso bloccando il modem e restando inutilizzabile fino al
mio intervento, il quale consiste nell'uccidere faxgetty e nel
ripristinare il servizio (dopo aver spento anche il modem).
Dato che la cosa è assai fastidiosa, in quanto se sono assente e
accade, i fax non arrivano né partono più, vorrei chiedervi un aiuto o
un consiglio sul da farsi, con la speranza che possiate aiutarmi.
Di seguito ho postato il log di un fax che ha generato il problema.
Benché in questo caso (raro)  dopo circa 10minuti il servizio si è
sbloccato e ha ripreso a funzionare, il più delle volte ciò non accade
e sono costretto ad intervenire come già descritto.
Dati del problema: 
1. Modem USRobotics Sportster Flash (con upgrade all'ultima ver.)
2. File config.ttyS0 (in Classe 1) prelevato dal sito apposito di
Hylafax
3. Ultima versione di Hylafax
4. Per la cronaca: il file di log sottostante occupa circa 9MB!! Se il
servizio non si sblocca (come accade spesso) c'e' il rischio di
giocarsi la partizione occupata da un "loggone" micidiale!  
A voi l'ardua sentenza...
----- /var/spool/fax/log/c00003990 -----
Jun 11 12:30:56.77: [  780]: SESSION BEGIN 00003990 3971324903
Jun 11 12:30:56.77: [  780]: <-- [22:AT+FCLASS=1&H1&I0&R2A\r]
Jun 11 12:31:02.05: [  780]: --> [7:CONNECT]
Jun 11 12:31:02.05: [  780]: ANSWER: FAX CONNECTION
Jun 11 12:31:02.05: [  780]: RECV FAX: begin
Jun 11 12:31:02.05: [  780]: <-- data [23]
Jun 11 12:31:02.05: [  780]: <-- data [2]
Jun 11 12:31:02.07: [  780]: --> [7:CONNECT]
Jun 11 12:31:02.07: [  780]: <-- data [10]
Jun 11 12:31:02.07: [  780]: <-- data [2]
Jun 11 12:31:04.04: [  780]: --> [2:OK]
Jun 11 12:31:04.04: [  780]: <-- [9:AT+FRH=3\r]
Jun 11 12:31:04.38: [  780]: --> [7:CONNECT]
Jun 11 12:31:05.97: [  780]: --> [2:OK]
Jun 11 12:31:05.97: [  780]: REMOTE TSI "0223874498"
Jun 11 12:31:05.97: [  780]: <-- [9:AT+FRH=3\r]
Jun 11 12:31:05.98: [  780]: --> [7:CONNECT]
Jun 11 12:31:06.26: [  780]: --> [2:OK]
Jun 11 12:31:06.26: [  780]: REMOTE wants 9600 bit/s
Jun 11 12:31:06.26: [  780]: REMOTE wants page width 1728 pixels in
215 mm
Jun 11 12:31:06.26: [  780]: REMOTE wants unlimited page length
Jun 11 12:31:06.26: [  780]: REMOTE wants 3.85 line/mm
Jun 11 12:31:06.26: [  780]: REMOTE wants 1-D MR
Jun 11 12:31:06.26: [  780]: RECV training at v.29 9600 bit/s
Jun 11 12:31:06.26: [  780]: <-- [10:AT+FRM=96\r]
Jun 11 12:31:06.67: [  780]: --> [7:CONNECT]
Jun 11 12:31:08.25: [  780]: RECV: TCF 1893 bytes, 4% non-zero, 1810
zero-run
Jun 11 12:31:08.25: [  780]: --> [10:NO CARRIER]
Jun 11 12:31:08.25: [  780]: DELAY 75 ms
Jun 11 12:31:08.33: [  780]: <-- [9:AT+FTH=3\r]
Jun 11 12:31:08.52: [  780]: --> [7:CONNECT]
Jun 11 12:31:08.52: [  780]: <-- data [3]
Jun 11 12:31:08.52: [  780]: <-- data [2]
Jun 11 12:31:09.70: [  780]: --> [2:OK]
Jun 11 12:31:09.70: [  780]: TRAINING succeeded
Jun 11 12:31:09.70: [  780]: <-- [10:AT+FRM=96\r]
Jun 11 12:31:11.56: [  780]: --> [7:CONNECT]
Jun 11 12:31:11.56: [  780]: RECV: begin page
Jun 11 12:31:32.63: [  780]: RECV: 906 total lines, 0 bad lines, 0
consecutive bad lines
Jun 11 12:31:32.63: [  780]: RECV: end page
Jun 11 12:31:32.63: [  780]: --> [10:NO CARRIER]
Jun 11 12:31:32.63: [  780]: <-- [9:AT+FRH=3\r]
Jun 11 12:31:43.08: [  780]: --> [10:NO CARRIER]
Jun 11 12:31:43.08: [  780]: MODEM No carrier
Jun 11 12:31:43.08: [  780]: <-- [9:AT+FRH=3\r]
Jun 11 12:31:43.09: [  780]: --> [10:NO CARRIER]
Jun 11 12:31:43.09: [  780]: MODEM No carrier
Jun 11 12:31:43.09: [  780]: <-- [9:AT+FRH=3\r]
Jun 11 12:31:43.10: [  780]: --> [10:NO CARRIER]
.
.
# Seguono migliaia di linee uguali alle ultime 9...
.
.
# finché dopo circa 10minuti:
.
.
Jun 11 12:43:02.34: [  780]: --> [0:]
Jun 11 12:43:02.34: [  780]: MODEM <Empty line>
Jun 11 12:43:02.34: [  780]: <-- data [1]
Jun 11 12:43:02.54: [  780]: MODEM <Timeout>
Jun 11 12:43:02.54: [  780]: RECV FAX (00003990): recvq/fax02762.tif
from 0223874498, route to <unspecified>, 0 pages in 12:00
Jun 11 12:43:02.55: [  780]: RECV FAX: T.30 T2 timeout, expected page
not received
Jun 11 12:43:02.55: [  780]: <-- [9:AT+FTH=3\r]
Jun 11 12:43:02.69: [  780]: --> [5:ERROR]
Jun 11 12:43:02.69: [  780]: RECV FAX (00003990): session with
0223874498 terminated abnormally: T.30 T2 timeout, expected page
 not received
Jun 11 12:43:02.69: [  780]: RECV FAX: bin/faxrcvd
"recvq/fax02762.tif" "ttyS0" "00003990" "T.30 T2 timeout, expected
page not received"
Jun 11 12:43:15.96: [  780]: RECV FAX: end
Jun 11 12:43:15.96: [  780]: SESSION END

 3. Ultima versione di Hylafax
distribuzione utilizzata e versione esatta di Hylafax (....quale beta?)
Christian



RH6.2
HylaFAX 4.1beta3 


ha scritto:
http://www.hylafax.org/archive/2001-06/msg00022.html
It's possible reproduce a similar faxgetty loop with the following patch on the
sender's side:
-----------------------------------------------
--- Class1Send.c++.org    Fri Sep  8 20:21:36 2000
+++ Class1Send.c++      Tue Jun  5 12:59:57 2001
@@ -263,6 +265,7 @@
         *     to send the OK result and so using pause is more
         *     accurate.
         */
+        reset(30000); return(send_retry);
        pause(cmd == FCF_MPS ? conf.class1SendPPMDelay : 95);
        do {
            /*
-----------------------------------------------
After above patch on sender's side the log on receiver's side is:
-----------------------------------------------
.................
Jun 05 12:40:47.08: [13769]: <-- [11:AT+FRM=146\r]
Jun 05 12:40:47.65: [13769]: --> [7:CONNECT]
Jun 05 12:40:47.65: [13769]: RECV: begin page
Jun 05 12:40:53.16: [13769]: RECV/CQ: Bad 1D pixel count, row 1070, got 0,
expected 1728
Jun 05 12:40:53.16: [13769]: RECV/CQ: Bad 1D pixel count, row 1071, got 0,
expected 1728
Jun 05 12:40:53.16: [13769]: RECV/CQ: Bad 1D pixel count, row 1072, got 0,
expected 1728
Jun 05 12:40:53.16: [13769]: RECV/CQ: Bad 1D pixel count, row 1073, got 0,
expected 1728
Jun 05 12:40:53.16: [13769]: RECV/CQ: Bad 1D pixel count, row 1074, got 0,
expected 1728
Jun 05 12:40:54.63: [13769]: RECV/CQ: Adjusting for RTC found at row 1069
Jun 05 12:40:54.63: [13769]: RECV: 1069 total lines, 0 bad lines, 0 consecutive
bad lines
Jun 05 12:40:54.63: [13769]: RECV: end page
Jun 05 12:40:54.63: [13769]: --> [10:NO CARRIER]
Jun 05 12:40:54.63: [13769]: MODEM input buffering disabled
Jun 05 12:40:54.63: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:41:00.67: [13769]: --> [5:ERROR]
Jun 05 12:41:00.67: [13769]: MODEM Command error
Jun 05 12:41:00.67: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:41:06.71: [13769]: --> [5:ERROR]
Jun 05 12:41:06.71: [13769]: MODEM Command error
Jun 05 12:41:06.71: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:41:12.75: [13769]: --> [5:ERROR]
Jun 05 12:41:12.75: [13769]: MODEM Command error
Jun 05 12:41:12.75: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:41:18.79: [13769]: --> [5:ERROR]
Jun 05 12:41:18.79: [13769]: MODEM Command error
Jun 05 12:41:18.79: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:41:24.83: [13769]: --> [5:ERROR]
Jun 05 12:41:24.83: [13769]: MODEM Command error
Jun 05 12:41:24.83: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:41:30.87: [13769]: --> [5:ERROR]
Jun 05 12:41:30.87: [13769]: MODEM Command error
.................
Jun 05 12:53:52.96: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:53:58.98: [13769]: --> [5:ERROR]
Jun 05 12:53:58.99: [13769]: MODEM Command error
Jun 05 12:53:58.99: [13769]: <-- [9:AT+FRH=3\r]
Jun 05 12:54:05.02: [13769]: --> [5:ERROR]
Jun 05 12:54:05.02: [13769]: MODEM Command error
.................
-----------------------------------------------
So it looks like any (!) can hang HylaFAX.
Here is a patch to prevent this:
-----------------------------------------------
--- hylafax/faxd/Class1Recv.c++.org     Fri May  4 14:49:32 2001
+++ hylafax/faxd/Class1Recv.c++ Tue Jun  5 15:52:52 2001
@@ -349,6 +349,8 @@
 bool
 Class1Modem::recvPage(TIFF* tif, int& ppm, fxStr& emsg)
 {
+    time_t t2end = 0;
+
 top:
     do {
        u_int timer = conf.t2Timer;
@@ -504,7 +518,20 @@
                emsg = "COMREC invalid response received";
                return (false);
            }
-       }
+
+            t2end = 0;
+        } else {
+            /*
+             * If remote is on hook, then modem responces [+FC]ERROR
+             * or NO CARRIER. I only try to prevent looping (V.F.)
+             */
+            if (t2end) {
+                if (Sys::now() > t2end)
+                    break;
+            } else {
+                t2end = Sys::now() + howmany(conf.t2Timer, 1000);
+            }
+        }
     } while (!wasTimeout() && lastResponse != AT_EMPTYLINE);
     if (lastPPM == FCF_EOM) {
        /*
-----------------------------------------------
Vyacheslav.
=======================
-- 
giu...@pobox.com