This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add Ada tasking support for hppa-unknown-linux-gnu (take 2)


> You can check the size and alignment used by compiling the file with -gnatR3

It shows the wrong alignment.

> > > Also, the alignment for atomic_lock_t seems wrong to me: you are using
> > > 8 * 16, but the alignment is specified in *bytes*, not bits (a usual
> > > confusion), so this value seems very high to me. Didn't you mean 16
> > > instead ?
> > 
> > The required alignment is 16 bytes.
> 
> So the alignment in the file is indeed wrong and should be 16 rather than
> 8 * 16

Reducing the alignment to 16 causes an number of testsuite regressions.
Free is being called with a bad pointer.  Here is an example:

Program received signal SIGSEGV, Segmentation fault.
0x409b979c in __libc_free (mem=0x67d60) at malloc.c:3348
3348      ar_ptr = arena_for_chunk(p);
(gdb) bt
#0  0x409b979c in __libc_free (mem=0x67d60) at malloc.c:3348
#1  0x0001da90 in <__gnat_free> (ptr=425312) at s-memory.adb:113
#2  0x0001f6f0 in system.task_primitives.operations.finalize_tcb (t=0x67d60)
    at s-taprop.adb:907
#3  0x0003284c in system.tasking.stages.vulnerable_complete_master (self_id=Variable "self_id" is not available.
)
    at s-tassta.adb:1563
#4  0x00035d2c in c41306b () at c41306b.adb:39
#5  0x000155d4 in main (argc=1, argv=3220178412, envp=3220178420)
    at b~c41306b.adb:190

As far as I can tell, this region of memory was never allocated by
malloc but it's somehow a TCB being freed by 

Breakpoint 11, system.tasking.stages.vulnerable_complete_master (self_id=Variable "self_id" is not available.
)
    at s-tassta.adb:1563
1563                Vulnerable_Free_Task (T);
(gdb) p/x T
$93 = 0x67d60

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]