bug-cfengine
[Top][All Lists]
Advanced

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

RE: cfagent, solaris, regcomp and segmentation fault


From: Andrews, Martin
Subject: RE: cfagent, solaris, regcomp and segmentation fault
Date: Tue, 5 Mar 2002 15:23:05 -0500

Sounds like a problem of the regex header and library not matching. I have
had all manner of similar trouble under NT where the core cygwin library has
its own regex implementation. Cfengine always uses its own gnuregex.h header
(I think). Make sure you are searching the ../pub/libpub.a library first.

Martin

-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: Tuesday, March 05, 2002 7:38 AM
To: address@hidden
Subject: cfagent, solaris, regcomp and segmentation fault



Hi all,

I'm trying to install and run cfengine 2.0.b4 on a SUN Solaris 2.6 box, and
get some troubles with cfagent. Whereas on a Linux (RedHat) 2.4.12 I have
no problem.
The complete product gets configured and compiled well (using gcc 2.95.2),
but when I run 'cfagent -v', I get a segmentation fault and a core dump. I
hacked the code to find out what was going on, and found the following :
- the problem arises when cfagent tries to define the domain class :
Solaris box is not FQDN, and cfagent tries to define undefined_domain, the
Linux is FQDN.
- the faulty line is in the function CfRegcomp : "code =
regcomp(preg,regex,cflags) ;". It looks as if the regcomp function is
writing outside the structure pointed to by preg.
I tried to change that line with the following, and it looks now ok :
int CfRegcomp (preg, regex, cflags)
...
{
   regex_t reg2 ;                         <------ added line
   ...
   code=regcomp(&reg2, regex, cflags) ;
   if (code != 0)
   {
      ...
   }
   *preg = reg2 ;                   <------ added line
   return 0 ;
}
As you can see, I use a local variable for regcomp rather than the one
provided by the function calling CfRegcomp. It looks as if regcomp is
writing outside of *preg, and thus writing in the stack and overwriting
some return address. By why doesn't it happen with a local CfRegcomp
variable ?

Can somebody tell me what's going on ?
Thanks
Patrice





----------------

Les donnees et renseignements contenus dans ce message sont personnels,
confidentiels et secrets. Ce message est adresse a l'individu ou l'entite
dont les coordonnees figurent ci-dessus. Si vous n'etes pas le bon
destinataire, nous vous demandons de ne pas lire, copier, utiliser ou
divulguer cette communication. Nous vous prions de notifier cette erreur a
l'expediteur et d'effacer immediatement cette communication de votre
systeme.

The information contained in this message is privileged, confidential, and
protected from disclosure. This message is intended for the individual or
entity adressed herein. If you are not the intended recipient, please do not
read, copy, use or disclose this communication to others ;also please notify
the sender by replying to this message, and then delete it from your system.


_______________________________________________
Bug-cfengine mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/bug-cfengine



reply via email to

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