1 /*
2 * Copyright (c) 1997, 2015, 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 *
5250 tty->print_cr("C heap has been corrupted (time: %d allocations)", mallocDebugCounter);
5251 tty->print_cr("corrupted block near address %#x, length %d", phe.lpData, phe.cbData);
5252 HeapUnlock(heap);
5253 fatal("corrupted C heap");
5254 }
5255 }
5256 DWORD err = GetLastError();
5257 if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
5258 HeapUnlock(heap);
5259 fatal("heap walk aborted with error %d", err);
5260 }
5261 HeapUnlock(heap);
5262 }
5263 mallocDebugIntervalCounter = 0;
5264 }
5265 return true;
5266 }
5267
5268
5269 bool os::find(address addr, outputStream* st) {
5270 // Nothing yet
5271 return false;
5272 }
5273
5274 LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
5275 DWORD exception_code = e->ExceptionRecord->ExceptionCode;
5276
5277 if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
5278 JavaThread* thread = JavaThread::current();
5279 PEXCEPTION_RECORD exceptionRecord = e->ExceptionRecord;
5280 address addr = (address) exceptionRecord->ExceptionInformation[1];
5281
5282 if (os::is_memory_serialize_page(thread, addr)) {
5283 return EXCEPTION_CONTINUE_EXECUTION;
5284 }
5285 }
5286
5287 return EXCEPTION_CONTINUE_SEARCH;
5288 }
5289
5290 // We don't build a headless jre for Windows
5291 bool os::is_headless_jre() { return false; }
|
1 /*
2 * Copyright (c) 1997, 2016, 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 *
5250 tty->print_cr("C heap has been corrupted (time: %d allocations)", mallocDebugCounter);
5251 tty->print_cr("corrupted block near address %#x, length %d", phe.lpData, phe.cbData);
5252 HeapUnlock(heap);
5253 fatal("corrupted C heap");
5254 }
5255 }
5256 DWORD err = GetLastError();
5257 if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
5258 HeapUnlock(heap);
5259 fatal("heap walk aborted with error %d", err);
5260 }
5261 HeapUnlock(heap);
5262 }
5263 mallocDebugIntervalCounter = 0;
5264 }
5265 return true;
5266 }
5267
5268
5269 bool os::find(address addr, outputStream* st) {
5270 int offset = -1;
5271 bool result = false;
5272 char buf[256];
5273 // Note: there is no easy way to handle library name trunctation here. In case
5274 // of truncation, we just omit the library name.
5275 // See also JDK-8147512.
5276 if (os::dll_address_to_library_name(addr, buf, sizeof(buf), &offset)) {
5277 st->print(PTR_FORMAT " ", addr);
5278 if (strlen(buf) < 255) {
5279 char* p = strrchr(buf, '\\');
5280 if (p) {
5281 st->print("%s", p + 1);
5282 } else {
5283 st->print("%s", buf);
5284 }
5285 }
5286 if (os::dll_address_to_function_name(addr, buf, sizeof(buf), &offset)) {
5287 st->print("::%s + 0x%x", buf, offset);
5288 }
5289 st->cr();
5290 result = true;
5291 }
5292 return result;
5293 }
5294
5295 LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
5296 DWORD exception_code = e->ExceptionRecord->ExceptionCode;
5297
5298 if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
5299 JavaThread* thread = JavaThread::current();
5300 PEXCEPTION_RECORD exceptionRecord = e->ExceptionRecord;
5301 address addr = (address) exceptionRecord->ExceptionInformation[1];
5302
5303 if (os::is_memory_serialize_page(thread, addr)) {
5304 return EXCEPTION_CONTINUE_EXECUTION;
5305 }
5306 }
5307
5308 return EXCEPTION_CONTINUE_SEARCH;
5309 }
5310
5311 // We don't build a headless jre for Windows
5312 bool os::is_headless_jre() { return false; }
|