question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation fault

See original GitHub issue

My config:

Anaconda 2 + tensorflow (no gpu) / Ubuntu 16.04

I assemble sonnet as specified, except I build with following flag:

bazel build --config=opt :install --copt=“-D_GLIBCXX_USE_CXX11_ABI=0”

I use this flag. because otherwise I get following error:

NotFoundError: /home/kovalenko/anaconda2/lib/python2.7/site-packages/sonnet/python/ops/_resampler.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev

Following code causes error Segmentation fault:

import numpy as np
import sonnet as snt
import tensorflow as tf

image = np.ones((1, 100, 100, 3))
image[0, 50, :, :] = 0
image[0, :, 50, :] = 0

shift = np.ones((100, 100, 2))
shift[:, :, 1] = 0
shift = np.expand_dims(shift, 0)

res = snt.resampler(tf.Variable(initial_value=image), tf.Variable(initial_value=shift))

init_op = tf.global_variables_initializer()
sess = tf.Session()
sess.run(init_op)

# following line triggers error
x = res.eval(session=sess)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
malcolmreynoldscommented, Apr 24, 2017

@Tutufa glad you got it sorted - As far as I’m aware we’re not specifying versions of GCC anywhere in the Sonnet repository, but depending on what is installed on your system bazel may pick up mismatching versions. We’ll be updating the install instructions soon to try to cover the issues that people have been having, thanks for providing this information.

0reactions
Tutufacommented, Apr 25, 2017

Yes, it was gcc version mismatch. Do the following:

  1. Compile r1.1 TF from github, install TF
  2. Compile Sonnet (switch to r1.1 in tensorflow dir inside sonnet), Install Sonnet

I used gcc 5.*

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segmentation fault - Wikipedia
Segmentation faults are a common class of error in programs written in languages like C that provide low-level memory access and few to...
Read more >
c++ - What is a segmentation fault? - Stack Overflow
A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to...
Read more >
Identify what's causing segmentation faults (segfaults)
A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core...
Read more >
Core Dump (Segmentation fault) in C/C++ - GeeksforGeeks
When a piece of code tries to do read and write operation in a read only location in memory or freed block of...
Read more >
What Is a Segmentation Fault in Linux?
A segmentation fault, or segfault, is a memory error in which a program tries to access a memory address that does not exist...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found