NetBSD-Bugs archive

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

Re: pkg/35235



The following reply was made to PR toolchain/35235; it has been noted by GNATS.

From: Nick Hudson <nick.hudson%gmx.co.uk@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: toolchain-manager%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost,
 dhgutteridge%sympatico.ca@localhost
Subject: Re: pkg/35235
Date: Thu, 5 Jan 2012 10:23:23 +0000

 --Boundary-00=_boXBPDZWSOATyON
 Content-Type: text/plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: 7bit
 
 On Wednesday 04 January 2012 23:00:08 Sergey Svishchev wrote:
 [...]
 
 >  temacs segfaults in emacs_blocked_malloc (w/o cpuflags) or $$dyncall (with
 > cpuflags) -- another case of 45405?
 
 It would appear so. I applied dh's fix to emacs21 to emacs22 and it build (w/o 
 cpuflags) on my b160l.
 
 Nick
 
 --Boundary-00=_boXBPDZWSOATyON
 Content-Type: text/plain;
   charset="iso-8859-1";
   name="patch-src_alloc_c"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
        filename="patch-src_alloc_c"
 
 $NetBSD: patch-src_alloc_c,v 1.1 2011/12/31 11:40:27 dholland Exp $
 
 - use standard headers
 - add an empty asm() destroying memory that prevents gcc from
   optimizing out __malloc_hook and friends (which leads to
   SIGSEGV in temacs during build)
 
 --- src/alloc.c.orig   2008-08-12 18:35:44.000000000 +0000
 +++ src/alloc.c        2012-01-05 08:36:58.000000000 +0000
 @@ -84,6 +84,8 @@
  #include "w32.h"
  #endif
  
 +#include <stdlib.h>
 +
  #ifdef DOUG_LEA_MALLOC
  
  #include <malloc.h>
 @@ -1205,6 +1207,9 @@
  #endif /* GC_MALLOC_CHECK */
  
    __free_hook = old_free_hook;
 +#ifdef __GNUC__
 +  __asm __volatile("":::"memory");
 +#endif
    free (ptr);
  
    /* If we released our reserve (due to running out of memory),
 @@ -1236,6 +1241,9 @@
  
    BLOCK_INPUT_ALLOC;
    __malloc_hook = old_malloc_hook;
 +#ifdef __GNUC__
 +  __asm __volatile("":::"memory");
 +#endif
  #ifdef DOUG_LEA_MALLOC
      mallopt (M_TOP_PAD, malloc_hysteresis * 4096);
  #else
 @@ -1285,6 +1293,9 @@
  
    BLOCK_INPUT_ALLOC;
    __realloc_hook = old_realloc_hook;
 +#ifdef __GNUC__
 +  __asm __volatile("":::"memory");
 +#endif
  
  #ifdef GC_MALLOC_CHECK
    if (ptr)
 
 --Boundary-00=_boXBPDZWSOATyON--
 


Home | Main Index | Thread Index | Old Index