Bug 201165 - devel/libx86: run coredumps with clang but not gcc
Summary: devel/libx86: run coredumps with clang but not gcc
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Jung-uk Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-28 10:53 UTC by jdn06
Modified: 2015-06-30 23:17 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jdn06 2015-06-28 10:53:19 UTC
On FreeBSD 10.1, with the standard clang compiler, 

# /usr/local/sbin/vbetool dpms off

exits on signal 4 (core dumped), instead of powering off the screen.

If I use lang/gcc to compile sysutils/vbetool and its dependencies, everything works well.

My material is an old Sony VAIO Laptop with an Intel Mobile GM965/GL960 video card.

I would like to add there are some more recent releases of vbetool in another site: http://cgit.freedesktop.org/~airlied/vbetool/
Comment 1 Jung-uk Kim freebsd_committer freebsd_triage 2015-06-29 19:29:32 UTC
(In reply to jdn06 from comment #0)
> On FreeBSD 10.1, with the standard clang compiler, 
>
> # /usr/local/sbin/vbetool dpms off
>
> exits on signal 4 (core dumped), instead of powering off the screen.

I'll try my best to reproduce the problem but it is very hard without real hardware sometimes.

> I would like to add there are some more recent releases of vbetool in another site: http://cgit.freedesktop.org/~airlied/vbetool/

It is a fork and I don't think we need this "newer" version because these changes are really Linux-specific.

Actually, you don't want to use vbetool for turning off screen unless you have no choice.  Please try other drivers + hot keys first, e.g., acpi_sony(4), acpi_video(4), etc.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-06-30 17:43:24 UTC
A commit references this bug:

Author: jkim
Date: Tue Jun 30 17:42:23 UTC 2015
New revision: 390976
URL: https://svnweb.freebsd.org/changeset/ports/390976

Log:
  Fix a regression when built with Clang.

  PR:		201165

Changes:
  head/devel/libx86/Makefile
  head/devel/libx86/files/patch-thunk.c
Comment 3 Jung-uk Kim freebsd_committer freebsd_triage 2015-06-30 17:45:25 UTC
A fix
Comment 4 Jung-uk Kim freebsd_committer freebsd_triage 2015-06-30 17:46:48 UTC
The problem was not sysutils/vbetool but it in devel/libx86.  Please update the port and try again.

Thanks!
Comment 5 jdn06 2015-06-30 20:54:18 UTC
Sorry, but the problem is still the same on my computer, after rebuild of the three ports with the new devel/libx86.

Is there a way for me to help you to find the problem?

I don't think I can script a command with acpi and I use this laptop as a server. I want a script that powers off the screen during the boot, even if I am not here; sysutils/vbtool did the job very nicely till then.
Comment 6 Jung-uk Kim freebsd_committer freebsd_triage 2015-06-30 21:22:30 UTC
(In reply to jdn06 from comment #5)
> Sorry, but the problem is still the same on my computer, after rebuild of the
> three ports with the new devel/libx86.

Hmm...  That's not good.

> Is there a way for me to help you to find the problem?

If you have the core file, please do "gdb -c vbetool.core /usr/local/bin/vbetool" and show me the output.

> I don't think I can script a command with acpi and I use this laptop as a
> server. I want a script that powers off the screen during the boot, even if I
> am not here; sysutils/vbtool did the job very nicely till then.

There is absolutely no need to "script" ACPI.  You just have to add a right line in /etc/sysctl.conf.  For example, "dev.acpi_sony.0.brightness_default=0" for acpi_sony(4).  You just have to load the right driver and find right incantation from the manual page. ;-)
Comment 7 Jung-uk Kim freebsd_committer freebsd_triage 2015-06-30 21:24:08 UTC
(In reply to Jung-uk Kim from comment #6)
I meant "gdb -c vbetool.core /usr/local/sbin/vbetool".  Sorry for the typo.
Comment 8 jdn06 2015-06-30 22:39:22 UTC
OK. Here is the result:

# gdb -c vbetool.core /usr/local/sbin/vbetool
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Core was generated by `vbetool'.
Program terminated with signal 4, Illegal instruction.
Reading symbols from /lib/libz.so.6...done.
Loaded symbols for /lib/libz.so.6
Reading symbols from /usr/local/lib/libx86.so.1...done.
Loaded symbols for /usr/local/lib/libx86.so.1
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x0000000800a429e6 in LRMI_init () from /usr/local/lib/libx86.so.1
Comment 9 Jung-uk Kim freebsd_committer freebsd_triage 2015-06-30 22:44:40 UTC
(In reply to jdn06 from comment #8)
Are you sure you have libx86-1.1_2?  I think that's what I just fixed.
Comment 10 jdn06 2015-06-30 23:17:48 UTC
(In reply to Jung-uk Kim from comment #9)
You are right, I am sorry. I don't know how it happened; it was still the old version, and now with the new one, sysutils/vbetool works again.
Thank you very much!