150 }
151 return frame(fr->sender_sp(), fr->sender_pc());
152 }
153
154
155 frame os::current_frame() {
156 intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer());
157 // hack.
158 frame topframe(csp, (address)0x8);
159 // return sender of current topframe which hopefully has pc != NULL.
160 return os::get_sender_for_C_frame(&topframe);
161 }
162
163 // Utility functions
164
165 extern "C" JNIEXPORT int
166 JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) {
167
168 ucontext_t* uc = (ucontext_t*) ucVoid;
169
170 Thread* t = ThreadLocalStorage::get_thread_slow(); // slow & steady
171
172 SignalHandlerMark shm(t);
173
174 // Note: it's not uncommon that JNI code uses signal/sigset to install
175 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
176 // or have a SIGILL handler when detecting CPU type). When that happens,
177 // JVM_handle_aix_signal() might be invoked with junk info/ucVoid. To
178 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
179 // that do not require siginfo/ucontext first.
180
181 if (sig == SIGPIPE) {
182 if (os::Aix::chained_handler(sig, info, ucVoid)) {
183 return 1;
184 } else {
185 if (PrintMiscellaneous && (WizardMode || Verbose)) {
186 warning("Ignoring SIGPIPE - see bug 4229104");
187 }
188 return 1;
189 }
190 }
|
150 }
151 return frame(fr->sender_sp(), fr->sender_pc());
152 }
153
154
155 frame os::current_frame() {
156 intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer());
157 // hack.
158 frame topframe(csp, (address)0x8);
159 // return sender of current topframe which hopefully has pc != NULL.
160 return os::get_sender_for_C_frame(&topframe);
161 }
162
163 // Utility functions
164
165 extern "C" JNIEXPORT int
166 JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) {
167
168 ucontext_t* uc = (ucontext_t*) ucVoid;
169
170 Thread* t = Thread::current();
171
172 SignalHandlerMark shm(t);
173
174 // Note: it's not uncommon that JNI code uses signal/sigset to install
175 // then restore certain signal handler (e.g. to temporarily block SIGPIPE,
176 // or have a SIGILL handler when detecting CPU type). When that happens,
177 // JVM_handle_aix_signal() might be invoked with junk info/ucVoid. To
178 // avoid unnecessary crash when libjsig is not preloaded, try handle signals
179 // that do not require siginfo/ucontext first.
180
181 if (sig == SIGPIPE) {
182 if (os::Aix::chained_handler(sig, info, ucVoid)) {
183 return 1;
184 } else {
185 if (PrintMiscellaneous && (WizardMode || Verbose)) {
186 warning("Ignoring SIGPIPE - see bug 4229104");
187 }
188 return 1;
189 }
190 }
|