Intel® Distribution for Python*
Support and discussions for achieving faster Python* applications and core computational packages.
391 Discussions

Weird error when Intel python3.7 shell is launched : impossible to do any command - abort error

chris6
Beginner
709 Views

I get the following error when I do a simple command `a=1` (or any other command) once an Intel python3 shell is launched on a Debian 10 :

Python 3.7.11 (default, Sep 9 2021, 02:06:38)
[GCC 9.3.0] :: Intel Corporation on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
(.startup.py)
(imported numpy as np)
(imported matplotlib.pyplot as plt)
(imported scipy.interpolate CubicSpline)
(imported scipy.interpolate interp1d)
(imported os)
(imported sys)
(imported glob)
(imported re)
>>> a=1
free(): invalid pointer
zsh: abort /opt/intel/oneapi/intelpython/python3.7/bin/python3.7

what is happening ?

Permissions seem to be ok :

-rwxrwxr-x 1 19712 20M Sep 9 04:16 /opt/intel/oneapi/intelpython/python3.7/bin/python3.7

I don't understand.

**EDIT :** a gdb on python3 allows to get more informations :

gdb python3
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...done.
(gdb) file python3
Load new symbol table from "python3"? (y or n) y
Reading symbols from python3...done.
(gdb) r
Starting program: /opt/intel/oneapi/intelpython/python3.7/bin/python3
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Python 3.7.11 (default, Sep 9 2021, 02:06:38)
[GCC 9.3.0] :: Intel Corporation on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
(.startup.py)
(imported numpy as np)
(imported matplotlib.pyplot as plt)
(imported scipy.interpolate CubicSpline)
(imported scipy.interpolate interp1d)
(imported os)
(imported sys)
(imported glob)
(imported re)
>>> a=1
free(): invalid pointer

Program 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.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff7c56535 in __GI_abort () at abort.c:79
#2 0x00007ffff7cad508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7db828d "%s\n")
at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff7cb3c1a in malloc_printerr (str=str@entry=0x7ffff7db643b "free(): invalid pointer")
at malloc.c:5341
#4 0x00007ffff7cb542c in _int_free (av=<optimized out>, p=<optimized out>, have_lock=<optimized out>)
at malloc.c:4165
#5 0x00005555555f7abd in PyOS_Readline (sys_stdin=<optimized out>,
sys_stdout=0x7ffff7df0760 <_IO_2_1_stdout_>, prompt=0x7ffff7656f20 ">>> ")
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Parser/myreadline.c:377
#6 0x0000555555704c02 in tok_nextc (tok=0x55555633ca00)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Parser/tokenizer.c:939
#7 0x000055555572c017 in tok_get (p_end=<optimized out>, p_start=<optimized out>, tok=<optimized out>)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Parser/tokenizer.c:1373
#8 PyTokenizer_Get (p_end=<optimized out>, p_start=<optimized out>, tok=<optimized out>)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Parser/tokenizer.c:1835
#9 parsetok (tok=<optimized out>, g=<optimized out>, start=<optimized out>, err_ret=<optimized out>,
flags=<optimized out>) at /home/sat_bot/base/conda-bld/python_1631149597897/work/Parser/parsetok.c:208
#10 0x00005555557cd310 in PyParser_ASTFromFileObject (fp=<optimized out>, filename=0x7ffff7778530,
enc=<optimized out>, start=<optimized out>, ps1=<optimized out>, ps2=<optimized out>,
flags=0x7fffffffd860, errcode=0x7fffffffd784, arena=0x7ffff783e390)
--Type <RET> for more, q to quit, c to continue without paging--
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Python/pythonrun.c:1222
#11 0x0000555555640ee6 in PyRun_InteractiveOneObjectEx (fp=0x7ffff7defa00 <_IO_2_1_stdin_>,
filename=0x7ffff7778530, flags=0x7fffffffd860)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Python/pythonrun.c:236
#12 0x00005555556411cc in PyRun_InteractiveLoopFlags (fp=0x7ffff7defa00 <_IO_2_1_stdin_>,
filename_str=<optimized out>, flags=0x7fffffffd860)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Python/pythonrun.c:120
#13 0x00005555557cd85e in PyRun_AnyFileExFlags (fp=0x7ffff7defa00 <_IO_2_1_stdin_>,
filename=0x5555557ce4b8 "<stdin>", closeit=0, flags=0x7fffffffd860)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Python/pythonrun.c:78
#14 0x00005555557cdbdc in pymain_run_file (p_cf=0x7fffffffd860, filename=<optimized out>,
fp=0x7ffff7defa00 <_IO_2_1_stdin_>)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Modules/main.c:462
#15 pymain_run_filename (cf=0x7fffffffd860, pymain=0x7fffffffd970)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Modules/main.c:1655
#16 pymain_run_python (pymain=0x7fffffffd970)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Modules/main.c:2916
#17 pymain_main (pymain=0x7fffffffd970)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Modules/main.c:3456
#18 0x00005555557cdd2c in _Py_UnixMain (argc=<optimized out>, argv=<optimized out>)
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Modules/main.c:3491
#19 0x00007ffff7c5809b in __libc_start_main (main=0x555555641820 <main>, argc=1, argv=0x7fffffffdac8,
--Type <RET> for more, q to quit, c to continue without paging--
init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdab8)
at ../csu/libc-start.c:308
#20 0x0000555555733be9 in _start ()
at /home/sat_bot/base/conda-bld/python_1631149597897/work/Parser/parser.c:325
(gdb)

Any useful idea among all these informations ?

0 Kudos
4 Replies
chris6
Beginner
673 Views

EDIT :

If I launch the shell as root, there isn't this issue :

# python3.7
Python 3.7.11 (default, Sep  9 2021, 02:06:38)
[GCC 9.3.0] :: Intel Corporation on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
(.startup.py)
(imported numpy as np)
(imported matplotlib.pyplot as plt)
(imported scipy.interpolate CubicSpline)
(imported scipy.interpolate interp1d)
(imported os)
(imported sys)
Traceback (most recent call last):
  File "/root/.startup.py", line 16, in <module>
    import readline
ImportError: /opt/intel/oneapi/intelpython/python3.7/lib/python3.7/site-packages/readline.cpython-37m-x86_64-linux-gnu.so: undefined symbol: tputs
>>> a=1
>>> a=np.arange(10)
>>> a
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>>

So it would be a problem of installation, wouldn't it ?

AlekhyaV_Intel
Moderator
614 Views

Hi,


Thank you for posting in Intel Communities. We could find that Debian 10 is not mentioned in the release notes. We've provided the release notes for your reference: https://software.intel.com/content/dam/develop/external/us/en/documents/2021_Python_Release_Notes_In... You can find all the supported operating systems under "System requirements" topic.

Also we'd want you to share the output of the "env" command. The env command displays the details of your current environment. Please try this command as both root user and normal user as well and share the outputs with us.


Regards,

Alekhya


AlekhyaV_Intel
Moderator
549 Views

Hi,


Could you please give us an update regarding this issue?


Regards,

Alekhya


AlekhyaV_Intel
Moderator
527 Views

Hi,

 

We were unable to reproduce your issue. We tried to launch a python3 shell in Debian 10 and it worked fine.

When you source setvars for oneAPI(or intel python) the intel python executable gets added to the system path of current user.

The path variable would be an environment variable specific to your current user. Thus when you execute a command with sudo the environment variables are not considered this is why you are executing 2 different python executables with and without sudo.

You could verify this with the below commands

 

 

sudo which python
which python

 

 

If you need to use the same python executable as sudo and normal user, Run the below command to launch the shell to have the same binary as that of your normal user. (-E preserves environment variables)

 

 

sudo -E python

 

 

The error in your query would be due to having user packages in your pip environment which might be incompatible with each other. Could you create a new environment with intel python, we would suggest using conda if you have anaconda installed and check if you still get the error. Please let us know if you are still facing issues. PFB a link which guides on installation process.

https://software.intel.com/content/www/us/en/develop/articles/using-intel-distribution-for-python-wi...

 

If this resolves your issue, please accept it as a solution so that it helps the others with similar issue. And as you've requested to close this thread, we're closing this thread. If you need any further assistance, please post a new question as this thread will no longer be monitored by Intel.

 

Regards,

Alekhya

 

Reply