develooper Front page | perl.perl5.porters | Postings from November 2000

5.7.0@7800 Solaris 8, 64 bit, malloc.c missing prototype

Thread Next
From:
Jens Hamisch
Date:
November 22, 2000 05:13
Subject:
5.7.0@7800 Solaris 8, 64 bit, malloc.c missing prototype
Message ID:
20001122114211.C24777@Strawberry.COM
Hi,

perl@7800 cannot be compiled out of the box in a Solaris 8, 64 bit
environment. The reason therefor is the #ifdef nesting around 
#include <unistd.h> in malloc.c. The header gets not included,
therefor, the prototype for sbrk is not defined. This leads the
function to be tread a int sbrk() insteat of void *sbrk(). The
returned value in this case is 32 bit instead of 8 bit resulting
in the returned pointer to be corrupted.

make fails at the moment, when miniperl is called first. A SEGV
is encountered.

I fixed this by removing the #ifdef DONT_DECLARE_STD statements.
Maybe this should go to Configure.

Regards
-- Jens

--------------------------------------------------------------------------------
     /
 +##+|##+   STRAWBERRY                     Jens Hamisch
+v#+v v##+  EDV-Systeme GmbH               Managing director
/ v    v\v
| . .  . |  Brauneckweg 2                  Car (Voice):  (+49 172) 81 04 162
|     .  |  D-82549 Koenigsdorf            Voice:        (+49 8179) 9305-50
 | .     |                                 Fax:          (+49 8179) 9305-38
 \   .  /   Tel./Fax: (+49 8179) 9305-50   Email:        jens@Strawberry.COM
  \____/    Strawberry@Strawberry.COM      


*** malloc.c.FCS        Wed Nov 22 11:02:13 2000
--- malloc.c    Wed Nov 22 11:04:10 2000
***************
*** 886,903 ****
  #endif

  #ifdef USE_PERL_SBRK
! #define sbrk(a) Perl_sbrk(a)
  Malloc_t Perl_sbrk (int size);
  #else
! #ifdef DONT_DECLARE_STD
! #ifdef I_UNISTD
! #include <unistd.h>
! #endif
! #else
! #ifndef HAS_SBRK_PROTO
  extern        Malloc_t sbrk(int);
! #endif
! #endif
  #endif

  #ifdef DEBUGGING_MSTATS
--- 886,900 ----
  #endif

  #ifdef USE_PERL_SBRK
! #  define sbrk(a) Perl_sbrk(a)
  Malloc_t Perl_sbrk (int size);
  #else
! #  ifdef I_UNISTD
! #    include <unistd.h>
! #  endif
! #  ifndef HAS_SBRK_PROTO
  extern        Malloc_t sbrk(int);
! #  endif
  #endif

  #ifdef DEBUGGING_MSTATS


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About