bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Statically linked ELF, Process::detach() and serial port settings, stati


From: Onno Kortmann
Subject: Statically linked ELF, Process::detach() and serial port settings, statically initialized ttystream
Date: Thu, 29 Apr 2004 15:17:02 +0200
User-agent: KMail/1.5.4

Hi,

I wrote a small program that uses the serial port at 2400,8,n,1 to speak to a 
homebrewed microcontroller device and can/should be used as a daemon. Using 
the "ttystream" class with the extended initialization string (i.e. 
"/dev/ttyS2:2400,8,n,1") works without any problems, but only until I issue a 
Process::detach(). This seems to reset the port to 9600 baud or whatever it's 
initial setting was.

The bug depends on a statically initialized ttystream. Maybe I overlooked 
something, but I didn't found anything in the docs (neither "the c++ 
programming language" nor the common c++ docs) which states that statically 
initialized iostream objects are forbidden.

I run the program as root under linux-2.4.18. I'm linking statically with 
these compile commands (because development box != box in production use for 
this case):

g++ -g -Wall `ccgnu2-config --flags` -c baudtest.cc
g++ -static -o baudtest baudtest.o `ccgnu2-config --gnulibs --extlibs`

With this warning message (I ignored it because it seems to be really 
unrelated):
/usr/lib/libccgnu2.a(inaddr.o)(.text+0x105b): In function 
`ost::InetAddress::getHostname() const':
: warning: Using 'gethostbyaddr_r' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/usr/lib/libccgnu2.a(inaddr.o)(.text+0xc30): In function 
`ost::InetAddress::setAddress(char const*)':
: warning: Using 'gethostbyname_r' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking

My libcommonc++2 version is the newest from testing/unstable:
ii  libcommoncpp2- 1.0.13-3       Header files and static libraries for Common

Attached is a short test program that works as expected only non-daemon mode 
(no cmdline arguments given).

Admitted, the above is a somewhat weird configuration :) But a library should 
work as expected also under weird conditions - therefore I report this as a 
bug.

Best regards,

Onno

Attachment: baudtest.cc
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]