Salesforce

An incomplete protrace on Linux due to the length of the hostname

« Go Back

Information

 
TitleAn incomplete protrace on Linux due to the length of the hostname
URL Name000048463
Article Number000169154
EnvironmentProduct: OpenEdge
Version: 10.x, 11.0x, 11.1x, 11.2x, 11.3.0, 11.3.1, 11.3.2
OS: Linux
Question/Problem Description
An incomplete PROTRACE file is generated on Linux platforms
proGetStack SIGUSR1 or kill -10 creates an empty protrace file
The protrace file is empty, it only contains the Progress header
No C stack trace is recorded in the protrace
protrace never contains an ABL stack.
Output of 'hostname' command is longer than or equal to 20 characters
uname -a returns a hostname length >= 20 characters
uname --snrvm is the concatenation of : kernel name, nodename, release, version, and machine longer than 80 characters
Steps to Reproduce
Clarifying Information
Run: strace -xvttfo _progres -zp and then kill -10 PID or proGetStack PID

Strace output:
--- SIGUSR1 (User defined signal 1) @ 0 (0) --- 
open("protrace.29657", O_RDWR|O_CREAT|O_APPEND|O_DSYNC, 0666) = 15 
write(15, "\n\nPROGRESS stack trace as of ", 29) = 29 
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2225, ...}) = 0 
write(15, "Wed Mar 19 12:34:52 2014\n", 25) = 25 
uname({sys="Linux", node="<hostname including the domain name longer than 19 char>", ...}) = 0 
write(3289392, "\n", 1) = -1 EBADF (Bad file descriptor) 
write(3289392, "Progress OpenEdge Release "..., 136) = -1 EBADF (Bad file descriptor) 
write(3289392, "\n\n", 2) = -1 EBADF (Bad file descriptor) 
write(3289392, "Command line arguments are\n_prog"..., 42) = -1 EBADF (Bad file descriptor) 
write(3289392, "Startup parameters:\n", 20) = -1 EBADF (Bad file descriptor) 
write(3289392, "-pf /apps/openedge/dlc11.3/start"..., 51) = -1 EBADF (Bad file descriptor) 
write(3289392, "\n\n", 2) = -1 EBADF (Bad file descriptor)

 
Error Message
Defect NumberPSC00294570
Enhancement Number
Cause
This is a defect related to the length of the hostname (related to Linux only).
An internal buffer overflows and corrupts the file descriptor to the protrace file.

In the strace output :
  • Using open() to open the protrace file, it opens, get fd 15, the “stack trace header” is written to it, which succeeds
  • But the remainder of write() calls is using fd 3289392 which is the overflow caused by the hostname length, so the write fails with no further content written to the protrace
Because a file descriptor gets corrupted, there is a chance that this data is written to another file the client process has open, instead of the protrace file. This will cause actual file corruption as well. 
Resolution
Upgrade to OpenEdge 11.3.3, 11.4.0 or later where PSC00294570 is fixed.
Workaround
1. When only the C stack is needed, attach a debugger to the process (gdb -p PID) instead of using proGetStack.

2. Ensure that the Linux OS hostname command (its output) is shorter than 20 characters (eg <= 19).


If FQDN is used as a part of hostname, split it into "hostname" and "dnsdomainname" in /etc/sysconfig/network:
...
#  instead of:
#  HOSTNAME=name.yourdomain.something.com
HOSTNAME=name
DNSDOMAIN=yourdomain.something.com
Notes
Keyword Phrase
Last Modified Date11/25/2021 11:35 AM

Powered by