public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Debugging a NullPointerException in fstack
@ 2008-06-10  7:20 Ray Ruvinskiy
  2008-06-10  7:40 ` Phil Muldoon
  0 siblings, 1 reply; 7+ messages in thread
From: Ray Ruvinskiy @ 2008-06-10  7:20 UTC (permalink / raw)
  To: frysk

Hello,

I've compiled frysk on an i386 Fedora 8 system (thanks a lot to Rick  
Moseley for all his previous help on IRC), and I'm attempting to play  
with fstack. It seems to work on some processes (e.g., bash) but goes  
down with a NullPointerException on most others (gconf, gnome- 
screensaver, others).

I was wondering whether this was a known issue and if not, what the  
best way to debug this would be. There is no stack trace displayed, so  
I'm not sure where the NPE is actually coming from. I was wondering if  
it was possible to compile frysk in a way that would make it more  
amenable to being debugged? Also, what is the recommended way to  
debug? gdb, printfs?

Thanks,

Ray

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Debugging a NullPointerException in fstack
  2008-06-10  7:20 Debugging a NullPointerException in fstack Ray Ruvinskiy
@ 2008-06-10  7:40 ` Phil Muldoon
  2008-06-11  2:17   ` Ray Ruvinskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Phil Muldoon @ 2008-06-10  7:40 UTC (permalink / raw)
  To: Ray Ruvinskiy; +Cc: frysk

Ray Ruvinskiy wrote:
> Hello,

Hi Ray,

Thanks for the report. The first thing I would do is to file a bug at:

http://sourceware.org/bugzilla/enter_bug.cgi?product=frysk

To track the issue. I would not worry too much about semantics of the 
bug reports, or whether it is a duplicate. The report itself is valuable 
even if it does already exist. Typically when I file a report I'll put 
in whether I run Frysk from RPM, or built from source. And what OS you 
are running it on. And just include all the output of the tool. If 
fstack is failing with an NPE on some processes not others, it is most 
certainly a programming error somewhere.

 From a more in depth perspective, if you build from source, you can 
test the sanity of your environment particular to your system by running 
the Frysk testsuite. I normally cd into frysk-core/ and run 
./TestRunner. You can do this from each sub-component, or if you like, 
run make check instead.

Lastly if you want to jump straight in, fix the problem yourself, and 
submit a patch, try turning debug logging on with something like:

./frysk/bindir/fstack -debug frysk=FINE 1234

But even if you do try to hack on it yourself, please do file a bug and 
assign it to yourself. We know who is hacking on what then.

Best of luck and hope to see you on IRC!

Regards

Phil Muldoon

>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Debugging a NullPointerException in fstack
  2008-06-10  7:40 ` Phil Muldoon
@ 2008-06-11  2:17   ` Ray Ruvinskiy
  2008-06-11  3:04     ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Ray Ruvinskiy @ 2008-06-11  2:17 UTC (permalink / raw)
  To: Phil Muldoon; +Cc: frysk

Phil,

Thank you very much for the tips. I have filed a bug with the debug  
logging output.

In general, I was wondering what the best way to debug gcj problems  
is. Is it possible to make it so that when a program compiled with gcj  
throws an exception, the stack trace is displayed, like it would be if  
a jar file is run with Sun's jre? Is there any hope in getting gdb to  
meaningfully debug gcj-compiled binaries?

Thanks,

Ray


On 10-Jun-08, at 3:20 AM, Phil Muldoon wrote:

> Ray Ruvinskiy wrote:
>> Hello,
>
> Hi Ray,
>
> Thanks for the report. The first thing I would do is to file a bug at:
>
> http://sourceware.org/bugzilla/enter_bug.cgi?product=frysk
>
> To track the issue. I would not worry too much about semantics of  
> the bug reports, or whether it is a duplicate. The report itself is  
> valuable even if it does already exist. Typically when I file a  
> report I'll put in whether I run Frysk from RPM, or built from  
> source. And what OS you are running it on. And just include all the  
> output of the tool. If fstack is failing with an NPE on some  
> processes not others, it is most certainly a programming error  
> somewhere.
>
> From a more in depth perspective, if you build from source, you can  
> test the sanity of your environment particular to your system by  
> running the Frysk testsuite. I normally cd into frysk-core/ and  
> run ./TestRunner. You can do this from each sub-component, or if you  
> like, run make check instead.
>
> Lastly if you want to jump straight in, fix the problem yourself,  
> and submit a patch, try turning debug logging on with something like:
>
> ./frysk/bindir/fstack -debug frysk=FINE 1234
>
> But even if you do try to hack on it yourself, please do file a bug  
> and assign it to yourself. We know who is hacking on what then.
>
> Best of luck and hope to see you on IRC!
>
> Regards
>
> Phil Muldoon
>
>>
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Debugging a NullPointerException in fstack
  2008-06-11  2:17   ` Ray Ruvinskiy
@ 2008-06-11  3:04     ` Tom Tromey
  2008-06-11  4:10       ` Ray Ruvinskiy
  2008-06-11 13:20       ` Phil Muldoon
  0 siblings, 2 replies; 7+ messages in thread
From: Tom Tromey @ 2008-06-11  3:04 UTC (permalink / raw)
  To: Ray Ruvinskiy; +Cc: Phil Muldoon, frysk

>>>>> "Ray" == Ray Ruvinskiy <rruvinsk@sybase.com> writes:

Ray> Is it possible to make it so that when a program compiled with
Ray> gcj throws an exception, the stack trace is displayed, like it
Ray> would be if a jar file is run with Sun's jre?

This should work in general.  I think in some places frysk swallows
exceptions or does not print traces.

Ray> Is there any hope in getting gdb to meaningfully debug
Ray> gcj-compiled binaries?

This should pretty much work.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Debugging a NullPointerException in fstack
  2008-06-11  3:04     ` Tom Tromey
@ 2008-06-11  4:10       ` Ray Ruvinskiy
  2008-06-12  5:44         ` Tom Tromey
  2008-06-11 13:20       ` Phil Muldoon
  1 sibling, 1 reply; 7+ messages in thread
From: Ray Ruvinskiy @ 2008-06-11  4:10 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Phil Muldoon, frysk

Interesting.

I was able to successfully step through the code in gdb but not to  
print out object contents. I saw things like the following:

(gdb) p pid
$12 = Expected a negative vbase offset (old compiler?)

Also, gdb displayed many warnings along the following lines:

warning: Missing the separate debug info file: /usr/lib/debug/.build- 
id/fa/841219472d35412ad631ad0f0fabb78e5c1957.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build- 
id/64/ce37a1b7ee7ce1c23dcfe9344cbb361c321b8f.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build- 
id/aa/af5e0dff4a6114026fc027a15c895e93e11733.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build- 
id/91/f8d452c6cc80573296b2bbb28a1dd076b0507f.debug

Ray

On 10-Jun-08, at 10:17 PM, Tom Tromey wrote:

>>>>>> "Ray" == Ray Ruvinskiy <rruvinsk@sybase.com> writes:
>
> Ray> Is it possible to make it so that when a program compiled with
> Ray> gcj throws an exception, the stack trace is displayed, like it
> Ray> would be if a jar file is run with Sun's jre?
>
> This should work in general.  I think in some places frysk swallows
> exceptions or does not print traces.
>
> Ray> Is there any hope in getting gdb to meaningfully debug
> Ray> gcj-compiled binaries?
>
> This should pretty much work.
>
> Tom
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Debugging a NullPointerException in fstack
  2008-06-11  3:04     ` Tom Tromey
  2008-06-11  4:10       ` Ray Ruvinskiy
@ 2008-06-11 13:20       ` Phil Muldoon
  1 sibling, 0 replies; 7+ messages in thread
From: Phil Muldoon @ 2008-06-11 13:20 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Ray Ruvinskiy, frysk

Tom Tromey wrote:
>>>>>> "Ray" == Ray Ruvinskiy <rruvinsk@sybase.com> writes:
>>>>>>             
>
> Ray> Is it possible to make it so that when a program compiled with
> Ray> gcj throws an exception, the stack trace is displayed, like it
> Ray> would be if a jar file is run with Sun's jre?
>
> This should work in general.  I think in some places frysk swallows
> exceptions or does not print traces.
>   

Can you please file a bug against the tool/component if you know of such 
a case?

Thanks

Phil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Debugging a NullPointerException in fstack
  2008-06-11  4:10       ` Ray Ruvinskiy
@ 2008-06-12  5:44         ` Tom Tromey
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2008-06-12  5:44 UTC (permalink / raw)
  To: Ray Ruvinskiy; +Cc: Phil Muldoon, frysk

>>>>> "Ray" == Ray Ruvinskiy <rruvinsk@sybase.com> writes:

Ray> I was able to successfully step through the code in gdb but not
Ray> to print out object contents.

Yeah, there are oddities here sometimes.  I just call the debug
printers instead:

call _Jv_Debug(obj)  # print OBJ
call _Jv_DeepDebug(obj, depth)  # print OBJ and sub-objects to DEPTH
call _Jv_StaticDeepDebug(obj, depth) # like _Jv_DeepDebug, but also
                                     # show static fields

Ray> (gdb) p pid
Ray> $12 = Expected a negative vbase offset (old compiler?)

I never remember what this means.  Basically the gcj support in gdb is
ok but not super.  So, you'll run into problems on occasion.

Ray> Also, gdb displayed many warnings along the following lines:

Ray> warning: Missing the separate debug info file: /usr/lib/debug/.build- 
Ray> id/fa/841219472d35412ad631ad0f0fabb78e5c1957.debug

You are missing debuginfo for various system libraries.
This is harmless unless you want to step into one of them.
Often, having info for libgcj is helpful.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-11 13:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-10  7:20 Debugging a NullPointerException in fstack Ray Ruvinskiy
2008-06-10  7:40 ` Phil Muldoon
2008-06-11  2:17   ` Ray Ruvinskiy
2008-06-11  3:04     ` Tom Tromey
2008-06-11  4:10       ` Ray Ruvinskiy
2008-06-12  5:44         ` Tom Tromey
2008-06-11 13:20       ` Phil Muldoon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).