<div dir="ltr"><div><div><div><div>Hi all,<br><br></div>I think I solved the problem: it had to do with the Endian-ness of the Operating System. I was using RHEL 7.0 Big Endian, not the Little Endian version as it is on any x86 System.<br><br></div>I compiled Scilab on RHEL 7.1 Little Endian, on both PowerKVM and PowerVM, and the issue did not show up again.<br><br></div>I assume then that if the OS is Big Endian, the memory allocation functions won't get the real memory allocated because the Memory is allocated in another order.<br><br></div>Issue is then more or less solved, as long as you use a Little Endian Operating System (like SUSE 12 and Ubuntu 14 on POWER)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 9 March 2015 at 09:43, <a href="/user/SendEmail.jtp?type=node&node=4032056&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a> <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=4032056&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all, I would like to "bump" this discussion, as I haven't been able to move forward after a week, still facing the same problems. Also, I would be able to provide remote access to this ppc64 machine if needed.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2015 at 15:02, <a href="/user/SendEmail.jtp?type=node&node=4032056&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a> <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=4032056&i=3" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Clement,<br><br></div>Many thanks for your answer!<br><br></div><div>I found those macros and in the meantime I found a little more info too. Maybe that can help to understand the issue; it seems really puzzling.<br><br></div><div> A) The value returned for  __LONG_MAX___ , after querying the compiler, is like that:<br><b><br>[root@localhost ~]#  gcc -dM -E - < /dev/null  |grep __LONG_MAX__<br>#define __LONG_MAX__ 9223372036854775807L<br></b><br></div><div> B) The problem shouldn't be the method <b>get_max_memory_for_scilab_stack(void)</b>, as I initially thought, because I noticed it is called by <b>sci_stacksize.c</b> to verify if the value given as input is out of bounds. If you do, let's say, <b>stacksize(1)</b>, it will return: <br><b><span><br>-->stacksize(1)<br>             !--error 1504<br>stacksize: Out of bounds value. Not in [180000,268435454].<br><br><br></span>--></b><br><br></div><div> the value given as the lower bound, is explicitly defined in the class. The value for the upper bound is instead taken from <b>get_max_memory_for_scilab_stack(void)</b>, so that method should not be the problem as in this case, it returns an apparently good value.<br></div><div><br></div><div> C) The error is generated at compile time when the buildmacros script does <b>stacksize(5000000)</b>. The system returns it cannot allocate this stacksize, as it apparently "thinks" the value 5000000 is bigger than the max stacksize, which we have seen from before, it should amount to <b>268435454</b>. It checks if 5000000 is lower than get_max_memory_for_scilab_stack() in stackinfo.c (which should be <b>268435454)</b>, it understands that it's larger, and prompts out the error. I tried to "trick the system" by eliminating this check in the class stackinfo.c. The compilation in that case fails as it says the stack size has been exceeded: which is another error message. <br><b><br>./bin/scilab-cli -ns -noatomsautoload -f modules/functions/scripts/buildmacros/buildmacros.sce<br>stacksize(5000000);<br>                   !--error 42<br>A fatal error has been detected by Scilab.<br>Your instance will probably quit unexpectedly soon.<br>If a graphic feature has been used, this might be caused by the system graphic drivers.<br>Please try to update them and run this feature again.<br>You can report a bug on <a href="http://bugzilla.scilab.org/" target="_blank" rel="nofollow" link="external">http://bugzilla.scilab.org/</a> with:<br>* a sample code which reproduces the issue<br>* the result of [a, b] = getdebuginfo()<br>* the following information:<br>[localhost:10797] Signal: Segmentation fault (11)<br>[localhost:10797] Signal code: Invalid permissions (2)<br>[localhost:10797] Failing at address: 0x10000a096928<br><br>Call stack:<br>   1: ?        ?                                (?)<br>   2: 0x2c381c <unsfdcopy_>                     (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>   3: 0x1f4060 <adjuststacksize_>               (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>   4: 0x1805d0 < >                              (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>   5: 0x180de4 <sci_stacksize_>                 (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>   6: 0x1ae7ac <callFunctionFromGateway>        (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>   7: 0x18944c <gw_core>                        (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>   8: 0x1ae8a0 <callinterf_>                    (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>   9: 0x1c7d50 <scirun_>                        (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>  10: 0x1c1220 <realmain>                       (/root/scilab/scilab-5.5.1/modules/.libs/libscilab-cli.so.0)<br>  11: 0x18b4   < >                              (/root/scilab/scilab-5.5.1/.libs/lt-scilab-cli-bin)<br>  12: 0x4454c  < >                              (/lib64/power8/libc.so.6)<br>  13: 0x44774  <__libc_start_main>              (/lib64/power8/libc.so.6)<br>End of stack<br><br><br>at line      27 of exec file called by :<br>exec('modules/functions/scripts/buildmacros/buildmacros.sce',-1)<br><br>                                                                 !--error 999<br>Aborting current computation<br><br><br></b><br><br></div><div> D) I also tried to trick the system by eliminating the command <b>stacksize(5000000) </b>from buildmacros, and the compilation completed successfully. However, when starting <b>scilab-cli</b>, there is a startup script which apparently tests the stacksize and displays the error, although scilab keeps working. Wheneven I try however to allocate a stacksize, it displays the error again.<br><br></div><div>E) I modified the class to explicitly declare a value lower than 180'000 as the lower bound. I set 1. I tried to do <b>stacksize(2)</b>, and it also returned that it cannot allocate this quantity of memory.<br></div><div><br><br></div><div>If you would like to have a closer look, and I would really thank you for that, I think I can arrange for a remote access on my VM, so that you can see directly.<br><br></div><div>Thanks!<br><br></div><div>Andrea<br></div><div><table height="1" width="147"><tbody><tr><td></td><td></td><td><br></td>
          <td><br></td>
          <td><br></td>
          <td><br></td></tr></tbody></table></div><div><br></div><div><br><br><br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2015 at 10:25, Clément David-2 [via Scilab / Xcos - Mailing Lists Archives] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=4032056&i=4" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

        Hello (added dev ML),
<br><br>Le lundi 02 mars 2015 à 06:01 -0700, Nukles a écrit :
<br>> So my guess is: MAXLONG is not declared, so the function does not return a
<br>> value (or it returns 0) and therefore the error message is triggered because
<br>> the stacksize given as input is higher than 0 or NULL or N/A.
<br>> 
<br>> My questions are then:
<br>> 
<br>>  - Why are all lines commented where MAXLONG is defined?
<br><br>On my system (Fedora 21 x86_64) the MAXLONG macro is defined at :
<br><br>stackinfo.c:35 #define MAXLONG LONG_MAX
<br><br>and LONG_MAX comes from limits.h
<br><br><br>>  - Where does MAXLONG originate from? Is it something passed from the
<br>> kernel?
<br>>  - How can I solve the problem?
<br><br>Well, as we do not have any PPC64 at Scilab I cannot check. Is a VM
<br>available for that platform / distro ?
<br><br><br>--
<br>Clément
<br><br>_______________________________________________
<br>users mailing list
<br><a href="http:///user/SendEmail.jtp?type=node&node=4031774&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="http://lists.scilab.org/mailman/listinfo/users" rel="nofollow" link="external" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>

        
        
        
        <br>
        <br>
        <hr color="#cccccc" noshade size="1">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><span>
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </span><a href="http://mailinglists.scilab.org/Issue-when-compiling-Scilab-Cannot-allocate-this-quantity-of-memory-tp4031761p4031774.html" target="_blank" rel="nofollow" link="external">http://mailinglists.scilab.org/Issue-when-compiling-Scilab-Cannot-allocate-this-quantity-of-memory-tp4031761p4031774.html</a>
        </div><div><div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Issue when compiling Scilab: "Cannot allocate this quantity of memory", <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://mailinglists.scilab.org/Issue-when-compiling-Scilab-Cannot-allocate-this-quantity-of-memory-tp4031761p4032056.html">Re: Issue when compiling Scilab: "Cannot allocate this quantity of memory"</a><br/>
Sent from the <a href="http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html">Scilab users - Mailing Lists Archives mailing list archive</a> at Nabble.com.<br/>