Fixed
Created: Sep 28, 2017
Updated: Dec 3, 2018
Resolved Date: Oct 12, 2017
Previous ID: LIN8-7907
Found In Version: 9.0.0.10
Fix Version: 9.0.0.11
Severity: Standard
Applicable for: Wind River Linux 9
Component/s: Userspace
The spawn family of calls in libexpect seg faults.
This issue is documented here
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588817
And there's a suggested patch fix here
http://pkgs.fedoraproject.org/cgit/rpms/expect.git/commit/?h=master&id=b6737eed550be93182f2ed194e836a6cbbcf4fa3
1) Create a project
$installDir/configure --enable-board=intel-x86-64 --enable-kernel=standard --enable-rootfs=glibc-small --with-package=expect --with-rcpl-version=0021
2) Export the sdk and build this source code, do not forget to use "-lexpect5.45"
#include <stdio.h>
#include <expect.h>
int main()
{
exp_spawnv("ls", NULL);
printf("Hello World\n");
return 0;
}
3) Run the software on the target (I used QEMU), you will get this error
root@qemu2:~# ./a.out
a.out[402]: segfault at 410 ip 00007fd9ffd06fee sp 00007ffd76c5c380 error 4 in libexpect5.45.so[7fd9ffce8000+2c000]
Segmentation fault