[Gc] GC 6.8 bus error on Solaris SPARC 9

jim marshall jim.marshall at wbemsolutions.com
Thu Jan 17 07:46:53 PST 2008



ktreichel at web.de wrote:
> Hi Jim,
>
>   
>> -----Ursprüngliche Nachricht-----
>> Von: "jim marshall" <jim.marshall at wbemsolutions.com>
>> Gesendet: 17.01.08 07:43:00
>> An: gc at napali.hpl.hp.com
>> Betreff: [Gc] GC 6.8 bus error on Solaris SPARC 9
>>     
>
>
>   
>> Hello,
>>  We have a program using GC 6.8, it is running fine on Linux and Windows 
>> but on Solaris SPARC (9) we get a crash that occurs, we narrowed this 
>> down to a simple test case (attached).
>>
>> Basically we are allocating a block of memory of size 41683, we then try 
>>     
>
> Maybe you get the SIGBUS on sparc because of the misaligned access.
> On x86 this is no problem.
>   
*doh* I knew that! Been away from SPARC too long...
>   
>> to get a pointer to the last 4 bytes so we can store some data and we 
>> get a SIGBUS error. We've tried using "GC_MALLOC" and 
>> 'GC_MALLOC_IGNORE_OFF_PAGE' and we get the same results (bus error).
>>
>> Any thoughts on what might be going on here (e.g. what have I done wrong)?
>>
>> output on "SunOS Sol9Sparc 5.9 Generic_112233-01 sun4u sparc SUNW,Ultra-30"
>> $ ./a.out
>> calling getmarkerArea
>> Setting size
>> Bus Error (core dumped)
>>
>>
>> GDB shows (line # might be off as I added the compile comments to this 
>> email):
>>
>> Core was generated by `./a.out'.
>> Program terminated with signal 10, Bus error.
>> #0  0x000107d4 in main (argc=1, argv=0xffbffa9c) at gctest.c:37
>> 37        *a = SIZE_ONE;
>>
>> Thanks in advance
>>
>> /* file: gctest.c */
>> #include <stdio.h>
>> #include <string.h>
>>
>> #define USE_MUNMAP
>> #include "gc.h"
>>
>> /*
>> compile as follows on Solaris with gcc
>> gcc -g -I<GC>/include/ -L<GC>/lib -lgc -Wl,-R <GC>/lib gctest.c
>>
>> compile as follows on Linux with gcc
>> gcc -g -I<GC>/include/ -L<GC>/lib -lgc -Wl,-rpath=<GC>/lib gctest.c
>> */
>>
>> #define SIZE_ONE 1024
>> #define SIZE_THREE 41679
>>
>> static size_t* getMarkerArea(const void *p, size_t size)
>> {
>>     char *buf = (char*)p;
>>     char *area = &buf[size];
>>     size_t *ret = (size_t*)area;
>>     return ret;   
>> }
>>
>> int main(int argc, char** argv)
>> {
>>   char *p = NULL;
>>   size_t *a = NULL;
>>
>>   GC_INIT();
>>
>>   p = GC_MALLOC_ATOMIC(SIZE_THREE + sizeof(size_t));
>>   //  memset(p, 'x', SIZE_ONE);
>>
>>   printf("calling getmarkerArea\n");
>>   a = getMarkerArea(p, SIZE_THREE);
>>   printf("Setting size\n");
>>   *a = SIZE_ONE;
>>
>>   printf("DONE\n");
>>   return 0;
>> }
>>
>>
>>
>>
>> _______________________________________________
>> Gc mailing list
>> Gc at linux.hpl.hp.com
>> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>>
>>     
>
>
> _______________________________________________________________________
> Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
> kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
>
>
>
>
>   

-- 
Jim Marshall
Sr. Staff Engineer
WBEM Solutions, Inc.
978-947-3607



More information about the Gc mailing list