octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52118] randg: segfault with erroneous argumen


From: Rik
Subject: [Octave-bug-tracker] [bug #52118] randg: segfault with erroneous arguments
Date: Tue, 26 Sep 2017 13:28:35 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #3, bug #52118 (project octave):

Looking more closely, it does seem that the documentation needs to be fixed. 
The calling form for two inputs is really


randg (A, N)


rather than


randg (M, N)


as would be expected from the other randXXX functions and the documentation. 
Hence, when called with


randg (1, 1e6)


the function is trying to create a 1e6 X 1e6 matrix which is quite large.

My first thought is that the documentation needs to be updated to be like that
of randp which does properly document the first argument.

The second issue, the segfault, might just be a problem with the Address
Sanitizer.  I get a segfault when I execute


x = zeros (1e6);


But when I run a version of Octave that hasn't been compiled with the Address
Sanitizer then I get


x = zeros (1e6)
error: out of memory or dimension too large for Octave's index type


This seems correct.  The top of the backtrace log for me contains


==7785==WARNING: AddressSanitizer failed to allocate 0x0746a5288000 bytes
==7785==AddressSanitizer's allocator is terminating the process instead of
returning 0
==7785==If you don't like this behavior set allocator_may_return_null=1


I tried setting the variable suggested to control AddressSanitizer, and now I
get a slightly different backtrace.  However, my guess is that when compiled
normally Octave just gets this right.  The call to new() is too large and the
library throws an exception which Octave then catches and returns an error
message.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52118>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]