Bug 13676

Summary: 5a1: Monitor not being detected properly (monitor-get-edid trap invalid opcode error in libx86.so)
Product: Mageia Reporter: claire robinson <eeeemail>
Component: InstallerAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: anssi.hannula, dantou, eatdirt, ennael1, luigiwalser, thierry.vignaud, tmb
Version: CauldronKeywords: NEEDINFO
Target Milestone: ---   
Hardware: i586   
OS: Linux   
Whiteboard: 5alpha1
Source RPM: CVE:
Status comment:
Attachments: report.bug.xz
GDB trace with symbols

Description claire robinson 2014-07-04 18:19:56 CEST
5alpha1 Classic DVD 64

Monitors are not being detected properly in the installer. The logs on tty4 show
monitor-get-edid trap invalid opcode ... error ...  in libx86.so

I've seen this mentioned on dev ML but couldn't see a bug report. I'll attach a log when it's completed.

Reproducible: 

Steps to Reproduce:
Comment 1 claire robinson 2014-07-04 18:20:51 CEST
Not sure who to assign this one to, sorry if it's wrong.

CC: (none) => anssi.hannula, ennael1
Whiteboard: (none) => 5alpha1

Comment 2 claire robinson 2014-07-04 18:30:16 CEST
Created attachment 5249 [details]
report.bug.xz

There are a number of these..

<6>[   26.720376] traps: monitor-get-edi[371] trap invalid opcode ip:7fabd8ebfb5f sp:7fffc37cd520 error:0 in libx86.so.1[7fabd8eb8000+20000]
Thierry Vignaud 2014-07-04 19:20:37 CEST

CC: (none) => thierry.vignaud
Assignee: thierry.vignaud => guillomovitch

Comment 3 Guillaume Rousse 2014-07-05 10:27:38 CEST
I can reproduce the issue when running /usr/sbin/monitor-get-edid-using-vbe manually, but I have no clue about how to fix it. And as the error seems to happen inside libx86.so, it may as well comes from there.
Thierry Vignaud 2014-07-05 13:28:02 CEST

CC: (none) => tmb

Comment 4 Thierry Vignaud 2014-07-05 13:34:51 CEST
Created attachment 5257 [details]
GDB trace with symbols

A gcc miscompilation?
Code hasn't changed for years...
Comment 5 Thierry Vignaud 2014-07-05 13:50:27 CEST
Fixed in libx86-1.1-15.mga5

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 6 Chris Denice 2015-04-27 15:13:06 CEST
I am just seeing this message on the current boot-nonfree.iso installer while upgrading mga4 to mga5 RC.

CC: (none) => dirteat

Comment 7 David Walser 2015-04-27 18:47:54 CEST
At what stage do you see this error?  This should be fixed in stage2 as of a few weeks ago.
Comment 8 Chris Denice 2015-04-27 18:56:54 CEST
I don't know, but you may have a look to the full report there:

https://bugs.mageia.org/show_bug.cgi?id=15781

For instance, check report_1.bug at time 66.81. If I am not mistaken, this is at stage 1 then (during kernel boot).
Comment 9 Thomas Backlund 2015-04-27 20:32:22 CEST
Yep, it still segfaults on x86_64

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 10 David Walser 2015-04-28 02:28:34 CEST
There was a discussion on the dev list where Chris complained about a date in stage1 that was from February and Pascal said that stage1 hadn't been regenerated since then.  Does it just need to be regenerated with the fixed libx86?
Comment 11 Thierry Vignaud 2015-04-28 06:42:54 CEST
He meat stage1 as just the stage1 binary.
stage1 is rebuild whenever there's a new kernel.
But libx86 is used in stage2 anyway...
Comment 12 David Walser 2015-04-28 17:07:04 CEST
Ahh, OK.  Unfortunately I don't have x86_64 mirrored locally so I can't test it there.  I'm guessing the x86emu backend isn't working there though, so I can try pushing a build with that changed.
Comment 14 Chris Denice 2015-05-09 05:58:39 CEST
For some reasons, I now see that trap error appearing 3 times in the logs when I boot the machine:

May 09 08:47:05 brenva kernel: traps: monitor-get-edi[1026] trap invalid opcode ip:7f74b94c6b5f sp:7ffe6ef27030 error:0 in libx86.so.1[7f74b94bf000+1f000]
May 09 08:47:06 brenva kernel: traps: monitor-get-edi[1027] trap invalid opcode ip:7fa19d73cb5f sp:7ffd8cc1f060 error:0 in libx86.so.1[7fa19d735000+1f000]
May 09 08:47:06 brenva kernel: traps: monitor-get-edi[1028] trap invalid opcode ip:7f4f0cee1b5f sp:7ffffb27dd90 error:0 in libx86.so.1[7f4f0ceda000+1f000]
Comment 15 Rémi Verschelde 2015-05-09 09:18:38 CEST
(In reply to Chris Denice from comment #14)
> For some reasons, I now see that trap error appearing 3 times in the logs
> when I boot the machine:

It might be because of mga-bg-res.service which calls /usr/sbin/monitor-probe.
Comment 16 Chris Denice 2015-05-09 16:21:31 CEST
ah,
that may explain also the rest (also posted on the mailing list), the log of mga-be-res not working:



May 09 08:47:07 brenva mga-bg-res[942]: Unrecognized option: -probeonly
May 09 08:47:07 brenva mga-bg-res[942]: use: X [:<display>] [option]
May 09 08:47:07 brenva mga-bg-res[942]: -a #                   default pointer acceleration (factor)
May 09 08:47:07 brenva mga-bg-res[942]: -ac                    disable access control restrictions
May 09 08:47:07 brenva mga-bg-res[942]: -audit int             set audit trail level

May 09 08:47:07 brenva mga-bg-res[942]: (EE)
May 09 08:47:07 brenva mga-bg-res[942]: Fatal server error:
May 09 08:47:07 brenva mga-bg-res[942]: (EE) Unrecognized option: -probeonly
May 09 08:47:07 brenva mga-bg-res[942]: (EE)
May 09 08:47:07 brenva mga-bg-res[942]: (EE)
May 09 08:47:07 brenva mga-bg-res[942]: Please consult the The X.Org Foundation support
May 09 08:47:07 brenva mga-bg-res[942]: at http://bugs.mageia.org
May 09 08:47:07 brenva mga-bg-res[942]: for help.
May 09 08:47:07 brenva mga-bg-res[942]: (EE)
May 09 08:47:07 brenva mga-bg-res[942]: X probe failed
May 09 08:47:07 brenva mga-bg-res[942]: /usr/libexec/mga-bg-res: line 28: 1000*/: syntax error: operand expected (error token is "/")
May 09 08:47:07 brenva mga-bg-res[942]: Could not find this file: /usr/share/mga/backgrounds/Mageia-Default-.jpg.
May 09 08:47:07 brenva mga-bg-res[942]: Please check that the mageia-theme-Default package is properly installed, or disable the mga-bg-res systemd service if you do not want to force using the Mageia theme.

cheers.
Guillaume Rousse 2015-05-13 23:43:01 CEST

Assignee: guillomovitch => bugsquad

Comment 17 Dan TOU 2015-05-15 12:14:45 CEST
I don't know if it's the same bug or a new.
I'm on :
[    0.000000] Linux version 3.19.8-desktop-1.mga5 (iurt@ecosse.mageia.org) (gcc version 4.9.2 (GCC) ) #1 SMP Mon May 11 16:35:09 UTC 2015
[    0.000000] Command line: BOOT_IMAGE=linux root=UUID=ad21247c-3d73-453e-b9d3-541bd8e6be74 splash quiet noiswmd resume=UUID=f5e4982e-2b05-4d5c-bbd3-63de6110a2ac vga=788
with a radeon 4670 and a Samsung 22' monitor in 16/10°
On Mageia 4.1 and M5rc When I boot, I don't have passage by Bios and Grub. I've black page and open directly a page with (obtain by dmesg) :

[drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 248
[    2.692616] Raw EDID:
[    2.692618]          00 ff ff ff ff ff ff 00 4c 2d e5 03 32 32 57 54
[    2.692620]          26 12 01 03 80 2f 1e 78 2a ee 91 a3 54 4c 99 26
[    2.692622]          0f 50 54 bf ef 80 b3 00 81 80 81 40 71 4f 01 01
[    2.692623]          01 01 01 01 01 01 74 2e 90 a0 60 1a 1e 40 30 20
[    2.692625]          36 00 da 28 11 00 00 1a 00 00 00 fd 00 38 4b 1e
[    2.692626]          51 0e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 53
[    2.692627]          79 6e 63 4d 61 73 74 65 72 0a 20 20 00 00 00 ff
[    2.692629]          00 48 39 58 51 39 32 30 35 32 37 0a 20 20 00 25
[    2.719874] [drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 248
[    2.719876] Raw EDID:
[    2.719877]          00 ff ff ff ff ff ff 00 4c 2d e5 03 32 32 57 54
[    2.719879]          26 12 01 03 80 2f 1e 78 2a ee 91 a3 54 4c 99 26
[    2.719880]          0f 50 54 bf ef 80 b3 00 81 80 81 40 71 4f 01 01
[    2.719882]          01 01 01 01 01 01 74 2e 90 a0 60 1a 1e 40 30 20
[    2.719883]          36 00 da 28 11 00 00 1a 00 00 00 fd 00 38 4b 1e
[    2.719884]          51 0e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 53
[    2.719886]          79 6e 63 4d 61 73 74 65 72 0a 20 20 00 00 00 ff
[    2.719888]          00 48 39 58 51 39 32 30 35 32 37 0a 20 20 00 25
[    2.747141] [drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 248
[    2.747145] Raw EDID:
[    2.747147]          00 ff ff ff ff ff ff 00 4c 2d e5 03 32 32 57 54
[    2.747149]          26 12 01 03 80 2f 1e 78 2a ee 91 a3 54 4c 99 26
[    2.747150]          0f 50 54 bf ef 80 b3 00 81 80 81 40 71 4f 01 01
[    2.747152]          01 01 01 01 01 01 74 2e 90 a0 60 1a 1e 40 30 20
[    2.747154]          36 00 da 28 11 00 00 1a 00 00 00 fd 00 38 4b 1e
[    2.747155]          51 0e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 53
[    2.747157]          79 6e 63 4d 61 73 74 65 72 0a 20 20 00 00 00 ff
[    2.747159]          00 48 39 58 51 39 32 30 35 32 37 0a 20 20 00 25
[    2.774403] [drm:drm_edid_block_valid [drm]] *ERROR* EDID checksum is invalid, remainder is 248
[    2.774405] Raw EDID:
[    2.774407]          00 ff ff ff ff ff ff 00 4c 2d e5 03 32 32 57 54
[    2.774408]          26 12 01 03 80 2f 1e 78 2a ee 91 a3 54 4c 99 26
[    2.774410]          0f 50 54 bf ef 80 b3 00 81 80 81 40 71 4f 01 01
[    2.774412]          01 01 01 01 01 01 74 2e 90 a0 60 1a 1e 40 30 20
[    2.774414]          36 00 da 28 11 00 00 1a 00 00 00 fd 00 38 4b 1e
[    2.774415]          51 0e 00 0a 20 20 20 20 20 20 00 00 00 fc 00 53
[    2.774417]          79 6e 63 4d 61 73 74 65 72 0a 20 20 00 00 00 ff
[    2.774419]          00 48 39 58 51 39 32 30 35 32 37 0a 20 20 00 25
[    2.774422] radeon 0000:01:00.0: DVI-I-1: EDID block 0 invalid.
[    2.774477] [drm:radeon_dvi_detect [radeon]] *ERROR* DVI-I-1: probed a monitor but no|invalid EDID

[drm:radeon_dvi_detect [radeon]] *ERROR* DVI-I-1: probed a monitor but no|invalid EDID
[   38.746591] [drm:radeon_dvi_detect [radeon]] *ERROR* DVI-I-1: probed a monitor but no|invalid EDID
[   42.331722] [drm:radeon_dvi_detect [radeon]] *ERROR* DVI-I-1: probed a monitor but no|invalid EDID
and sustem blocked
I open Mageia by DVD and copy the xorg.conf onto /etc/X11/xorg.conf and so ontain to open Mageia, but allways with darkpage and this EDID ERROR page before obtaining Mageia in 1024*768.
Sometines, I've 1650x1080, but more and more rare.
Is it a new ug or the same, I don't know. Say me what and excuse me to disturb.
Cheers

CC: (none) => dantou

Comment 18 Chris Denice 2015-05-17 00:46:34 CEST
To David (comment 13); I suceeded to compile it on x86_64 but only by adding explicitely
BACKEND=x86emu

I modified the spec accordingly; but I am not sure this is fine. Do you mind to have a look and resubmit if ok?

cheers.
Comment 19 Chris Denice 2015-05-20 01:59:47 CEST
On svn I did one more thing:
Adding BACKEND=x86emu allows compilation under x86_64; but libx86 was still segfaulting on x86_64.

David, in fact the segfault on x86_64 is due to disabling patch2! So I reverted your last change and restored patch2; but it was conflicting with patch4 (fixing a HLT hexadecimal code); so I *tried* to fix patch4 to be compatible with patch2 by doing this:

-       *mmap_addr = 0x4f; /* Make sure that we end up jumping back to a
+       *mmap_addr = 0xf4; /* Make sure that we end up jumping back to a
                              halt instruction */

Of course, I am completely out of my league here, I guess Thierry you should really have a look.

Anyway, on x86_64, that compiles and monitor-get-edid-using-vbe does not segfaut anymore (actually that seems to work).

Before asking for freeze push, please review my changes and try to build it locally and check if monitor-get-edid-using-vbe works (on i586 in particular).

cheers.
Comment 20 Thomas Backlund 2015-05-20 07:37:09 CEST
I guess we need to make it conditional patching for now, so P2 is only added on x86_64 until we can fix it properly.
Comment 21 Chris Denice 2015-05-24 16:55:29 CEST
David, do you confirm, can you test it in its current form on i586?
Comment 22 Samuel Verschelde 2015-06-06 01:59:40 CEST
What's the status for this bug report? Has it been fixed? Is it still valid? Does it require an Errata?

Keywords: (none) => NEEDINFO

Comment 23 Chris Denice 2015-06-06 12:58:15 CEST
On x86_64, it is fixed; I am waiting for someone to test it on i586 as I think it should be too.
Comment 24 claire robinson 2015-06-06 13:01:09 CEST
Why waiting?
Comment 25 Samuel Verschelde 2015-06-06 13:26:59 CEST
I think I remember someone saying it wasn't fixed in i586 because the patch was applied only for x86_64, but I can't say more and might be wrong.
Comment 26 David Walser 2015-06-08 13:08:15 CEST
I hadn't been CC'd on this bug so I hadn't seen the recent discussion, but I tested many combinations before and committed the only one that worked.  If you reverted any of my changes (which it appears that you have), then you have likely broken it again on i586.  I'll test to confirm that later today.  It may need to do something conditional depending on the arch.

CC: (none) => luigiwalser

Comment 27 Chris Denice 2015-06-08 14:05:20 CEST
Yes, please check. For i586, the only thing that has changed is restoring patch 2. If this breaks i586, then, as tmb suggested, an easy fix is to conditionally apply the patch to x86_64 only.

I compiled the current version on core/update_testing; that should be easier to test.
Comment 28 David Walser 2015-06-08 18:53:51 CEST
You have indeed broken it, as I suspected.

Please test libx86_1-1.1-25.mga5.  It conditionally applies patch 2.
Comment 29 Chris Denice 2015-06-09 16:45:27 CEST
Great, thanks! Works for me on x86_64!
Comment 30 David Walser 2015-06-09 16:58:38 CEST
Pushed by tmb yesterday (rebuilt as libx86-1.1-2.mga5).  Marking as FIXED.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 31 David Walser 2015-06-09 16:59:00 CEST
(In reply to David Walser from comment #30)
> Pushed by tmb yesterday (rebuilt as libx86-1.1-26.mga5).  Marking as FIXED.

Missed a key there.  Release tag is 26.