delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/02/20/08:26:47

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <499EB1AB.9060808@gmail.com>
Date: Fri, 20 Feb 2009 13:35:39 +0000
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
Subject: Re: [ANNOUNCEMENT] [1.7] Updated: file-5.00-1
References: <announce DOT 20090210093102 DOT GB11175 AT calimero DOT vinschen DOT de> <499E2B9A DOT 5030907 AT cwilson DOT fastmail DOT fm> <20090220095916 DOT GA759 AT calimero DOT vinschen DOT de>
In-Reply-To: <20090220095916.GA759@calimero.vinschen.de>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Corinna Vinschen wrote:
> On Feb 19 23:03, Charles Wilson wrote:
>> Corinna Vinschen wrote:
>>> I've updated the Cygwin 1.7 version of file to 5.00-1.
>> Odd behavior: after I did a rebaseall, I was consistently seeing
>> coredumps using this version of file.  Reverting to the older version of
>> file fixed it, as did re-installing the new version.
>>
>> I haven't rebased again, but is there any reason to suspect that
>> cygmagic-1.dll is not rebaseable?
> 
> Apparently.  I rebased the DLL alone and afterwards file simply stopped
> working.  The DLL has a base address of 0x6a500000.  Even rebasing to
> the very same address results in a coredump!
> 
> The DLL has been built with -static-libgcc.  Assuming that this might
> have been the reason I rebuilt the file package without -static-libgcc,
> so the DLL now depends on cyggcc_s.dll.  And, guess what, afterwards
> the DLL is rebaseable just fine.
> 
> Dave?  Any idea why this occurs?  The crash happens when the Cygwin DLL
> is running the ctors list.  Given that the file package is using plain
> C, it seems that a static libgcc is non-relocatable for whatever reason.

  Investigating.  While I do that, I noticed a bug:

libtool: compile:  gcc-4 -DHAVE_CONFIG_H -I. -I..
-DMAGIC=\"/usr/local/share/file/magic\" -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls
-Wnested-externs -Wsign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual
-Wwrite-strings -Wextra -Wunused-parameter -g -O2 -MT magic.lo -MD -MP -MF
.deps/magic.Tpo -c magic.c -o magic.o
magic.c: In function 'file_or_fd':
magic.c:304: warning: passing argument 1 of 'strlcat' makes pointer from
integer without a cast

   304				(void)strlcat(strlcpy(tmp, inname, len), ".exe", len);


  That sort of construct works for "strcat (strcpy ())" but not for the 'l'
versions, they aren't drop-in replacements.

  <suddenly does HUGE double-take on seeing surrounding code>

   251	public const char *
   252	magic_file(struct magic_set *ms, const char *inname)

               ...

   257	private const char *
   258	file_or_fd(struct magic_set *ms, const char *inname, int fd)

/sighs  *facepalm*  <hurried grep>

    68	#define private static
    69	#ifndef protected
    70	#define protected
    71	#endif
    72	#define public

*headdesk* *facepalm* *headdesk* *facepalm* *headdesk*

    cheers,
      DaveK



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019