Intel® FPGA Software Installation & Licensing
Installation and Licensing that’s includes Intel Quartus® Prime software, ModelSim* - Intel FPGA Edition software, Nios® II Embedded Design Suite on Windows or Linux operating systems.
1143 Discussions

Running Quartus Prime Standard on WSL crashes in libudev.so

bluecmd
Novice
3,877 Views

Hi,

For various reasons I want to run Quartus Prime Standard under Windows Subsystem for Linux. When doing that, I seem get a crash in Quartus:

$ /home/bluecmd/intelFPGA/20.1/quartus/bin/quartus
mremap_chunk(): invalid pointer
zsh: abort (core dumped) /home/bluecmd/intelFPGA/20.1/quartus/bin/quartus

Loading quartus in GDB shows the following stack trace:

#0  0x00007fffde1177bb in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fffde102535 in __GI_abort () at abort.c:79
#2  0x00007fffde159508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fffde26428d "%s\n")
    at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007fffde15fc1a in malloc_printerr (str=str@entry=0x7fffde262587 "realloc(): invalid pointer") at malloc.c:5341
#4  0x00007fffde164e4a in __GI___libc_realloc (oldmem=0x7fffdb3dd278, bytes=11) at malloc.c:3166
#5  0x00007fffd6e15af5 in strextend_with_separator (x=x@entry=0x7ffffffed170, separator=separator@entry=0x0, separator=0x0)
    at ../src/basic/string-util.c:920
#6  0x00007fffd6e19081 in chase_symlinks.constprop.36 (path=<optimized out>, ret=0x7ffffffed268, flags=0, original_root=0x0)
    at ../src/basic/fs-util.c:1009
#7  0x00007fffd6e1ec0c in device_set_syspath
    (device=0x405760, _syspath=_syspath@entry=0x7ffffffed2e0 "/sys/class/net/eth0", verify=verify@entry=true)
    at ../src/libsystemd/sd-device/sd-device.c:148
#8  0x00007fffd6e1f30a in sd_device_new_from_syspath
    (ret=ret@entry=0x7ffffffed380, syspath=syspath@entry=0x7ffffffed2e0 "/sys/class/net/eth0")
    at ../src/libsystemd/sd-device/sd-device.c:223
#9  0x00007fffd6e25572 in enumerator_scan_dir_and_add_devices
    (enumerator=enumerator@entry=0x405690, basedir=basedir@entry=0x7fffd6e2d7f7 "class", subdir1=subdir1@entry=0x7fffd7a40153 "net", subdir2=subdir2@entry=0x0) at ../src/libsystemd/sd-device/device-enumerator.c:471
#10 0x00007fffd6e25945 in enumerator_scan_dir
    (enumerator=enumerator@entry=0x405690, basedir=basedir@entry=0x7fffd6e2d7f7 "class", subdir=subdir@entry=0x0, subsystem=subsystem@entry=0x0) at ../src/libsystemd/sd-device/device-enumerator.c:568
#11 0x00007fffd6e2823c in enumerator_scan_devices_all (enumerator=0x405690) at ../src/libsystemd/sd-device/device-enumerator.c:783
#12 0x00007fffd6e2823c in device_enumerator_scan_devices (enumerator=0x405690) at ../src/libsystemd/sd-device/device-enumerator.c:844
#13 0x00007fffd6e2823c in udev_enumerate_scan_devices (udev_enumerate=<optimized out>, udev_enumerate=<optimized out>)
    at ../src/libudev/libudev-enumerate.c:377
#14 0x00007fffe66b9f45 in  () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#15 0x00007fffe66ba3c9 in Ox77bf42fd0a26f062 () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#16 0x00007fffe6689ce7 in  () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#17 0x00007fffe6689aa6 in Ox77bf42b53a2ca1aa () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#18 0x00007fffe6678faf in  () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#19 0x00007fffe6679892 in lc_getid_type () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#20 0x00007fffe662b800 in cpt_flexlm_get_local_hostid_by_type () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#21 0x00007fffe662b955 in cpt_flexlm_get_local_hostid () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#22 0x00007fffe662bb21 in cpt_flexlm_get_config_hostids () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#23 0x00007fffe662d168 in cpt_flexlm_check_config () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#24 0x00007fffe662d29e in cpt_flexlm_get_config_from_job () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#25 0x00007fffe662d426 in cpt_flexlm_get_config () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#26 0x00007fffe662d733 in cpt_flexlm_get_feature_info () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#27 0x00007fffe660df5b in CPT_FLEXLM_MGR::get_info(std::string const&, std::string const&, CPT_MANAGER::INFO*) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#28 0x00007fffe660edd2 in CPT_FEATURE_MGR::get_info(CPT_FEATURE, CPT_MANAGER::INFO*) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#29 0x00007fffe661008d in CPT_ELEMENT_MGR::get_primary_info(CPT_MANAGER::INFO*) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#30 0x00007fffe6612cd8 in CPT_MANAGER::determine_status() () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#31 0x00007fffe66139d5 in CPT_MANAGER::init(std::string const&) () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#32 0x00007fffe6613ea1 in CPT_MANAGER::get_cpt_mgr() () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#33 0x00007fffff77305b in QGQ_WELCOME_SCREEN_DLG::QGQ_WELCOME_SCREEN_DLG() ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_qgq.so
#34 0x00007fffff7676b1 in QGQ_APP::init_instance(int, char const**, QUI_CMDLINE*) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_qgq.so
#35 0x0000000000401ea2 in qgq_main(int, char const**) ()
#36 0x00007fffe6507e30 in msg_main_thread(void*) () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libccl_msg.so
#37 0x00007fffe5bb5acc in thr_final_wrapper () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libccl_thr.so
#38 0x00007fffe6507eef in msg_thread_wrapper(void* (*)(void*), void*) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libccl_msg.so
#39 0x00007fffe5c29f9c in mem_thread_wrapper(void* (*)(void*), void*) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libccl_mem.so
#40 0x00007fffe5bf8b39 in err_thread_wrapper(void* (*)(void*), void*) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libccl_err.so
#41 0x00007fffe5bb5b0f in thr_thread_wrapper () at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libccl_thr.so
#42 0x00007fffe6509ea1 in msg_exe_main(int, char const**, int (*)(int, char const**)) ()
    at /home/bluecmd/intelFPGA/20.1/quartus/linux64/libccl_msg.so
#43 0x0000000000401f91 in main ()

 Looking at info sharedlibraries shows the system /lib/x86_64-linux-gnu/libudev.so.1 loaded as the last entry.

When debugging this I could not easily reproduce the issue in a test program, and at one point I tried to LD_PRELOAD udev. This works. So currently when starting Quartus I have to do the following:

$ LD_PRELOAD=/lib/x86_64-linux-gnu/libudev.so /home/bluecmd/intelFPGA/20.1/quartus/bin/quartus

Looking at gdb where it crashed before the only difference I see is that udev is now the first entry in the list.

 

I know this issue has plagued me for a few versions now, but I didn't see it mentioned before so I thought I would do this bug report. The only other issue I've found was according to the poster solved by LD_PRELOAD:ing tcmalloc - that did not work for me, so I had to figure this workaround out.

9 Replies
RichardTanSY_Intel
3,865 Views

May I know the exact step to run the Quartus Prime Standard under Windows Subsystem for Linux? I would like to duplicate the error/crash from my side. 

May I confirm the below information that you are using:
OS platform: Window 10
Quartus: Standard version 20.1

0 Kudos
bluecmd
Novice
3,859 Views

Hello,

Definitely. The easiest way to reproduce this is by installing a new Quartus and trying to install the license. Note: it is not only the initial license UI that is broken, starting Quartus with a proper license also results in the crash.

 

C:\Users\blueCmd>ver
Microsoft Windows [Version 10.0.18363.900]
C:\Users\blueCmd>curl.exe -L -o ubuntu-2004.appx https://aka.ms/wslubuntu2004
100  432M  100  432M    0     0   108M      0  0:00:04  0:00:04 --:--:--  108M
C:\Users\blueCmd>ubuntu-2004.appx
# Run through the installation of Ubuntu 20.04. Close the shell when it pops up.

C:\Users\blueCmd>wsl -d Ubuntu-20.04 -e bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

# Make sure you are running a X11 server on Windows to be able to use the GUI. Like VcXsrv or Xming.
bluecmd@stereolith:~$ export DISPLAY="localhost:0.0"
# Install Quartus 20.1 Standard Edition - no device support needed, minimal installation is fine.
bluecmd@stereolith:~$ /mnt/c/Users/blueCmd/Downloads/QuartusSetup-20.1.0.711-linux.run
bluecmd@stereolith:~$ ~/intelFPGA/20.1/quartus/bin/quartus
# Select "If you have a valid license file, specify the location of your license file" and press OK
realloc(): invalid pointer
Aborted (core dumped)

 

The easiest way to get the stacktrace is think is like this:

 

bluecmd@stereolith:~$ sudo apt install gdb
bluecmd@stereolith:~$ gdb
GNU gdb (Ubuntu 9.1-0ubuntu1) 9.1
Copyright (C) 2020 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".
(gdb) set exec-wrapper env 'LD_LIBRARY_PATH=/home/bluecmd/intelFPGA/20.1/quartus/linux64: PATH=/home/bluecmd/intelFPGA/20.1/quartus/adm:/home/bluecmd/intelFPGA/20.1/quartus/linux64:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
(gdb) exec-file /home/bluecmd/intelFPGA/20.1/quartus/linux64/quartus
(gdb) run
Starting program: /home/bluecmd/intelFPGA/20.1/quartus/linux64/quartus
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffd85d0700 (LWP 607)]
realloc(): invalid pointer

Thread 1 "quartus" 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  0x00007fffde0f5859 in __GI_abort () at abort.c:79
#2  0x00007fffde1603ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fffde28a285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007fffde16847c in malloc_printerr (str=str@entry=0x7fffde2885e2 "realloc(): invalid pointer") at malloc.c:5347
#4  0x00007fffde16de8a in __GI___libc_realloc (bytes=11, oldmem=0x7fffd8858f88) at malloc.c:3175
#5  realloc_hook_ini (ptr=0x7fffd8858f88, sz=11, caller=<optimized out>) at hooks.c:41
#6  0x00007fffd5bc7026 in ?? () from /lib/x86_64-linux-gnu/libudev.so.1
#7  0x00007fffd5bce7cd in ?? () from /lib/x86_64-linux-gnu/libudev.so.1
#8  0x00007fffd5bd2bfb in ?? () from /lib/x86_64-linux-gnu/libudev.so.1
#9  0x00007fffd5bd33a4 in ?? () from /lib/x86_64-linux-gnu/libudev.so.1
#10 0x00007fffd5bda810 in ?? () from /lib/x86_64-linux-gnu/libudev.so.1
#11 0x00007fffd5bdabfb in ?? () from /lib/x86_64-linux-gnu/libudev.so.1
#12 0x00007fffd5bdd474 in udev_enumerate_scan_devices () from /lib/x86_64-linux-gnu/libudev.so.1
#13 0x00007fffe6692f45 in ?? () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#14 0x00007fffe66933c9 in Ox77bf42fd0a26f062 () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#15 0x00007fffe6662ce7 in ?? () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#16 0x00007fffe6662aa6 in Ox77bf42b53a2ca1aa () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#17 0x00007fffe6651faf in ?? () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#18 0x00007fffe6652892 in lc_getid_type () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#19 0x00007fffe6604800 in cpt_flexlm_get_local_hostid_by_type () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#20 0x00007fffe6604955 in cpt_flexlm_get_local_hostid () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#21 0x00007fffe65e702e in CPT_FLEXLM_MGR::get_local_hostid(CPT_HOSTID_TYPE, std::vector<std::string, std::allocator<std::string> >*) () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#22 0x00007fffe65eb69a in CPT_MANAGER::get_local_hostid(CPT_HOSTID_TYPE, std::vector<std::string, std::allocator<std::string> >*) () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt.so
#23 0x00007fffd600a201 in CPT_GUIQ_OPTIONS_LICENSE_SETUP::update_machine_controls() () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt_guiq.so
#24 0x00007fffd600e466 in CPT_GUIQ_OPTIONS_LICENSE_SETUP::showEvent(QShowEvent*) () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libsys_cpt_guiq.so
#25 0x00007fffe2ce6558 in QWidget::event(QEvent*) () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libQtGui.so.4
#26 0x00007fffe30fc47b in QFrame::event(QEvent*) () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libQtGui.so.4
#27 0x00007fffe2c8484f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libQtGui.so.4
#28 0x00007fffe2c8aea3 in QApplication::notify(QObject*, QEvent*) () from /home/bluecmd/intelFPGA/20.1/quartus/linux64/libQtGui.so.4

 

You can also install the libudev.so debug symbols from Ubuntu, should be called libudev1-dbgsym, for even more details in the udev library.

To use the workaround I have, you can do this:

 

bluecmd@stereolith:~$ LD_PRELOAD=/lib/x86_64-linux-gnu/libudev.so.1 ~/intelFPGA/20.1/quartus/bin/quartus

 

Now when you click on the Select license file option you should be greeted by the license UI.

0 Kudos
Rickard
Beginner
3,780 Views

I get the exact same problem running Quartus in ChromeOS Crostini (Debian LXC VM). The same solution work around the issue.

0 Kudos
bluecmd
Novice
3,749 Views

Thanks Rickard! Happy the workaround worked for you.

I have some extra data-points to share:

  • Ubuntu 18.04 LTS on WSL seems to work without this workaround, while 19.04 and newer (including the latest 20.04 LTS) needs this workaround.
  • If setting LD_PRELOAD while trying to start ModelSim compilations, they will fail to decrypt (and thus compile) any encrypted device libraries:
# ** Error: ../intelFPGA/20.1/quartus/eda/sim_lib/mentor/stratixv_atoms_ncrypt.v(38): (vlog-2163) Macro `<protected> is undefined.
# ** Error: ../intelFPGA/20.1/quartus/eda/sim_lib/mentor/stratixv_atoms_ncrypt.v(38): (vlog-2163) Macro `<protected> is undefined.
# ** Error: (vlog-13069) ../intelFPGA/20.1/quartus/eda/sim_lib/mentor/stratixv_atoms_ncrypt.v(38): syntax error in protected region.
# 
# ** Error: ../intelFPGA/20.1/quartus/eda/sim_lib/mentor/stratixv_atoms_ncrypt.v(38): (vlog-13205) Syntax error found in the scope following '<protected>'. Is there a missing '::'?
# End time: 23:08:09 on Aug 20,2020, Elapsed time: 0:00:00
# Errors: 5, Warnings: 0

The workaround is to only use LD_PRELOAD for Quartus tools, and not ModelSim. I have no idea why preloading udev would suddenly break the decryption but I can reliably reproduce the issue on a clean Ubuntu 18.04 and 20.04 machine (non-WSL) when setting LD_PRELOAD=/lib/x86_64-linux-gnu/libudev.so.1.

This is of course only relevant if you are using the 64-bit version of ModelSim. As Intel only distributes the 32-bit version to my knowledge that does not apply here.

0 Kudos
RichardTanSY_Intel
3,652 Views

Sorry that case had been idling for quite sometimes.

Could you try to install the latest Quartus version and see if the issue still persists? Please download the Quartus version with the corresponding OS from https://fpgasoftware.intel.com/

Try to follow the steps in Installing Windows Subsystem for Linux* (WSL) on Windows and please use Ubuntu 18.04 as stated in the user guide. 

0 Kudos
bluecmd
Novice
3,647 Views

The latest version for Prime Standard is still 20.1 as far as I can tell. The behavior is the same for Ubuntu 18.04 and 20.04.

I use 20.1 on Ubuntu 18.04 every week and I have to use the preload workaround.

EDIT: I see that I reported 18.04 as working an above post, but that's incorrect. I recall having that conclusion but I cannot remember why I thought that - I can clearly reproduce the issue on 18.04 and indeed I have to use the PRELOAD workaround every time I use Quartus.

0 Kudos
bluecmd
Novice
3,637 Views

In order to be 100% sure I did not mess something up, I made a new Windows user and did a fresh Ubuntu 18.04 LTS install.

I downloaded Ubuntu 18.04:

curl.exe -L -o ubuntu-1804.appx https://aka.ms/wsl-ubuntu-1804

I installed it, and then did this:

$ /mnt/d/Sandbox/QuartusSetup-20.1.0.711-linux.run 
$ sudo apt update
$ sudo apt install wsl dos2unix make libsm6 libxrender1 libfontconfig 
export DISPLAY=":0.0"
# Launch Quartus and click "Specify license file"
$ ~/intelFPGA/20.1/quartus/bin/quartus
realloc(): invalid pointer
Aborted (core dumped)
# Try one more time, same action
$ ~/intelFPGA/20.1/quartus/bin/quartus
quartus: malloc.c:2868: mremap_chunk: Assertion `((size + offset) & (GLRO (dl_pagesize) - 1)) == 0' failed.
Aborted (core dumped)

As you can see, the issue is clearly there even on a fresh Ubuntu 18.04.

0 Kudos
RichardTanSY_Intel
3,621 Views

If I get you correctly, you try to launch Quartus from the Ubuntu 18.04 LTS installed in a Window 10 operating system? Why not you install the Quartus Window version directly? The WSL is for the Nios II EDS in Intel Quartus software.

0 Kudos
bluecmd
Novice
3,617 Views

Hi,

You are correct - WSL (1, not 2) under Win 10 using Ubuntu 18.04 LTS.

The toolchain we use for our projects is fully Linux based - for example the simulators are only available under Linux. Everything works fine in WSL except for Quartus, so if we were to use Quartus Windows + WSL toolchain we'd have to make Quartus specific hacks to detect if we are running in WSL and fork out to the Windows version. That would be 1) complicated, and 2) yet another configuration we'd have to support in the build scripts.

So far the workaround is to ask people to use the export LD_PRELOAD hack when using WSL for now until Intel can fix this.

0 Kudos
Reply