Discussion:
[mgetty] sendfax failing after upgrading NetBSD kernel: handshake?
(too old to reply)
Ignatios Souvatzis
2015-08-18 15:31:10 UTC
Permalink
Hi,

since I upgraded NetbSD to 6.1 (from 5.1), sendfax fails...
The receiving side prints the first few dot lines, and finishes
The sending side continues to send page data to the modem for a long
time.


This happens with

- netbsd-5 compiled mgetty package with netbsd-6/arm kernel
- netbsd-6 compiled mgetty package with netbsd-6/arm kernel
- netbsd-6 compiled mgetty package with netbsd-6/amd64 kernel on the laptop.

It looks a bit like there's some handshaking problem; see log excerpt
below.

It's not wrong handshaking wires - I switched back and forth
to the old kernel, and it still worked with the old one.

I wonder whether kernel behaviour wrt. combining XON and hardware
handshaking changed...

Can I tweak the handshaking used anywhere?

(Receiving faxes works fine.)

-is

08/18 17:16:20 y00 fax_wait_for(CONNECT)
08/18 17:16:20 y00 got:[0a]AT+FDT[0d]
08/18 17:16:20 y00 fax_wait_for: string 'AT+FDT'
08/18 17:16:20 y00 got:[0d][0a]+FCS:1,5,0,2,0,0,0,3[0d]
08/18 17:16:27 y00 fax_wait_for: string '+FCS:1,5,0,2,0,0,0,3'
08/18 17:16:27 y00 transmission par.: '+FCS:1,5,0,2,0,0,0,3'
08/18 17:16:27 y00 got:[0a][0d][0a]CONNECT[0d]
08/18 17:16:27 y00 fax_wait_for: string 'CONNECT'** found **
08/18 17:16:27 y00 tio_set_flow_control( HARD XON_OUT )
08/18 17:16:27 y00 sending f1.g3...
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 65
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 65
08/18 17:16:27 y0 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:27 y00 read 64, write 64
08/18 17:16:35 y00 input: got [0d][0a]+FHS:43[0d][0a]
08/18 17:16:35 y00 read 64, write 64
08/18 17:16:35 y00 read 64, write 64
[...]
08/18 17:16:46 y00 read 64, write 64
08/18 17:16:46 y00 read 59, write 59
08/18 17:16:46 y00 page complete, 10883 bytes sent
08/18 17:16:46 y00 sending DLE '.'
08/18 17:16:46 y00 got:[0a]
08/18 17:18:46 y00 fax_send: timeout
08/18 17:18:46 y00 mdm_read_byte: read returned -1: Interrupted system call
08/18 17:18:46 y00 mdm_get_line: cannot read byte, return: Interrupted system c
--
A medium apple... weighs 182 grams, yields 95 kcal, and contains no
caffeine, thus making it unsuitable for sysadmins. - Brian Kantor
Ignatios Souvatzis
2015-08-20 18:20:56 UTC
Permalink
Post by Ignatios Souvatzis
Can I tweak the handshaking used anywhere?
In the source (actually: policy.h) - is there place I missed where
I can set this without recompiling? - I think I need:

#define FAXSEND_FLOW FLOW_SOFT


I notice something else: sendfax crashes when logging success now.
After playing ....i err, poking with gdb inside VARARGS lists, I
found that sendfax (at least) tries to pass time_t's to printf-likes
which have %d as parameter. This doesn't work on architectures
where sizeof(int)!=sizeof(time_t). The solution is to cast to (int)
in a few places - after all, a single fax call should be finished
or failed within 2^31 seconds.

A patch for sendfax.c is being test-compiled right now; in parallel
I'm doing some code inspection - found at least one other place.

I'll report with a full list.

Regards,
-is
Ignatios Souvatzis
2015-08-20 18:23:51 UTC
Permalink
Post by Ignatios Souvatzis
Can I tweak the handshaking used anywhere?
In the source (actually: policy.h) - is there place I missed where
I can set this without recompiling? - I think I need:

#define FAXSEND_FLOW FLOW_SOFT


I notice something else: sendfax crashes when logging success now.
After playing Cmd. Falcon ... err, poking with gdb inside VARARGS
lists, I found that sendfax (at least) tries to pass time_t's to
printf-likes which have %d as parameter. This doesn't work on
architectures where sizeof(int)!=sizeof(time_t). The solution is
to cast to (int) in a few places - after all, a single fax call
should be finished or failed within 2^31 seconds.

A patch for sendfax.c is being test-compiled right now; in parallel
I'm doing some code inspection - found at least one other place.

I'll report with a full list.

Regards,
-is
Ignatios Souvatzis
2015-08-20 18:30:25 UTC
Permalink
Post by Ignatios Souvatzis
After playing Cmd. Falcon ...
Fallon, of course.

Regards,
-is

Loading...