Bug 228790 - Passing arguments to 32-bit Linuxulator broken on amd64
Summary: Passing arguments to 32-bit Linuxulator broken on amd64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: Jung-uk Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-06 19:50 UTC by Graham Perrin
Modified: 2018-06-13 01:23 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (emulation)


Attachments
test.c compiled on CentOS 6 (stripped) (2.95 KB, application/octet-stream)
2018-06-12 20:21 UTC, Jung-uk Kim
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin freebsd_committer freebsd_triage 2018-06-06 19:50:23 UTC
# date ; uname -v ; whoami
Wed  6 Jun 2018 20:46:27 BST
FreeBSD 12.0-CURRENT #3 r334382: Thu May 31 01:37:12 BST 2018     root@momh167-gjp4-hpelitebook8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC 
root
# pkg info nspluginwrapper | grep Version
Version        : 1.4.4_7
# pkg info flashplayer | grep Version
Version        : 29.0
# nspluginwrapper -l
# nspluginwrapper -v -a -i
Auto-install plugins from /usr/local/lib/browser_plugins
Looking for plugins in /usr/local/lib/browser_plugins
Auto-install plugins from /usr/local/lib/browser_plugins/linux-flashplayer
Looking for plugins in /usr/local/lib/browser_plugins/linux-flashplayer
*** NSPlugin Viewer  *** ERROR: missing connection path argument
*** NSPlugin Viewer  *** ERROR: missing connection path argument
Auto-install plugins from /root/.mozilla/plugins
Looking for plugins in /root/.mozilla/plugins
# 
# pkg info waterfox | grep Version
Version        : 56.2.0.31_2
# pkg info palemoon | grep Version
Version        : 27.9.2_1
# 

If additional information is required, please let me know. 

Thanks
Comment 1 Jung-uk Kim freebsd_committer freebsd_triage 2018-06-08 00:05:51 UTC
It seems 32-bit Linuxualtor is broken on head somehow.

% cat test.c
#include <stdio.h>

int
main(int argc, char **argv)
{
	int i;

	for (i = 0; i < argc; i++)
		printf("%s\n", argv[i]);
	return (0);
}

When it is compiled on CentOS 6 with "cc -m32 test.c" and copied to FreeBSD head:

% file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=a84394f2d5353b0997b10b7bcbc45c5a6c3763ed, not stripped
% ./a.out

% ./a.out 1 2 3




Note 64-bit Linuxulator is working as expected.

% file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=26253988b4124298f815efa90e820f895ae3e295, not stripped
% ./a.out
./a.out
% ./a.out 1 2 3
./a.out
1
2
3
Comment 2 Jung-uk Kim freebsd_committer freebsd_triage 2018-06-12 20:21:24 UTC
Created attachment 194206 [details]
test.c compiled on CentOS 6 (stripped)
Comment 3 Jung-uk Kim freebsd_committer freebsd_triage 2018-06-12 20:25:22 UTC
I think I found the culprit.  Reverting r334165 (and subsequent commits, r334342 and r334348) fixed the problem for me.

https://svnweb.freebsd.org/changeset/base/334165
https://svnweb.freebsd.org/changeset/base/334342
https://svnweb.freebsd.org/changeset/base/334348
Comment 4 Jung-uk Kim freebsd_committer freebsd_triage 2018-06-12 22:51:23 UTC
I have a fix.
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-06-12 22:55:27 UTC
A commit references this bug:

Author: jkim
Date: Tue Jun 12 22:54:48 UTC 2018
New revision: 335020
URL: https://svnweb.freebsd.org/changeset/base/335020

Log:
  Fix number of auxargs entries to copy out for 32-bit Linuxulator.

  PR:		228790

Changes:
  head/sys/amd64/linux32/linux32_sysvec.c
Comment 6 Jung-uk Kim freebsd_committer freebsd_triage 2018-06-12 22:56:18 UTC
This problem should be fixed with r335020.
Comment 7 Graham Perrin freebsd_committer freebsd_triage 2018-06-13 01:23:05 UTC
Thank you! 

Building 335024 now.