Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: One piece of code, two mysteries!

by Polyglot (Chaplain)
on Oct 05, 2012 at 03:25 UTC ( [id://997366]=note: print w/replies, xml ) Need Help??


in reply to One piece of code, two mysteries! (UPDATED.)

No answers here either, as I'm getting the following:

# ./test_perl.pl

Using minimum thread stack size of 16384 at /usr/lib/perl/5.10/threads.pm line 49.

Segmentation fault

# perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi

(with 53 registered patches, see perl -V for more detail)

Note: I changed the shebang line to read: #!/usr/bin/perl -slw (to match my installation of perl).

Blessings,

~Polyglot~

Replies are listed 'Best First'.
Re^2: One piece of code, two mysteries!
by BrowserUk (Patriarch) on Oct 05, 2012 at 03:27 UTC

    Increase the stack_size parameter to meet the requirements of your platform; or omit it entirely and accept the default.

    (Ps. I thought that I remembered the minimum stack requirement on Linux was 64k not 16k; but that doesn't gell with the informational message you are getting?)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      Ok, when I set it to 16k (16384), I got a segmentation fault. When I commented out the line entirely, it seemed to go to indefinite sleep and returned nothing to the screen. I did not even see the process in "top." I finally tried setting the stack to 65535 and got the following output.
      # ./test_perl.pl 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
      Is that what was expected?

      Blessings,

      ~Polyglot~

        When I commented out the line entirely,

        Do you mean like this?:

        #use threads stack_size => 4096;

        If so, you should have at the very minimum got an error: "Can't call method "async" without a package or object reference at ..."!?

        To disable the stack_size parameter, you should do:

        use threads; # stack_size => 4096;

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        RIP Neil Armstrong

Re^2: One piece of code, two mysteries!
by mbethke (Hermit) on Oct 05, 2012 at 05:19 UTC
    Exactly the same here with both 5.14.2 and 5.16.1 BTW.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://997366]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-19 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found