Skip to content

"stack smashing detected" occur with liblapacke64 #41

@mrkn

Description

@mrkn

I used this test script.

$ cat test.rb
require "numo/linalg/autoloader"
require "datasets-numo-narray"
require "rumale"

p Numo::Linalg::Autoloader.libs

numeric_columns = [
  :bill_length_mm, :bill_depth_mm, :flipper_length_mm, :body_mass_g
]

penguins = Datasets::Penguins.new
array = penguins.filter_map do |record|
  values = numeric_columns.map do |column|
    record[column]
  end
  unless values.include?(nil)
    values
  end
end

x = Numo::NArray[*array]

x_std = Rumale::Preprocessing::StandardScaler.new.fit_transform(x)

pca = Rumale::Decomposition::PCA.new#(n_components: 4)
p pca.fit_transform(x_std)

First, I confirmed that the problem occurs with liblapacke64.

$ ruby test.rb 
["/usr/lib/x86_64-linux-gnu/libopenblas.so.0", "/usr/lib/x86_64-linux-gnu/liblapacke64.so.3.9.0"]
*** stack smashing detected ***: terminated
Aborted (core dumped)

Then, I tried the same test script with liblapacke.

$ sudo apt remove liblapacke64
...(snip)...
$ ruby test.rb
["/usr/lib/x86_64-linux-gnu/libopenblas.so.0", "/usr/lib/x86_64-linux-gnu/liblapacke.so.3.9.0"]
Numo::DFloat#shape=[342,2]
[[1.84075, 0.0476324], 
 [1.30485, -0.427722], 
 [1.36718, -0.15425], 
 [1.87608, -0.00204541], 
 [1.90895, 0.827996], 
 [1.76045, -0.350965], 
 [0.808889, 0.521724], 
 [1.83252, -0.768507], 
 [1.19246, 1.02478], 
 [1.72767, -0.787415], 
 [1.74049, -0.665515], 
 [1.78609, -0.235726], 
 [1.94543, 1.00977], 
 [1.56169, 0.596213], 
 [1.7371, -0.593942], 
 [1.56656, 0.0957962], 
 [0.794444, 1.30888], 
 [2.33955, -0.631749], 
 [0.992793, 1.98276], 
 [2.39412, -0.294074], 
 ...

The problem does not occur with liblapacke.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions