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.

Constant Memory Error Stack Smashing

See original GitHub issue
CuPy Version          : 8.0.0b3
CUDA Root             : /usr/local/cuda
CUDA Build Version    : 11000
CUDA Driver Version   : 11000
CUDA Runtime Version  : 10020
cuBLAS Version        : 10202
cuFFT Version         : 10102
cuRAND Version        : 10102
cuSOLVER Version      : (10, 3, 0)
cuSPARSE Version      : 10301
NVRTC Version         : (10, 2)
Thrust Version        : 100906
cuDNN Build Version   : None
cuDNN Version         : None
NCCL Build Version    : None
NCCL Runtime Version  : None
CUB Version           : Enabled
cuTENSOR Version      : None

I’m trying to test constant memory usage with the master branch.

Here is my toy code

import cupy as cp

cuda_code = r"""
__constant__ float arr[10];
"""

module = cp.RawModule(code=cuda_code,)

memptr = module.get_global("arr")
print(memptr)

I’m getting the following error

*** stack smashing detected ***: terminated
Aborted (core dumped)

gdb output

(gdb) run constant_test.py 
Starting program: /home/belt/anaconda3/envs/lmc/bin/python3 constant_test.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5384700 (LWP 172697)]
[New Thread 0x7ffff4b83700 (LWP 172853)]
[New Thread 0x7ffff2382700 (LWP 173023)]
[New Thread 0x7fffefb81700 (LWP 173864)]
[New Thread 0x7fffed380700 (LWP 173867)]
[New Thread 0x7fffeab7f700 (LWP 173873)]
[New Thread 0x7fffe637e700 (LWP 173884)]
[New Thread 0x7fffe5b7d700 (LWP 173894)]
[New Thread 0x7fffe337c700 (LWP 173904)]
[New Thread 0x7fffe0b7b700 (LWP 173905)]
[New Thread 0x7fffde37a700 (LWP 173909)]
[New Thread 0x7fffa6b73700 (LWP 173937)]
[New Thread 0x7fffa5ccf700 (LWP 173938)]
[New Thread 0x7fffa54ce700 (LWP 173939)]
here
*** stack smashing detected ***: terminated

Thread 1 "python3" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
leofangcommented, Jun 24, 2020

I parsed the error output wrong 😅 It’s a new error for unclean builds that I haven’t seen before…

2reactions
kmaehashicommented, Jun 24, 2020

Could you clean the build workspace (eg git clean -fdx), rebuild CuPy and try again? I guess Cython failed to detect module that needs to be recompiled for some reason…

Read more comments on GitHub >

github_iconTop Results From Across the Web

c - Stack smashing detected
This answer is incorrect, and provides dangerous advice. First of all, removing stack protector is not the right solution -- if you are...
Read more >
What is the "Stack Smashing Detected" Error? | Scaler Topics
The Stack smashing detected error is caused during the execution of a program when there is a chance for buffer overflow.
Read more >
Smashing the heap by overflowing the stack - Geoffrey Thomas
Part of the answer is to provide a better error message. A straightforward stack overflow is not a memory safety violation in the...
Read more >
CS 61 Lecture 6 Memory Errors I. Stack buffer overflow error ...
Memory Errors. I. Stack buffer overflow error. • Consider the following program, stacksmashf.c, which may be found in the l06 directory:.
Read more >
Stack Smashing | Secure Coding in C and C++: Strings
Stack smashing occurs when a buffer overflow overwrites data in the memory allocated to the execution stack. This can have serious consequences ...
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