In a continuation of a project introduced in another thread ...
... testing out a Lightworks (LWKS) for Linux installation under the FreeBSD linuxulator, in a FreeBSD 12.3-STABLE build, I noticed the following in the output from the
I'm noticing this section in particular, such that appears to be written to some kind of a log file by ntcardvt and is visible under ktrace/kdump for the ntcardvt binary:
Peculiar, isn't it? The machine has 16 GB RAM and a whole 32GB of swap space.
When I run this ntcardvt command under
I believe the "LOH unaligned" message is from Lightworks' LwOS library.
An excerpt of the kdump output, up to the point of the segfault:
This is with the Linux support enabled in a FreeBSD 12.3-STABLE build from the stable/12 branch, uname:
This ntcardvt command is installed from a Debian package in a filesystem created originally with the debootstrap port, then modified with brandelf. I've been able to install and run aptitude and mate-terminal under linuxulator wth this filesystem.
I'd like to test this binary from Lightworks for Linux with valgrind, to see if that may help to debug the issue of the segfault. However I'm seeing the following when trying to run valgrind with this code:
So, I believe valgrind is not able to run the ntcardvt command, perhaps due to something about its linkage to a Linux ld.so, in its Linux object file format?
Is there a way to run valgrind with this Linux object code? and what to do debug this memory issue? Candidly, I'm not a lot of adept with C and C++ toolchains.
I can try to install this Lightworks Debian package in a debootstrapped ubuntu release. I wonder if the bug is in the Linux release code though? This Lightworks Debian package runs just well under Debian 10 in a bare-metal install.
I'd be happy to provide more debug info about this configuration, it's not a lot of succinct text though.
Ideally, this Lightworks build would "Just work" lol once installed to some Linux filesystem and run under FreeBSD, but with the message "Virtual Address Range : 16777216.0 TB" it looks like it'll need some debugging
Help porting for Lightworks under linux-c7 - Multimedia Production on FreeBSD?
While studying under a Bachelors Degree program in communication at a US university, with a specialization in multimedia topics, I've had an opportunity to gain some initial experience with software tools for multimedia production. In developing the multimedia content for some course projects...
forums.freebsd.org
... testing out a Lightworks (LWKS) for Linux installation under the FreeBSD linuxulator, in a FreeBSD 12.3-STABLE build, I noticed the following in the output from the
ntcardvt
binary from the Lightworks installation. This is when run under the FreeBSD linuxulator, a section of the kdump output of an earlier ktrace call:
Code:
40672 ntcardvt PSIG SIGSEGV caught handler=0x808ce4ab0 mask=0x0 code=SEGV_MAPERR
40672 ntcardvt CALL linux_sys_futex(0x8055caf68,0x81,0x7fffffff,0,0,0x8028b51a8)
40672 ntcardvt RET linux_sys_futex 0
40672 ntcardvt CALL linux_sys_futex(0x8028cd1e0,0x81,0x7fffffff,0,0xca,0x1)
40672 ntcardvt RET linux_sys_futex 0
40672 ntcardvt CALL linux_sys_futex(0x8055c9f60,0x81,0x7fffffff,0,0x802ffa360,0x1)
40672 ntcardvt RET linux_sys_futex 0
40672 ntcardvt CALL write(0x1,0x189b980,0x761)
40672 ntcardvt GIO fd 1 wrote 1889 bytes
"Lightworks 64-bit (Release, build Lw : 132926 Common : 132108 Dependencies : 132677 dated Feb 9 2022)
OS Version : Linux version 3.2.0 (des@freebsd.org) (gcc version Clang 11.0.1) #4 Sun Dec 18 04:30:00 CET 1977
Available memory : 11.4 GB
Total memory : 15.8 GB
Virtual Address Range : 16777216.0 TB
Number of CPUs : 4
User has admin rights : No
Graphics driver : Intel Open Source Technology Center
OpenGL version : 3.0 Mesa 20.3.5
19:55:22.326: Setting project base directory /usr/home/gimbal/Lightworks/Projects/
19:55:22.327: Starting window manager
19:55:22.328: FreeImage version: 3.18.0
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
19:55:22.479: License initialisation error <License initialisation error>
19:55:22.485: Checking library versions..
ASSERTION : Lightworks, No .fx files found in /usr/share/lightworks/Shaders/Shaders
19:55:22.490: Preferred device System Sound is not available, loading software only mode instead.
19:55:22.490: WARNING!! There are no audio resources present
---------------- Segmentation fault :( ----------------
LwOS::exceptionHandler(int)
linux_vdso.so.1() [0x7ffffffff514]
/opt/linux/debian-11/usr/lib/lightworks/ntcardvt(+0xc2550) [0x10e3550]
/opt/linux/debian-11/usr/lib/lightworks/ntcardvt(+0xc63cd) [0x10e73cd]
BackgroundTaskBase::execute()
BackgroundTaskQueueBase::despatch(Lw::Ptr<iBackgroundTask, Lw::DtorTraits, Lw::InternalRefCountTraits>&)
DecouplingQueue<iBackgroundTask>::decoupledThread(void*)
Thread::protectedExecute(iThread::eExecRC (*)(void*), void*, void (*)(iThread::Exception const&))
Thread::execute(void*)
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8ea7) [0x802fe5ea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x805505def]
--------------------------------------
I'm noticing this section in particular, such that appears to be written to some kind of a log file by ntcardvt and is visible under ktrace/kdump for the ntcardvt binary:
Code:
Virtual Address Range : 16777216.0 TB
Peculiar, isn't it? The machine has 16 GB RAM and a whole 32GB of swap space.
When I run this ntcardvt command under
limits -v 10G
the error is slightly different:
Code:
$ limits -v 10G env -u LC_ALL ktrace -dif /tmp/ntcardvt.out /opt/linux/debian-11/usr/lib/lightworks/ntcardvt
LOH unaligned
---------------- Segmentation fault :( ----------------
LwOS::exceptionHandler(int)
linux_vdso.so.1() [0x7ffffffff514]
Lw::MTHeap::alloc(unsigned long)
TextFile::load(LightweightString<wchar_t>, char, bool)
TextFile::TextFile(LightweightString<wchar_t> const&, bool)
Lw::Localisation::StringTable::load(LightweightString<wchar_t> const&)
Lw::Localisation::getStringTableInternal()
resourceStrW(ResId)
/opt/linux/debian-11/usr/lib/lightworks/libedit.so(+0x10ece5) [0x805f0ece5]
/lib64/ld-linux-x86-64.so.2(+0xffe2) [0x8013c7fe2]
/lib64/ld-linux-x86-64.so.2(+0x100e9) [0x8013c80e9]
/lib64/ld-linux-x86-64.so.2(+0x10ca) [0x8013b90ca]
---------------------------------------
Abort trap (core dumped)
I believe the "LOH unaligned" message is from Lightworks' LwOS library.
An excerpt of the kdump output, up to the point of the segfault:
Code:
70304 ntcardvt CALL linux_openat(0xffffff9c,0x818860508,0,0)
70304 ntcardvt NAMI "/opt/linux/debian-11/usr/share/lightworks/strings.txt"
70304 ntcardvt NAMI "/opt/linux/debian-11"
70304 ntcardvt NAMI "/opt/linux/debian-11/usr/share/lightworks/strings.txt"
70304 ntcardvt RET linux_openat 3
70304 ntcardvt CALL linux_newfstat(0x3,0x7fffffffcd70)
70304 ntcardvt STRU struct stat {dev=17641383549324237605, ino=37115, mode=0100644, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1645068380, mtime=16444287
17, ctime=1645068391.590767000, birthtime=1644428717, size=181949, blksize=131072, blocks=209, flags=0x800 }
70304 ntcardvt RET linux_newfstat 0
70304 ntcardvt CALL linux_mmap2(0,0x10000000000,0,0x22,0xffffffff,0)
70304 ntcardvt RET linux_mmap2 -1 errno -12 Cannot allocate memory
70304 ntcardvt CALL linux_mprotect(0xfffffffffffff000,0x2d6ef,0x3)
70304 ntcardvt RET linux_mprotect -1 errno -22 Invalid argument
70304 ntcardvt CALL linux_newfstat(0x1,0x7fffffffc600)
70304 ntcardvt STRU struct stat {dev=1895890688, ino=779, mode=020620, nlink=1, uid=1000, gid=4, rdev=779, atime=1645468138, mtime=1645468138, ctime=1645468138, birth
time=-1, size=0, blksize=4096, blocks=0, flags=0x0 }
70304 ntcardvt RET linux_newfstat 0
70304 ntcardvt CALL write(0x1,0x149e740,0xe)
70304 ntcardvt GIO fd 1 wrote 14 bytes
"LOH unaligned
"
70304 ntcardvt RET write 14/0xe
70304 ntcardvt PSIG SIGSEGV caught handler=0x808ce4ab0 mask=0x0 code=SEGV_MAPERR
This is with the Linux support enabled in a FreeBSD 12.3-STABLE build from the stable/12 branch, uname:
Code:
FreeBSD riparian.cloud.thinkum.space 12.3-STABLE FreeBSD 12.3-STABLE stable/12-n1855-ce99de0241e RIPARIAN amd64
This ntcardvt command is installed from a Debian package in a filesystem created originally with the debootstrap port, then modified with brandelf. I've been able to install and run aptitude and mate-terminal under linuxulator wth this filesystem.
I'd like to test this binary from Lightworks for Linux with valgrind, to see if that may help to debug the issue of the segfault. However I'm seeing the following when trying to run valgrind with this code:
Code:
$ valgrind /opt/linux/debian-11/usr/lib/lightworks/ntcardvt
valgrind: m_ume.c: can't open interpreter
So, I believe valgrind is not able to run the ntcardvt command, perhaps due to something about its linkage to a Linux ld.so, in its Linux object file format?
Is there a way to run valgrind with this Linux object code? and what to do debug this memory issue? Candidly, I'm not a lot of adept with C and C++ toolchains.
I can try to install this Lightworks Debian package in a debootstrapped ubuntu release. I wonder if the bug is in the Linux release code though? This Lightworks Debian package runs just well under Debian 10 in a bare-metal install.
I'd be happy to provide more debug info about this configuration, it's not a lot of succinct text though.
Ideally, this Lightworks build would "Just work" lol once installed to some Linux filesystem and run under FreeBSD, but with the message "Virtual Address Range : 16777216.0 TB" it looks like it'll need some debugging