You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Gregory Shimansky <gs...@gmail.com> on 2006/07/25 23:12:17 UTC

[drlvm] uses deprecated pthread function

Hello

I've tried to build drlvm on Linux and it didn't compile because when 
compiling signals_ia32.cpp file compiler produced a warning that 
pthread_attr_getstackaddr is deprecated. I looked in /usr/include/pthread.h 
[1] and found out that it is really deprecated by __attribute_deprecated__.

I don't know why everything is fine for others but for me gcc [2] does gives a 
warning on this function. I used the recommended replacement 
pthread_attr_getstack which gives both address and stack size in one call. 
The patch is in HARMONY-977. StackTest and other vm smoke tests pass for me 
now.

Maybe it would be better to call pthread_attr_getstack just once since it 
provides all necessary stack information and eliminate redundant 
find_stack_addr and find_stack_size. Each of them calls pthread_getattr_np 
just to destroy pthread_attr 2 lines later. But I made the minimal fix which 
doesn't change functions layout because the same functions exist for windows. 
Probably they are meant to be moved to portlib?

For the future reference, to avoid warnings about deprecated functions (which 
isn't really good IMHO) it is necessary to 
specify -Wno-deprecated-declarations, not the -Wno-deprecated (it is meant 
for C++ code only) option which we currently have in 
build/make/targets/common_vm.xml.

[1]
GNU C Library stable release version 2.3.6, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9).
Compiled on a Linux 2.6.11 system on 2006-06-25.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        Native POSIX Threads Library by Ulrich Drepper et al
        The C stubs add-on version 2.1.2.
        GNU Libidn by Simon Josefsson
        BIND-8.2.3-T5B
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.

[2]
gcc (GCC) 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)

-- 
Gregory Shimansky, Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [drlvm] uses deprecated pthread function

Posted by Naveen Neelakantam <ne...@uiuc.edu>.
Could someone please commit the patch contained in HARMONY-977?

Thanks,
Naveen

On Jul 26, 2006, at 11:58 AM, Pavel Afremov wrote:

> Hello
>
>
>
> I've checked pthread_attr_getstackaddr and it isn't depricated on  
> my linux.
>
> Also I've tested Gregory's fix and it works.
>
>
>
> $uname -a
>
> Linux 2.6.5-7.145lxset1-smp #1 SMP Thu Jan 27 09:19:29 UTC 2005  
> i686 i686
> i386 GNU/Linux
>
> $gcc --version
>
> gcc (GCC) 3.3.3 (SuSE Linux)
> Copyright (C) 2003 Free Software Foundation, Inc.
>
>
>
> Pavel Afremov.
>
>
> On 7/26/06, Gregory Shimansky <gs...@gmail.com> wrote:
>>
>> On Wednesday 26 July 2006 01:18 Geir Magnusson Jr wrote:
>> > Gregory Shimansky wrote:
>> > > Hello
>> > >
>> > > I've tried to build drlvm on Linux and it didn't compile  
>> because when
>> > > compiling signals_ia32.cpp file compiler produced a warning that
>> > > pthread_attr_getstackaddr is deprecated. I looked in
>> > > /usr/include/pthread.h [1] and found out that it is really  
>> deprecated
>> by
>> > > __attribute_deprecated__.
>> > >
>> > > I don't know why everything is fine for others but for me gcc  
>> [2] does
>> > > gives a warning on this function. I used the recommended  
>> replacement
>> > > pthread_attr_getstack which gives both address and stack size  
>> in one
>> > > call. The patch is in HARMONY-977. StackTest and other vm  
>> smoke tests
>> > > pass for me now.
>> >
>> > Weird.  It always has built for me on ubuntu 5/6 and passed the  
>> smoke
>> > tests.
>>
>> Is it marked as deprecated in your /usr/include/pthread.h header  
>> too? I
>> googled a bit and found some references to Debian and Fedora that
>> pthread_attr_getstackaddr is deprecated. There are even a bugs on  
>> Sun JDK
>> about it [1]. Maybe this change just didn't make it into Ubuntu yet.
>>
>> [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6349489 and
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339849
>>
>> --
>> Gregory Shimansky, Intel Middleware Products Division
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev- 
>> help@incubator.apache.org
>>
>>


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [drlvm] uses deprecated pthread function

Posted by Pavel Afremov <pa...@gmail.com>.
Hello



I've checked pthread_attr_getstackaddr and it isn't depricated on my linux.

Also I've tested Gregory's fix and it works.



$uname -a

Linux 2.6.5-7.145lxset1-smp #1 SMP Thu Jan 27 09:19:29 UTC 2005 i686 i686
i386 GNU/Linux

$gcc --version

gcc (GCC) 3.3.3 (SuSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.



Pavel Afremov.


On 7/26/06, Gregory Shimansky <gs...@gmail.com> wrote:
>
> On Wednesday 26 July 2006 01:18 Geir Magnusson Jr wrote:
> > Gregory Shimansky wrote:
> > > Hello
> > >
> > > I've tried to build drlvm on Linux and it didn't compile because when
> > > compiling signals_ia32.cpp file compiler produced a warning that
> > > pthread_attr_getstackaddr is deprecated. I looked in
> > > /usr/include/pthread.h [1] and found out that it is really deprecated
> by
> > > __attribute_deprecated__.
> > >
> > > I don't know why everything is fine for others but for me gcc [2] does
> > > gives a warning on this function. I used the recommended replacement
> > > pthread_attr_getstack which gives both address and stack size in one
> > > call. The patch is in HARMONY-977. StackTest and other vm smoke tests
> > > pass for me now.
> >
> > Weird.  It always has built for me on ubuntu 5/6 and passed the smoke
> > tests.
>
> Is it marked as deprecated in your /usr/include/pthread.h header too? I
> googled a bit and found some references to Debian and Fedora that
> pthread_attr_getstackaddr is deprecated. There are even a bugs on Sun JDK
> about it [1]. Maybe this change just didn't make it into Ubuntu yet.
>
> [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6349489 and
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339849
>
> --
> Gregory Shimansky, Intel Middleware Products Division
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

Re: [drlvm] uses deprecated pthread function

Posted by Vladimir Gorr <vv...@gmail.com>.
I have same issue for FC5. The patch for H-977 helps to resolve it.
Therefore it'd be not bad to apply this patch to SVN repository for
convenience.

Thanks,
Vladimir.


On 7/26/06, Gregory Shimansky <gs...@gmail.com> wrote:
>
> On Wednesday 26 July 2006 01:18 Geir Magnusson Jr wrote:
> > Gregory Shimansky wrote:
> > > Hello
> > >
> > > I've tried to build drlvm on Linux and it didn't compile because when
> > > compiling signals_ia32.cpp file compiler produced a warning that
> > > pthread_attr_getstackaddr is deprecated. I looked in
> > > /usr/include/pthread.h [1] and found out that it is really deprecated
> by
> > > __attribute_deprecated__.
> > >
> > > I don't know why everything is fine for others but for me gcc [2] does
> > > gives a warning on this function. I used the recommended replacement
> > > pthread_attr_getstack which gives both address and stack size in one
> > > call. The patch is in HARMONY-977. StackTest and other vm smoke tests
> > > pass for me now.
> >
> > Weird.  It always has built for me on ubuntu 5/6 and passed the smoke
> > tests.
>
> Is it marked as deprecated in your /usr/include/pthread.h header too? I
> googled a bit and found some references to Debian and Fedora that
> pthread_attr_getstackaddr is deprecated. There are even a bugs on Sun JDK
> about it [1]. Maybe this change just didn't make it into Ubuntu yet.
>
> [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6349489 and
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339849
>
> --
> Gregory Shimansky, Intel Middleware Products Division
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

Re: [drlvm] uses deprecated pthread function

Posted by Gregory Shimansky <gs...@gmail.com>.
On Wednesday 26 July 2006 01:18 Geir Magnusson Jr wrote:
> Gregory Shimansky wrote:
> > Hello
> >
> > I've tried to build drlvm on Linux and it didn't compile because when
> > compiling signals_ia32.cpp file compiler produced a warning that
> > pthread_attr_getstackaddr is deprecated. I looked in
> > /usr/include/pthread.h [1] and found out that it is really deprecated by
> > __attribute_deprecated__.
> >
> > I don't know why everything is fine for others but for me gcc [2] does
> > gives a warning on this function. I used the recommended replacement
> > pthread_attr_getstack which gives both address and stack size in one
> > call. The patch is in HARMONY-977. StackTest and other vm smoke tests
> > pass for me now.
>
> Weird.  It always has built for me on ubuntu 5/6 and passed the smoke
> tests.

Is it marked as deprecated in your /usr/include/pthread.h header too? I 
googled a bit and found some references to Debian and Fedora that 
pthread_attr_getstackaddr is deprecated. There are even a bugs on Sun JDK 
about it [1]. Maybe this change just didn't make it into Ubuntu yet.

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6349489 and 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339849

-- 
Gregory Shimansky, Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [drlvm] uses deprecated pthread function

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Gregory Shimansky wrote:
> Hello
> 
> I've tried to build drlvm on Linux and it didn't compile because when 
> compiling signals_ia32.cpp file compiler produced a warning that 
> pthread_attr_getstackaddr is deprecated. I looked in /usr/include/pthread.h 
> [1] and found out that it is really deprecated by __attribute_deprecated__.
> 
> I don't know why everything is fine for others but for me gcc [2] does gives a 
> warning on this function. I used the recommended replacement 
> pthread_attr_getstack which gives both address and stack size in one call. 
> The patch is in HARMONY-977. StackTest and other vm smoke tests pass for me 
> now.

Weird.  It always has built for me on ubuntu 5/6 and passed the smoke tests.

> 
> Maybe it would be better to call pthread_attr_getstack just once since it 
> provides all necessary stack information and eliminate redundant 
> find_stack_addr and find_stack_size. Each of them calls pthread_getattr_np 
> just to destroy pthread_attr 2 lines later. But I made the minimal fix which 
> doesn't change functions layout because the same functions exist for windows. 
> Probably they are meant to be moved to portlib?
> 
> For the future reference, to avoid warnings about deprecated functions (which 
> isn't really good IMHO) it is necessary to 
> specify -Wno-deprecated-declarations, not the -Wno-deprecated (it is meant 
> for C++ code only) option which we currently have in 
> build/make/targets/common_vm.xml.
> 
> [1]
> GNU C Library stable release version 2.3.6, by Roland McGrath et al.
> Copyright (C) 2005 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> Compiled by GNU CC version 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9).
> Compiled on a Linux 2.6.11 system on 2006-06-25.
> Available extensions:
>         GNU libio by Per Bothner
>         crypt add-on version 2.1 by Michael Glad and others
>         Native POSIX Threads Library by Ulrich Drepper et al
>         The C stubs add-on version 2.1.2.
>         GNU Libidn by Simon Josefsson
>         BIND-8.2.3-T5B
>         NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
> Thread-local storage support included.
> 
> [2]
> gcc (GCC) 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org