Repository navigation
Commit ca7b7ad
JobStore: fix real null-pointer bug in socket comms (issue #65 root cause)
interactPort() deletes remoteconn and nulls it out the instant a
socketComms handshake with eccejobmonitor succeeds ("all further comms
is over socket") -- but interactGetOutput() (the function jmPORT
returns into), cleanup(), and interactGetFiles() all called through
remoteconn afterward with no null check, on every single successful
socket-comms connection. Confirmed via a standalone repro that this is
a genuine null-pointer dereference (immediate SIGSEGV in isolation;
in the real, much larger eccejobstore process, the freed RCommand's
memory is far more likely to already be reused by something else in
between, which would explain the originally observed symptom better --
a busy CPU loop and eventual 3-minute heartbeat timeout, not a clean
crash). Either way this is undefined behavior and the real reason
socket comms never got past the initial handshake.
Also hardened eccejobmonitor's own socket-comms launch: it's
backgrounded with a raw "cmd &" (not execbg(), so it never got today's
nohup fix), and interactPort() closes the launching connection right
after the handshake -- under bash that risks SIGHUP killing the
monitor before its first heartbeat, matching this issue's symptom and
today's confirmed compute-job SIGHUP bug. Wrapped in "(trap '' HUP; ...)"
rather than nohup, since nohup would redirect eccejobmonitor's stdout
to nohup.out and break the port-handshake read that depends on it
staying attached to the pty. csh already ignores SIGHUP for background
jobs on session exit (confirmed today), so only bash needs this.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 3c08697 commit ca7b7ad
1 file changed
Lines changed: 51 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
633 | 638 | | |
634 | 639 | | |
635 | 640 | | |
| |||
1172 | 1177 | | |
1173 | 1178 | | |
1174 | 1179 | | |
1175 | | - | |
| 1180 | + | |
1176 | 1181 | | |
1177 | 1182 | | |
1178 | 1183 | | |
| |||
1693 | 1698 | | |
1694 | 1699 | | |
1695 | 1700 | | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
1696 | 1720 | | |
1697 | 1721 | | |
1698 | 1722 | | |
| |||
1937 | 1961 | | |
1938 | 1962 | | |
1939 | 1963 | | |
1940 | | - | |
1941 | | - | |
1942 | | - | |
1943 | | - | |
1944 | | - | |
1945 | | - | |
1946 | | - | |
1947 | | - | |
1948 | | - | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
1949 | 1989 | | |
1950 | 1990 | | |
1951 | 1991 | | |
| |||
0 commit comments