GNOME Bugzilla – Bug 156806
esddsp/libesd destroys ESPEAKER port
Last modified: 2005-02-17 02:29:03 UTC
When using esddsp with a ESPEAKER variable that looks "127.0.0.1:4920", the preloaded library modifies the environment variable, and removes the port. The effect is that the library tries to connect to port 16001, even though port 4920 has been specified! This can be verified by looking at the processes environment just after start, and then after the application has been trying to use /dev/dsp: <start appliation, and immediately halt it> $ cat /proc/30735/environ | awk '{gsub("\0", "\n"); print $0}' | grep ^ESPEAKER ESPEAKER=127.0.0.1:4920 <let application continue, and open /dev/dsp> cat /proc/30735/environ | awk '{gsub("\0", "\n"); print $0}' | grep ^ESPEAKER ESPEAKER=127.0.0.1 I've also verified that it helps to insert a strdup() around the two getenv() calls in esdlib.c. So, somehow, esdlib.c modifies the result from getenv()
Some more evidence of the problem: * During the execution of the program, libesd writes to stderr: /dev/dsp: Connection refused * By doing a strace, one can see that it is indeed trying to correct to the wrong port: connect(5, {sa_family=AF_INET, sin_port=htons(16001), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
*** This bug has been marked as a duplicate of 167609 ***