मेरे पास एक चल रही पर्ल प्रक्रिया है जो अटक गया है, मैं यह देखने के लिए एक डीबगर के साथ अंदर पोक करना चाहता हूं कि क्या गलत है। मैं प्रक्रिया को पुनरारंभ नहीं कर सकता। क्या मैं डीबगर को चल रही प्रक्रिया में संलग्न कर सकता हूं? मुझे पता है कि मैं gdb -p
कर सकता हूं, लेकिन gdb
मेरी मदद नहीं करता है। मैं Enbugger की कोशिश की है, लेकिन असफल:मैं चल रहे पर्ल प्रक्रिया में डीबगर कैसे संलग्न कर सकता हूं?
$ perl -e 'while (1) {}'&
[1] 86836
$ gdb -p 86836
…
Attaching to process 86836.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ............................. done
Reading symbols for shared libraries + done
0x000000010c1694c6 in Perl_pp_stub()
(gdb) call (void*)Perl_eval_pv("require Enbugger;Enbugger->stop;",0)
perl(86836) malloc: *** error for object 0x3: pointer being realloc'd was not allocated
*** set a breakpoint in malloc_error_break to debug
Program received signal SIGABRT, Aborted.
0x00007fff8269d82a in __kill()
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (Perl_eval_pv) will be abandoned.
(gdb)
Am मैं इसे गलत कर? क्या अन्य विकल्प हैं?
पीएस आपको लगता है कि आप एक डिबगर चल रहे एक अपने आप को इस प्रक्रिया से जुड़ी से फायदा हो सकता है, तो आप एक डिबगर पिछले दरवाजे SIGUSR1 से शुरू हो रहा सम्मिलित कर सकते हैं:
use Enbugger::OnError 'USR1';
तो फिर तुम बस kill -USR1 pid
और अपने प्रक्रिया डीबगर में कूद जाएगा कर सकते हैं।