How to native debug Java on macOS?

Chris Plummer chris.plummer at oracle.com
Tue Oct 1 17:04:24 UTC 2019


Hi Alexander,

That's very interesting and useful info. I was indeed always launching 
the app from a shell first, and then attaching from xcode. I'll have to 
try launching directly from lldb.

BTW, it looks like in both cases the bad address is the polling page + 
8, so I'm not too sure the point you are trying to make about that.

thanks,

Chris

On 10/1/19 3:27 AM, Alexander Miloslavskiy wrote:
> Sorry about very late reply.
>
> Did quite a bit of experimenting, trying to get back that pesky 
> 'EXC_BAD_ACCESS' problem. Long story short, I will go straight to the 
> interesting stuff, answering your questions is no longer needed.
>
> When I use lldb to start my program like `lldb ~/Downloads/program` 
> then 'os::_polling_page' exceptions are seen as continuable 'SIGBUS'.
>
> When I use lldb to attach to running process with `lldb -p` then 
> 'os::_polling_page' exceptions are seen as non-continuable 
> 'EXC_BAD_ACCESS'.
>
> At this moment, I lack the knowledge to explain this difference.
>
> To verify that you're dealing with same 'os::_polling_page' exceptions 
> in both cases:
> 1) 'SIGBUS' scenario:
>    thread #1, queue = 'com.apple.main-thread', stop reason = signal 
> SIGBUS
>      0x10647fb56: testl  %eax, (%r10)
>    (lldb) print/x $r10
>      0x00000001000fd008
>    (lldb) print _ZN2os13_polling_pageE
>      0x00000001000fd000
>    These two are obviously related.
> 2) 'EXC_BAD_ACCESS' scenario:
>    thread #1, queue = 'com.apple.main-thread', stop reason = 
> EXC_BAD_ACCESS (code=2, address=0x105c4d008)
>    (lldb) print _ZN2os13_polling_pageE
>      0x0000000105c4d000
>    Notice '0x105c4d008' vs '0x0000000105c4d000'.




More information about the hotspot-dev mailing list