this problem has made me puzzled for a long time. I am scripting a simple scaner, but it got some unknown mistakes
##################################################### my @report; Scan::ScanAll(\@addr, \@port, \@report); #bugs here "bug1"; printf "Report ref is : @report \n"; #"tag1" to see if script can +run here Report::TxtReport(@report); system("gedit report.txt"); ######################################################
Scan::ScanAll is a function that scan the address and ports in @addr and @port and return a unformated report to @report; When I send only one address to @addr and scanned, script can run to "tag1" place. But when I send more than an address to @addr , the script can not run to "tag1" and things after it, it seems to jump that section. There are other "printf" in Scan::ScanAll that shows me the Scan::ScanAll function runs well all the time. It seems that the bug flies out before "tag1" and after "bug1". Could anyone tell me why?
this is the output when run only one address ###################################################### 192.168.1.3 Create one thread for 192.168.1.3 192.168.1.3 135/tcp 139/tcp 445/tcp Finish ScanAll sub, Get Out of Scan.pm ARRAY(0x867f1cc) Report ref is : ARRAY(0x867f1cc) ###here get out of ###Scan::ScanAl +l, and I printed the @report, code can go on Get in Html Report.pm 192.168.1.3 135/tcp msrpc 135 tcp Microsoft RPC services 139/tcp 445/tcp A Session finished Scaning! excting ###debug msg show finish ### here I called firefox to read the report in html, in ### common, finish all the scan should print as upon GLib-GObject-WARNING **: instance with invalid (NULL) class pointer. GLib-GObject-CRITICAL **: file gsignal.c: line 2122 (g_signal_emit_val +ist): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed. GLib-GObject-WARNING **: instance with invalid (NULL) class pointer. GLib-GObject-CRITICAL **: file gsignal.c: line 1765 (g_signal_handlers +_destroy): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed. ###################################################### this is the output when run >1 addresses ###################################################### 10.0.144.90 192.168.1.2 192.168.1.3 Create one thread for 10.0.144.90 Create one thread for 192.168.1.2 Create one thread for 192.168.1.3 10.0.144.90 192.168.1.2 192.168.1.3 135/tcp 139/tcp 445/tcp Finish ScanAll sub, Get Out of Scan.pm ARRAY(0x8661c8c) ARRAY(0x8661d88) ARRAY(0x8661dac) ###here get out of Scan::ScanAll, the refs are printed in ###Scan::Sca +nALL as a debugs msg, it shows me, in ###Scan::ScanALL, @result is ok + yet, it can not run on when ###return from Scan::ScanAll. Lib-GObject-WARNING **: instance of invalid non-instantiatable type `g +pointer' during global destruction. Lib-GObject-CRITICAL **: file gsignal.c: line 2122 (g_signal_emit_vali +st): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed during globa +l destruction. Lib-GObject-WARNING **: instance of invalid non-instantiatable type `g +pointer' during global destruction. Lib-GObject-CRITICAL **: file gsignal.c: line 1765 (g_signal_handlers_ +destroy): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed during +global destruction. Lib-GObject-WARNING **: instance of invalid non-instantiatable type `< +invalid>' during global destruction. Lib-GObject-CRITICAL **: file gsignal.c: line 2122 (g_signal_emit_vali +st): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed during globa +l destruction. Lib-GObject-WARNING **: instance of invalid non-instantiatable type `< +invalid>' during global destruction. Lib-GObject-CRITICAL **: file gsignal.c: line 1765 (g_signal_handlers_ +destroy): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed during +global destruction. Lib-GObject-WARNING **: instance of invalid non-instantiatable type `< +unknown>' during global destruction. Lib-GObject-CRITICAL **: file gsignal.c: line 2122 (g_signal_emit_vali +st): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed during globa +l destruction. Lib-GObject-WARNING **: instance of invalid non-instantiatable type `< +unknown>' during global destruction. Lib-GObject-CRITICAL **: file gsignal.c: line 1765 (g_signal_handlers_ +destroy): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed during +global destruction.
I've got a poor english so I dont know if I made it clear. thx all the same

In reply to how does my code get lost? by A_Banknote

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.