You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Ivan Volosyuk <iv...@gmail.com> on 2006/09/22 22:27:49 UTC

[classlib][launcher][drlvm] Running vm inside gdb

I have problems running drlvm from gdb:

(gdb) run
Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/java Test
[Thread debugging using libthread_db enabled]
[New Thread -1214326592 (LWP 25698)]
[New Thread -1214510160 (LWP 25701)]
Cannot find user-level thread for LWP 25698: generic error

Does anybody have seen the problem?
-- 
Ivan

---------------------------------------------------------------------
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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
On Sep 23, 2006, at 7:54 AM, Geir Magnusson Jr. wrote:

>>>
>>> Ok.  I think it's straightforward - look to see if the full  
>>> string is
>>> there by seeing if
>>>
>>>    *(ptr + strstr() + 1) == either null or separator
>> Will not work. We should do this in loop at least.
>
> Yes, that was shorthand for "for each match of the dir in the  
> oldpath, see if the next char is a separator or the null at the  
> end.  if so, you found a match, otherwise keep going"
>

And on second glance, it was terrible shorthand  as I forgot the  
strlen() :)

geir


---------------------------------------------------------------------
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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
On Sep 23, 2006, at 7:05 AM, Ivan Volosyuk wrote:

> On 9/23/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
>>
>> On Sep 23, 2006, at 6:00 AM, Ivan Volosyuk wrote:
>>
>> > I have found a solution to this issue. As before, it helps to setup
>> > LD_LIBRARY_PATH before running launcher.
>>
>> Lets be clear - it only helped to setup LD_LIBRARY_PATH before for
>> reasons unknown.  W/o my recent change, it worked fine on Ubuntu 6
>> but not on Suse...
>
> It works fine on my gentoo. The only thing. Look at the paths. First
> one without trailing slash, the second with it. This should be exactly
> the same after the check is fixed. :) I don't know the reason for
> that, so I have left this intact.

Oh, just because it doesn't matter - we could add the trailing slash  
if we wanted too...

>
>>
>> > If it finds required PATHs it
>> > doesn't re-execute itself. Pathes looks like:
>> > path[0] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/default
>> > path[1] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/
>> >
>> > BTW, I have found a bug in the path checks. Giving only first path
>> > will satisfy the condition in the code and will prevent execv(),  
>> but
>> > VM will fail to run:
>>
>> Ha!  yes, of course.  My bad.  Obviously if the needed path is a
>> substring of a path that's already there, it does the wrong thing.
>> Doh :)
>>
>> > export #LD_LIBRARY_PATH=/home/ivan/svn/drlvm/trunk/build/deploy/ 
>> jre/
>> > bin/default
>> > #./deploy/jre/bin/java Test
>> > java/lang/UnsatisfiedLinkError : Failed loading library
>> > "libhyzlib.so": DSO load failed
>> >
>> > I'm working on the fix.
>>
>> Ok.  I think it's straightforward - look to see if the full string is
>> there by seeing if
>>
>>    *(ptr + strstr() + 1) == either null or separator
> Will not work. We should do this in loop at least.

Yes, that was shorthand for "for each match of the dir in the  
oldpath, see if the next char is a separator or the null at the end.   
if so, you found a match, otherwise keep going"

You did effectively the same thing in the patch.

> If we found another
> variant of the path it will fail the check. I have made the correct
> fix. Look at https://issues.apache.org/jira/browse/HARMONY-1557.
>>
>>
>> Back to the issue - this means that we can't debug across the execv 
>> ()?
>
> We don't.
>
> --
> Ivan
>
>>
>> geir
>>
>>
>> > --
>> > Ivan
>> >
>> > On 9/23/06, Nikolay Kuznetsov <ni...@gmail.com> wrote:
>> >> Yes, I've seen the same, please keep us informed if you find a
>> >> solution.
>> >>
>> >> On 9/23/06, Ivan Volosyuk <iv...@gmail.com> wrote:
>> >> > GNU gdb 6.4
>> >> >
>> >> > Attaching is ok, but it is not quite convinient to do attaching
>> >> when
>> >> > running small test, I prefer: gdb --args prog args... but it no
>> >> longer
>> >> > works for me after switch to new launcher.
>> >> > --
>> >> > Ivan
>> >> >
>> >> > On 9/23/06, Sunny Chan <ma...@sunnychan.org.uk> wrote:
>> >> > > Which version of gdb are you using? Older version of gdb
>> >> doesn't play along well
>> >> > > with nptl or java launcher which spawn another process.
>> >> > >
>> >> > > Try running your java program first and attach gdb to the
>> >> process.
>> >> > >
>> >> > > Ivan Volosyuk wrote:
>> >> > > > I have problems running drlvm from gdb:
>> >> > > >
>> >> > > > (gdb) run
>> >> > > > Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/
>> >> jre/bin/java Test
>> >> > > > [Thread debugging using libthread_db enabled]
>> >> > > > [New Thread -1214326592 (LWP 25698)]
>> >> > > > [New Thread -1214510160 (LWP 25701)]
>> >> > > > Cannot find user-level thread for LWP 25698: generic error
>> >> > > >
>> >> > > > Does anybody have seen the problem?
>
> ---------------------------------------------------------------------
> 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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by Ivan Volosyuk <iv...@gmail.com>.
On 9/23/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
>
> On Sep 23, 2006, at 6:00 AM, Ivan Volosyuk wrote:
>
> > I have found a solution to this issue. As before, it helps to setup
> > LD_LIBRARY_PATH before running launcher.
>
> Lets be clear - it only helped to setup LD_LIBRARY_PATH before for
> reasons unknown.  W/o my recent change, it worked fine on Ubuntu 6
> but not on Suse...

It works fine on my gentoo. The only thing. Look at the paths. First
one without trailing slash, the second with it. This should be exactly
the same after the check is fixed. :) I don't know the reason for
that, so I have left this intact.

>
> > If it finds required PATHs it
> > doesn't re-execute itself. Pathes looks like:
> > path[0] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/default
> > path[1] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/
> >
> > BTW, I have found a bug in the path checks. Giving only first path
> > will satisfy the condition in the code and will prevent execv(), but
> > VM will fail to run:
>
> Ha!  yes, of course.  My bad.  Obviously if the needed path is a
> substring of a path that's already there, it does the wrong thing.
> Doh :)
>
> > export #LD_LIBRARY_PATH=/home/ivan/svn/drlvm/trunk/build/deploy/jre/
> > bin/default
> > #./deploy/jre/bin/java Test
> > java/lang/UnsatisfiedLinkError : Failed loading library
> > "libhyzlib.so": DSO load failed
> >
> > I'm working on the fix.
>
> Ok.  I think it's straightforward - look to see if the full string is
> there by seeing if
>
>    *(ptr + strstr() + 1) == either null or separator
Will not work. We should do this in loop at least. If we found another
variant of the path it will fail the check. I have made the correct
fix. Look at https://issues.apache.org/jira/browse/HARMONY-1557.
>
>
> Back to the issue - this means that we can't debug across the execv()?

We don't.

--
Ivan

>
> geir
>
>
> > --
> > Ivan
> >
> > On 9/23/06, Nikolay Kuznetsov <ni...@gmail.com> wrote:
> >> Yes, I've seen the same, please keep us informed if you find a
> >> solution.
> >>
> >> On 9/23/06, Ivan Volosyuk <iv...@gmail.com> wrote:
> >> > GNU gdb 6.4
> >> >
> >> > Attaching is ok, but it is not quite convinient to do attaching
> >> when
> >> > running small test, I prefer: gdb --args prog args... but it no
> >> longer
> >> > works for me after switch to new launcher.
> >> > --
> >> > Ivan
> >> >
> >> > On 9/23/06, Sunny Chan <ma...@sunnychan.org.uk> wrote:
> >> > > Which version of gdb are you using? Older version of gdb
> >> doesn't play along well
> >> > > with nptl or java launcher which spawn another process.
> >> > >
> >> > > Try running your java program first and attach gdb to the
> >> process.
> >> > >
> >> > > Ivan Volosyuk wrote:
> >> > > > I have problems running drlvm from gdb:
> >> > > >
> >> > > > (gdb) run
> >> > > > Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/
> >> jre/bin/java Test
> >> > > > [Thread debugging using libthread_db enabled]
> >> > > > [New Thread -1214326592 (LWP 25698)]
> >> > > > [New Thread -1214510160 (LWP 25701)]
> >> > > > Cannot find user-level thread for LWP 25698: generic error
> >> > > >
> >> > > > Does anybody have seen the problem?

---------------------------------------------------------------------
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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
On Sep 23, 2006, at 6:00 AM, Ivan Volosyuk wrote:

> I have found a solution to this issue. As before, it helps to setup
> LD_LIBRARY_PATH before running launcher.

Lets be clear - it only helped to setup LD_LIBRARY_PATH before for  
reasons unknown.  W/o my recent change, it worked fine on Ubuntu 6  
but not on Suse...

> If it finds required PATHs it
> doesn't re-execute itself. Pathes looks like:
> path[0] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/default
> path[1] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/
>
> BTW, I have found a bug in the path checks. Giving only first path
> will satisfy the condition in the code and will prevent execv(), but
> VM will fail to run:

Ha!  yes, of course.  My bad.  Obviously if the needed path is a  
substring of a path that's already there, it does the wrong thing.   
Doh :)

> export #LD_LIBRARY_PATH=/home/ivan/svn/drlvm/trunk/build/deploy/jre/ 
> bin/default
> #./deploy/jre/bin/java Test
> java/lang/UnsatisfiedLinkError : Failed loading library
> "libhyzlib.so": DSO load failed
>
> I'm working on the fix.

Ok.  I think it's straightforward - look to see if the full string is  
there by seeing if

   *(ptr + strstr() + 1) == either null or separator


Back to the issue - this means that we can't debug across the execv()?

geir


> --
> Ivan
>
> On 9/23/06, Nikolay Kuznetsov <ni...@gmail.com> wrote:
>> Yes, I've seen the same, please keep us informed if you find a  
>> solution.
>>
>> On 9/23/06, Ivan Volosyuk <iv...@gmail.com> wrote:
>> > GNU gdb 6.4
>> >
>> > Attaching is ok, but it is not quite convinient to do attaching  
>> when
>> > running small test, I prefer: gdb --args prog args... but it no  
>> longer
>> > works for me after switch to new launcher.
>> > --
>> > Ivan
>> >
>> > On 9/23/06, Sunny Chan <ma...@sunnychan.org.uk> wrote:
>> > > Which version of gdb are you using? Older version of gdb  
>> doesn't play along well
>> > > with nptl or java launcher which spawn another process.
>> > >
>> > > Try running your java program first and attach gdb to the  
>> process.
>> > >
>> > > Ivan Volosyuk wrote:
>> > > > I have problems running drlvm from gdb:
>> > > >
>> > > > (gdb) run
>> > > > Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/ 
>> jre/bin/java Test
>> > > > [Thread debugging using libthread_db enabled]
>> > > > [New Thread -1214326592 (LWP 25698)]
>> > > > [New Thread -1214510160 (LWP 25701)]
>> > > > Cannot find user-level thread for LWP 25698: generic error
>> > > >
>> > > > Does anybody have seen the problem?
>
> ---------------------------------------------------------------------
> 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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by Ivan Volosyuk <iv...@gmail.com>.
I have found a solution to this issue. As before, it helps to setup
LD_LIBRARY_PATH before running launcher. If it finds required PATHs it
doesn't re-execute itself. Pathes looks like:
path[0] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/default
path[1] = /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/

BTW, I have found a bug in the path checks. Giving only first path
will satisfy the condition in the code and will prevent execv(), but
VM will fail to run:
export #LD_LIBRARY_PATH=/home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/default
#./deploy/jre/bin/java Test
java/lang/UnsatisfiedLinkError : Failed loading library
"libhyzlib.so": DSO load failed

I'm working on the fix.
--
Ivan

On 9/23/06, Nikolay Kuznetsov <ni...@gmail.com> wrote:
> Yes, I've seen the same, please keep us informed if you find a solution.
>
> On 9/23/06, Ivan Volosyuk <iv...@gmail.com> wrote:
> > GNU gdb 6.4
> >
> > Attaching is ok, but it is not quite convinient to do attaching when
> > running small test, I prefer: gdb --args prog args... but it no longer
> > works for me after switch to new launcher.
> > --
> > Ivan
> >
> > On 9/23/06, Sunny Chan <ma...@sunnychan.org.uk> wrote:
> > > Which version of gdb are you using? Older version of gdb doesn't play along well
> > > with nptl or java launcher which spawn another process.
> > >
> > > Try running your java program first and attach gdb to the process.
> > >
> > > Ivan Volosyuk wrote:
> > > > I have problems running drlvm from gdb:
> > > >
> > > > (gdb) run
> > > > Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/java Test
> > > > [Thread debugging using libthread_db enabled]
> > > > [New Thread -1214326592 (LWP 25698)]
> > > > [New Thread -1214510160 (LWP 25701)]
> > > > Cannot find user-level thread for LWP 25698: generic error
> > > >
> > > > Does anybody have seen the problem?

---------------------------------------------------------------------
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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by Nikolay Kuznetsov <ni...@gmail.com>.
Yes, I've seen the same, please keep us informed if you find a solution.

On 9/23/06, Ivan Volosyuk <iv...@gmail.com> wrote:
> GNU gdb 6.4
>
> Attaching is ok, but it is not quite convinient to do attaching when
> running small test, I prefer: gdb --args prog args... but it no longer
> works for me after switch to new launcher.
> --
> Ivan
>
> On 9/23/06, Sunny Chan <ma...@sunnychan.org.uk> wrote:
> > Which version of gdb are you using? Older version of gdb doesn't play along well
> > with nptl or java launcher which spawn another process.
> >
> > Try running your java program first and attach gdb to the process.
> >
> > Ivan Volosyuk wrote:
> > > I have problems running drlvm from gdb:
> > >
> > > (gdb) run
> > > Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/java Test
> > > [Thread debugging using libthread_db enabled]
> > > [New Thread -1214326592 (LWP 25698)]
> > > [New Thread -1214510160 (LWP 25701)]
> > > Cannot find user-level thread for LWP 25698: generic error
> > >
> > > Does anybody have seen the problem?
>
> --
> Ivan
> 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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by Ivan Volosyuk <iv...@gmail.com>.
GNU gdb 6.4

Attaching is ok, but it is not quite convinient to do attaching when
running small test, I prefer: gdb --args prog args... but it no longer
works for me after switch to new launcher.
--
Ivan

On 9/23/06, Sunny Chan <ma...@sunnychan.org.uk> wrote:
> Which version of gdb are you using? Older version of gdb doesn't play along well
> with nptl or java launcher which spawn another process.
>
> Try running your java program first and attach gdb to the process.
>
> Ivan Volosyuk wrote:
> > I have problems running drlvm from gdb:
> >
> > (gdb) run
> > Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/java Test
> > [Thread debugging using libthread_db enabled]
> > [New Thread -1214326592 (LWP 25698)]
> > [New Thread -1214510160 (LWP 25701)]
> > Cannot find user-level thread for LWP 25698: generic error
> >
> > Does anybody have seen the problem?

-- 
Ivan
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: [classlib][launcher][drlvm] Running vm inside gdb

Posted by Sunny Chan <ma...@sunnychan.org.uk>.
Which version of gdb are you using? Older version of gdb doesn't play along well 
with nptl or java launcher which spawn another process.

Try running your java program first and attach gdb to the process.

Ivan Volosyuk wrote:
> I have problems running drlvm from gdb:
> 
> (gdb) run
> Starting program: /home/ivan/svn/drlvm/trunk/build/deploy/jre/bin/java Test
> [Thread debugging using libthread_db enabled]
> [New Thread -1214326592 (LWP 25698)]
> [New Thread -1214510160 (LWP 25701)]
> Cannot find user-level thread for LWP 25698: generic error
> 
> Does anybody have seen the problem?


---------------------------------------------------------------------
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