1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
287 if( sender.is_entry_frame()) {
288 // Validate the JavaCallWrapper an entry frame must have
289
290 address jcw = (address)sender.entry_frame_call_wrapper();
291
292 bool jcw_safe = (jcw <= thread->stack_base()) && ( jcw > sender_fp);
293
294 return jcw_safe;
295 }
296
297 // If the frame size is 0 something is bad because every nmethod has a non-zero frame size
298 // because you must allocate window space
299
300 if (sender_blob->frame_size() == 0) {
301 assert(!sender_blob->is_nmethod(), "should count return address at least");
302 return false;
303 }
304
305 // The sender should positively be an nmethod or call_stub. On sparc we might in fact see something else.
306 // The cause of this is because at a save instruction the O7 we get is a leftover from an earlier
307 // window use. So if a runtime stub creates two frames (common in fastdebug/jvmg) then we see the
308 // stale pc. So if the sender blob is not something we'd expect we have little choice but to declare
309 // the stack unwalkable. pd_get_top_frame_for_signal_handler tries to recover from this by unwinding
310 // that initial frame and retrying.
311
312 if (!sender_blob->is_nmethod()) {
313 return false;
314 }
315
316 // Could put some more validation for the potential non-interpreted sender
317 // frame we'd create by calling sender if I could think of any. Wait for next crash in forte...
318
319 // One idea is seeing if the sender_pc we have is one that we'd expect to call to current cb
320
321 // We've validated the potential sender that would be created
322
323 return true;
324
325 }
326
327 // Must be native-compiled frame. Since sender will try and use fp to find
|
1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
287 if( sender.is_entry_frame()) {
288 // Validate the JavaCallWrapper an entry frame must have
289
290 address jcw = (address)sender.entry_frame_call_wrapper();
291
292 bool jcw_safe = (jcw <= thread->stack_base()) && ( jcw > sender_fp);
293
294 return jcw_safe;
295 }
296
297 // If the frame size is 0 something is bad because every nmethod has a non-zero frame size
298 // because you must allocate window space
299
300 if (sender_blob->frame_size() == 0) {
301 assert(!sender_blob->is_nmethod(), "should count return address at least");
302 return false;
303 }
304
305 // The sender should positively be an nmethod or call_stub. On sparc we might in fact see something else.
306 // The cause of this is because at a save instruction the O7 we get is a leftover from an earlier
307 // window use. So if a runtime stub creates two frames (common in fastdebug/debug/jvmg) then we see the
308 // stale pc. So if the sender blob is not something we'd expect we have little choice but to declare
309 // the stack unwalkable. pd_get_top_frame_for_signal_handler tries to recover from this by unwinding
310 // that initial frame and retrying.
311
312 if (!sender_blob->is_nmethod()) {
313 return false;
314 }
315
316 // Could put some more validation for the potential non-interpreted sender
317 // frame we'd create by calling sender if I could think of any. Wait for next crash in forte...
318
319 // One idea is seeing if the sender_pc we have is one that we'd expect to call to current cb
320
321 // We've validated the potential sender that would be created
322
323 return true;
324
325 }
326
327 // Must be native-compiled frame. Since sender will try and use fp to find
|