Bug 1189 - fglrx module for linux 4.2 compiles, but breaks on init.
Summary: fglrx module for linux 4.2 compiles, but breaks on init.
Status: CLOSED FIXED
Alias: None
Product: AMD Catalyst™Proprietary Display Driver
Classification: Unclassified
Component: Kernel Module (show other bugs)
Version: .archived
Hardware: All Linux
: low normal
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2015-08-21 14:06 CDT by Vi0L0
Modified: 2016-11-09 16:18 CST (History)
6 users (show)



Attachments
atigetsysteminfo.sh's fruit, compressed (57.48 KB, application/gzip)
2015-08-21 14:18 CDT, Vi0L0
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vi0L0 2015-08-21 14:06:34 CDT
Linux 4.2 will be released in about a week, now we have rc7 and so 4.2 shouldn't change much from this time.
Catalyst doesn't officially support 4.2 kernel, nor 4.1 nor even 4.0.
Till 4.2 kernel I didn't experience any problems with writing some simple patches or borrowing patches from the great linux community.
Till 4.2 - and that's why I decided to wrote this bug report, maybe someone would be able to help me. I know no better place for this.

I decided to pick only ubuntu's patches for newer kernels support. Ubuntu's patch for Linux 4.2 looks good but it's missing the fact that in 4.2 fpu->has_fpu was renamed to fpu->fpregs_active, so I added simple patch to correct it called 4.2-fglrx-has_fpu.patch (funny thing is that only i386/i686 fglrx compilation fails without this patch).
I also added fglrx_gpl_symbol.patch that's changing license to "GPL\0Proprietary ..." because otherwise I'm unable to compile patch without optimizations (-O0, for debugging purposes, btw -O0 works only with additional -ftree-ter flag).

And so I created a package for Arch Linux called catalyst-hook, source here: http://catalyst.wirephire.com/pkgs/catalyst-hook-15.7-6.src.tar.gz
It's able to build modules for any kernel on Arch system and rebuild it when system is rebooting/shutting down.
It's not complete catalyst driver package, but it will show you what patches I used and how I built module.
For debugging purposes here I used additional module flags CFLAGS_MODULE="-O0 -ftree-ter -g", you can find them in catalyst_build_module script, line 37.

Package was tested against vanilla Linux kernels up to 4.2 rc7. It works like a charm on kernels 3.14-LTS, 4.0 and 4.1.

----------
fglrx module compiles fine for Linux 4.2 and fails completelly at init, when loading fglrx module, far before X start.
----------


When using standard -O2 or -O1 optimizations log is saying:
------------ >8 -O1 >8 -----------------
sie 21 18:28:18 xaos kernel: <6>[fglrx] Maximum main memory to use for locked dma buffers: 15626 MBytes.
sie 21 18:28:18 xaos kernel: <6>[fglrx]   vendor: 1002 device: 67b0 revision: 0 count: 1
sie 21 18:28:18 xaos kernel: <6>[fglrx] ioport: bar 4, base 0xe000, size: 0x100
sie 21 18:28:18 xaos systemd[1]: Started udev Coldplug all Devices.
sie 21 18:28:18 xaos kernel: general protection fault: 0000 [#1] PREEMPT SMP 
sie 21 18:28:18 xaos kernel: Modules linked in: fglrx(O+) button amd_iommu_v2 ip_tables x_tables hid_generic usbhid hid sd_mod atkbd libps2 ahci libahci libata xhci_pci xhci_hcd ehci_pci ehci_hcd scsi_mod usbcore usb_common i8042 serio crc32c_generic crc32c_intel btrfs xor raid6_pq
sie 21 18:28:18 xaos kernel: CPU: 0 PID: 233 Comm: systemd-modules Tainted: G           O    4.2.0-rc7-mainline #1
sie 21 18:28:18 xaos kernel: Hardware name: MSI MS-7751/Z77A-GD65 (MS-7751), BIOS V10.11 10/09/2013
sie 21 18:28:18 xaos kernel: task: ffff88007fee0000 ti: ffff88007fecc000 task.ti: ffff88007fecc000
sie 21 18:28:18 xaos kernel: RIP: 0010:[<ffffffffa031ff91>]  [<ffffffffa031ff91>] firegl_trace+0x61/0x1e0 [fglrx]
sie 21 18:28:18 xaos kernel: RSP: 0018:ffff88007fecfa68  EFLAGS: 00010282
sie 21 18:28:18 xaos kernel: RAX: 0000000000000001 RBX: ffff88007fecfb47 RCX: 00000000000012c8
sie 21 18:28:18 xaos kernel: RDX: ffffffffa051c450 RSI: ffffffffa031ff91 RDI: 0000000000000004
sie 21 18:28:18 xaos kernel: RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffa05851c0
sie 21 18:28:18 xaos kernel: R10: ffffffffa032af30 R11: ffffffffa032aef0 R12: 000000000000000d
sie 21 18:28:18 xaos kernel: R13: 0000000000000000 R14: 0000000000000000 R15: ffffffffa05851c0
sie 21 18:28:18 xaos kernel: FS:  00007fc04cefb740(0000) GS:ffff88041ec00000(0000) knlGS:0000000000000000
sie 21 18:28:18 xaos kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
sie 21 18:28:18 xaos kernel: CR2: 00007f5bbfddf000 CR3: 0000000409011000 CR4: 00000000001406f0
sie 21 18:28:18 xaos kernel: Stack:
sie 21 18:28:18 xaos kernel:  000012c80bc3f098 ffffffffa051c450 ffff88007fecfab8 0000000000000096
sie 21 18:28:18 xaos kernel:  ffff88007fecfac8 ffffffff8144c64c ffff88007fecfb3e ffff88040c2fd800
sie 21 18:28:18 xaos kernel:  ffff88007fecfb4e 0000000000000296 0000000000000000 ffffffff811b3d5e
sie 21 18:28:18 xaos kernel: Call Trace:
sie 21 18:28:18 xaos kernel:  [<ffffffff8144c64c>] ? pci_conf1_read+0xbc/0x100
sie 21 18:28:18 xaos kernel:  [<ffffffff811b3d5e>] ? __kmalloc+0x2e/0x270
sie 21 18:28:18 xaos kernel:  [<ffffffffa02e58c8>] ? KCL_MEM_SmallBufferAlloc+0x13/0x15 [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffffa02ebeba>] ? KCL_STR_Memcpy+0xe/0x10 [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffff8155d078>] ? klist_next+0xb8/0x110
sie 21 18:28:18 xaos kernel:  [<ffffffffa032aef0>] ? asyncioSvcInitContext+0x30/0x30 [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffff812fb5b0>] ? pci_do_find_bus+0x60/0x60
sie 21 18:28:18 xaos kernel:  [<ffffffffa02e7aed>] ? KAS_Initialize+0x122/0x1dc [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffffa02f79c2>] ? firegl_init+0xe2/0xf0 [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffffa030a180>] ? firegl_find_interrupt_by_sourceid+0x50/0x50 [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffffa030a1a0>] ? IRQMGR_CallbackWrapper+0x20/0x20 [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffffa0f932b2>] ? firegl_init_module+0x2b2/0x1000 [fglrx]
sie 21 18:28:18 xaos kernel:  [<ffffffffa0f93000>] ? 0xffffffffa0f93000
sie 21 18:28:18 xaos kernel:  [<ffffffff81002123>] ? do_one_initcall+0xb3/0x200
sie 21 18:28:18 xaos kernel:  [<ffffffff81198985>] ? __vunmap+0x95/0xf0
sie 21 18:28:18 xaos kernel:  [<ffffffff811b505f>] ? kfree+0x14f/0x160
sie 21 18:28:18 xaos kernel:  [<ffffffff8156772c>] ? do_init_module+0x60/0x1e7
sie 21 18:28:18 xaos kernel:  [<ffffffff810f9a06>] ? load_module+0x2206/0x2850
sie 21 18:28:18 xaos kernel:  [<ffffffff810f67a0>] ? symbol_put_addr+0x40/0x40
sie 21 18:28:18 xaos kernel:  [<ffffffff810fa2a9>] ? SyS_finit_module+0xb9/0xf0
sie 21 18:28:18 xaos kernel:  [<ffffffff8156d92e>] ? entry_SYSCALL_64_fastpath+0x12/0x71
sie 21 18:28:18 xaos kernel: Code: df 00 00 00 48 89 54 24 08 89 4c 24 04 ff e6 0f 29 7b f1 0f 29 73 e1 0f 29 6b d1 0f 29 63 c1 0f 29 5b b1 0f 29 53 a1 0f 29 4b 91 <0f> 29 43 81 e8 e3 98 fc ff 48 89 c7 e8 5e ae fd ff 44 89 e1 c1 
sie 21 18:28:18 xaos kernel: RIP  [<ffffffffa031ff91>] firegl_trace+0x61/0x1e0 [fglrx]
sie 21 18:28:18 xaos kernel:  RSP <ffff88007fecfa68>
sie 21 18:28:18 xaos kernel: ---[ end trace e3a5079582fcbb2a ]---
sie 21 18:28:18 xaos systemd[1]: systemd-modules-load.service: Main process exited, code=killed, status=11/SEGV
sie 21 18:28:18 xaos systemd[1]: Failed to start Load Kernel Modules.
------------ >8 -O1 >8 -----------------
so possibly here we should find what happened: firegl_trace+0x61
- because:
RIP  [<ffffffffa031ff91>] firegl_trace+0x61/0x1e0 [fglrx]



With -O0 it's kinda different:
------------ >8 -O0 >8 -----------------
sie 21 15:41:30 xaos kernel: <6>[fglrx] Maximum main memory to use for locked dma buffers: 15626 MBytes.
sie 21 15:41:30 xaos kernel: <6>[fglrx]   vendor: 1002 device: 67b0 revision: 0 count: 1
sie 21 15:41:30 xaos kernel: <6>[fglrx] ioport: bar 4, base 0xe000, size: 0x100
sie 21 15:41:30 xaos kernel: BUG: unable to handle kernel NULL pointer dereference at 00000000000000d7
sie 21 15:41:30 xaos kernel: IP: [<ffffffffa03087f5>] firegl_postinit_debugger+0x1f5/0x230 [fglrx]
sie 21 15:41:30 xaos kernel: PGD 0 
sie 21 15:41:30 xaos kernel: Oops: 0002 [#1] PREEMPT SMP 
sie 21 15:41:30 xaos kernel: Modules linked in: fglrx(O+) button amd_iommu_v2 ip_tables x_tables hid_generic usbhid hid
sie 21 15:41:30 xaos systemd[1]: Started udev Coldplug all Devices.
sie 21 15:41:30 xaos kernel:  sd_mod
sie 21 15:41:30 xaos kernel:  atkbd
sie 21 15:41:30 xaos kernel:  libps2
sie 21 15:41:30 xaos kernel:  ahci
sie 21 15:41:30 xaos kernel:  libahci
sie 21 15:41:30 xaos kernel:  libata
sie 21 15:41:30 xaos kernel:  xhci_pci
sie 21 15:41:30 xaos kernel:  ehci_pci
sie 21 15:41:30 xaos kernel:  xhci_hcd
sie 21 15:41:30 xaos kernel:  ehci_hcd
sie 21 15:41:30 xaos kernel:  scsi_mod
sie 21 15:41:30 xaos kernel:  usbcore
sie 21 15:41:30 xaos kernel:  usb_common
sie 21 15:41:30 xaos kernel:  i8042 serio crc32c_generic crc32c_intel btrfs xor raid6_pq
sie 21 15:41:30 xaos kernel: CPU: 0 PID: 236 Comm: systemd-modules Tainted: G           O    4.2.0-rc7-mainline #1
sie 21 15:41:30 xaos kernel: Hardware name: MSI MS-7751/Z77A-GD65 (MS-7751), BIOS V10.11 10/09/2013
sie 21 15:41:30 xaos kernel: task: ffff880408051c00 ti: ffff88040806c000 task.ti: ffff88040806c000
sie 21 15:41:30 xaos kernel: RIP: 0010:[<ffffffffa03087f5>]  [<ffffffffa03087f5>] firegl_postinit_debugger+0x1f5/0x230 [fglrx]
sie 21 15:41:30 xaos kernel: RSP: 0018:ffff88040806fa58  EFLAGS: 00010286
sie 21 15:41:30 xaos kernel: RAX: ffff88040806fbc8 RBX: ffff88040806fb37 RCX: 00000000000012dd
sie 21 15:41:30 xaos kernel: RDX: ffffffffa0506758 RSI: ffffffffa03087f5 RDI: 0000000000000320
sie 21 15:41:30 xaos kernel: RBP: 00000000000000c8 R08: 0000000000000000 R09: ffffffffa0505b46
sie 21 15:41:30 xaos kernel: R10: ffffffffa0313ab0 R11: ffffffffa0313a70 R12: 000000000000000d
sie 21 15:41:30 xaos kernel: R13: 0000000000000004 R14: 0000000000000000 R15: ffffffffa0505b46
sie 21 15:41:30 xaos kernel: FS:  00007effe5a20740(0000) GS:ffff88041ec00000(0000) knlGS:0000000000000000
sie 21 15:41:30 xaos kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
sie 21 15:41:30 xaos kernel: CR2: 00000000000000d7 CR3: 000000040bfcc000 CR4: 00000000001406f0
sie 21 15:41:30 xaos kernel: Stack:
sie 21 15:41:30 xaos kernel:  000012dd00000000 ffffffffa0506758 0000000000000000 ffff88040989c000
sie 21 15:41:30 xaos kernel:  ffff88040806faa8 ffffffffa02d4419 ffff88040806fab8 0000000000000040
sie 21 15:41:30 xaos kernel:  ffff88040806fab8 ffff88040a575018 ffff88040806fae8 ffffffff8155d078
sie 21 15:41:30 xaos kernel: Call Trace:
sie 21 15:41:30 xaos kernel:  [<ffffffffa02d4419>] ? KCL_STR_Memcpy+0x30/0x32 [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffff8155d078>] ? klist_next+0xb8/0x110
sie 21 15:41:30 xaos kernel:  [<ffffffffa0313a70>] ? asyncioSvcInitContext+0x30/0x30 [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffff812fb5b0>] ? pci_do_find_bus+0x60/0x60
sie 21 15:41:30 xaos kernel:  [<ffffffffa0f7c0ef>] ? firegl_stub_register+0xef/0xef [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffff813d25fe>] ? bus_find_device+0x8e/0xd0
sie 21 15:41:30 xaos kernel:  [<ffffffffa0f7c0ef>] ? firegl_stub_register+0xef/0xef [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffffa02ce73c>] ? KAS_Initialize+0x48/0x14c [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffffa02e0542>] ? firegl_init+0xe2/0xf0 [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffffa02f2d00>] ? firegl_find_interrupt_by_sourceid+0x50/0x50 [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffffa02f2d20>] ? IRQMGR_CallbackWrapper+0x20/0x20 [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffffa0f7c0ef>] ? firegl_stub_register+0xef/0xef [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffffa0f7c35c>] ? firegl_init_module+0x26d/0xf11 [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffffa0f7c0ef>] ? firegl_stub_register+0xef/0xef [fglrx]
sie 21 15:41:30 xaos kernel:  [<ffffffff81002123>] ? do_one_initcall+0xb3/0x200
sie 21 15:41:30 xaos kernel:  [<ffffffff81198985>] ? __vunmap+0x95/0xf0
sie 21 15:41:30 xaos kernel:  [<ffffffff811b505f>] ? kfree+0x14f/0x160
sie 21 15:41:30 xaos kernel:  [<ffffffff8156772c>] ? do_init_module+0x60/0x1e7
sie 21 15:41:30 xaos kernel:  [<ffffffff810f9a06>] ? load_module+0x2206/0x2850
sie 21 15:41:30 xaos kernel:  [<ffffffff810f67a0>] ? symbol_put_addr+0x40/0x40
sie 21 15:41:30 xaos kernel:  [<ffffffff810fa2a9>] ? SyS_finit_module+0xb9/0xf0
sie 21 15:41:30 xaos kernel:  [<ffffffff8156d92e>] ? entry_SYSCALL_64_fastpath+0x12/0x71
sie 21 15:41:30 xaos kernel: Code: 00 31 c0 89 54 24 30 48 c7 c2 9e e0 56 a0 45 8b 6c 24 0c 44 89 6c 24 28 45 8b 5c 24 08 44 89 5c 24 20 45 8b 54 24 20 44 89 54 24 <18> 45 0f b7 4c 24 1e 44 89 4c 24 10 49 c7 c1 40 c4 57 a0 41 0f 
sie 21 15:41:30 xaos kernel: RIP  [<ffffffffa03087f5>] firegl_postinit_debugger+0x1f5/0x230 [fglrx]
sie 21 15:41:30 xaos kernel:  RSP <ffff88040806fa58>
sie 21 15:41:30 xaos kernel: CR2: 00000000000000d7
sie 21 15:41:30 xaos kernel: ---[ end trace 2aa816977a2cc1cf ]---
sie 21 15:41:30 xaos systemd[1]: systemd-modules-load.service: Main process exited, code=killed, status=9/KILL
sie 21 15:41:30 xaos systemd[1]: Failed to start Load Kernel Modules.
------------ >8 /-O0 >8 -----------------
so possibly here we should find what happened: firegl_postinit_debugger+0x1f5
- because:
BUG: unable to handle kernel NULL pointer dereference at 00000000000000d7
IP: [<ffffffffa03087f5>] firegl_postinit_debugger+0x1f5/0x230 [fglrx]
RIP  [<ffffffffa03087f5>] firegl_postinit_debugger+0x1f5/0x230 [fglrx]





I tried to perform some simple debugging but I failed, maybe because I'm no expert, anyhow here's and example on -O0 of what I did:

1. Preparation: fglrx module was automatically built for 4.2.0-rc7-mainline kernel in temporar directory /tmp/catalyst.4LMaFw and copied to the /lib/modules/4.2.0-rc7-mainline/extramodules/

2. I manually copied fglrx.o created as an additional fruit in 1. - normally its not used, I used it for later debugging - as first argument of (gdb) add-symbol-file
# cp /tmp/catalyst.4LMaFw/fglrx.o /lib/modules/4.2.0-rc7-mainline/extramodules/


3. Booted 4.2.0-rc7-mainline, without running X, system tried to load fglrx and failes, so I ran journalctl -b to tak a log, which I pasted above (in ------------ >8 -O0 >8 -----------------),
most important:
RIP  [<ffffffffa03087f5>] firegl_postinit_debugger+0x1f5/0x230 [fglrx]

4. Enter dir, I will stay here, dir should contain normal fglrx.ko kernel module + previously copied fglrx.o:
# cd /lib/modules/4.2.0-rc7-mainline/extramodules/
# ls
fglrx.ko fglrx.o version*

5. Get address of the text section of the module, for later debugging - second argument of (gdb) add-symbol-file
# cat /sys/module/fglrx/sections/.init.text
0xffffffffa0fa3000

6. Times for debug...
# gdb fglrx.ko

7. Add the symbol file to the debugger - 1st arg is from my step 2., and 2nd arg is from step 5.:
(gdb) add-symbol-file fglrx.o 0xffffffffa0fa3000
add symbol table from file "fglrx.o" at
        .text_addr = 0xffffffffa0fa3000
(y or n) y
Reading symbols from fglrx.o...done.

8. From RIP I took name of offending funtion:
(gdb) disassemble firegl_postinit_debugger
Dump of assembler code for function firegl_postinit_debugger:
   0x0000000000043640 <+0>:     push   %r13
   0x0000000000043642 <+2>:     xor    %r13d,%r13d
   0x0000000000043645 <+5>:     push   %r12
(... couple of lines, like 100, here ... )
   0x0000000000043863 <+547>:   mov    %r8d,(%rdx)
   0x0000000000043866 <+550>:   jmpq   0x437e3 <firegl_postinit_debugger+419>
End of assembler dump.

9.  To point the actual line of offending code, I added the starting address and the offset, 0x0000000000043640 is the starting addres taken from step 8. +0x1f5 is the offset (from RIP), so  0x0000000000043640 + 0x1f5 = 0x0000000000043835:
(gdb) list *0x0000000000043835
(gdb)


That's it, it returns nothing... Was hoping to anything like some code that is causing the brake, but nope... Must be proprietary thing, or I am doing sometinh wrong...
Which is possible. 
Can someone help?


BTW my spec: i7 3770K, Radeon r9 290X, 16GB RAM, MotherBoard MSI Z77A-GD65
Comment 1 Vi0L0 2015-08-21 14:18:36 CDT
Created attachment 1071 [details]
atigetsysteminfo.sh's fruit, compressed

/var/log/Xorg.0.log was created before this boot, as said no X server was launched on this session - simply because it's making tty freeze
Comment 2 Vi0L0 2015-08-21 14:19:23 CDT
I also ran memtest - my RAM is fine.
Comment 3 Allen 2015-09-09 09:52:27 CDT
I am having symptoms of this on two different machines with two different amd cards (R9 280 and an HD 7790) but the same software (Ubuntu 15.10 with FGLRX 15.200 and kernel 4.2.0-7). They work fine with 4.1.0-3 and the DKMS modules compile for 4.2, but do not load at boot.
Comment 4 Chris Allen 2015-09-12 15:15:25 CDT
Having this issue too using the current build of Ubuntu 15.10
Comment 5 Billy Way 2015-09-30 12:47:52 CDT
Same problem here, 

with version

ii  fglrx                                                2:15.201-0ubuntu1                          amd64        Video driver for the AMD graphics accelerators
ii  fglrx-amdcccle                                       2:15.201-0ubuntu1                          amd64        Catalyst Control Center for the AMD graphics accelerators
ii  fglrx-core                                           2:15.201-0ubuntu1                          amd64        Minimal video driver for the AMD graphics accelerators
ii  linux-image-4.2.0-12-generic                         4.2.0-12.14                                amd64        Linux kernel image for version 4.2.0 on 64 bit x86 SMP


hardware
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Oland [Radeon HD 8570 / R7 240/340 OEM]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]


and error code
[   15.526345] RIP  [<ffffffffc044fc91>] firegl_trace+0x61/0x1e0 [fglrx]
Comment 6 ianp 2015-10-05 05:48:04 CDT
Hi,

I am also experiencing this bug. My console freezes because of this and the following are logged:

Oct 05 09:42:08 xbox-am1m kernel: fglrx: module license 'Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY' taints kernel.
Oct 05 09:42:08 xbox-am1m kernel: Disabling lock debugging due to kernel taint
Oct 05 09:42:08 xbox-am1m kernel: fglrx: module verification failed: signature and/or required key missing - tainting kernel
Oct 05 09:42:08 xbox-am1m kernel: <6>[fglrx] Maximum main memory to use for locked dma buffers: 7191 MBytes.
Oct 05 09:42:08 xbox-am1m kernel: <6>[fglrx]   vendor: 1002 device: 9830 revision: 0 count: 1
Oct 05 09:42:08 xbox-am1m kernel: <6>[fglrx] ioport: bar 4, base 0xf000, size: 0x100
Oct 05 09:42:08 xbox-am1m kernel: general protection fault: 0000 [#1] PREEMPT SMP 
Oct 05 09:42:08 xbox-am1m kernel: Modules linked in: aesni_intel fglrx(POE+) aes_x86_64 lrw gf128mul glue_helper snd_hda_codec_hdmi ablk_helper snd_hda_codec_realtek ppdev cryptd snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep serio_raw k10temp s
Oct 05 09:42:08 xbox-am1m kernel: CPU: 0 PID: 300 Comm: systemd-udevd Tainted: P           OE   4.2.0-14-lowlatency #16-Ubuntu
Oct 05 09:42:08 xbox-am1m kernel: Hardware name: ASUS All Series/AM1M-A, BIOS 1301 08/19/2015
Oct 05 09:42:08 xbox-am1m kernel: task: ffff880231263800 ti: ffff8802344f4000 task.ti: ffff8802344f4000
Oct 05 09:42:08 xbox-am1m kernel: RIP: 0010:[<ffffffffc0378c51>]  [<ffffffffc0378c51>] firegl_trace+0x61/0x1e0 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel: RSP: 0018:ffff8802344f7aa8  EFLAGS: 00010282
Oct 05 09:42:08 xbox-am1m kernel: RAX: 0000000000000001 RBX: ffff8802344f7b87 RCX: 00000000000012cf
Oct 05 09:42:08 xbox-am1m kernel: RDX: ffffffffc0575430 RSI: ffffffffc0378c51 RDI: 0000000000000004
Oct 05 09:42:08 xbox-am1m kernel: RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffc05de488
Oct 05 09:42:08 xbox-am1m kernel: R10: ffff88008aa26000 R11: ffffffffc0383bb0 R12: 000000000000000d
Oct 05 09:42:08 xbox-am1m kernel: R13: 0000000000000000 R14: 0000000000000000 R15: ffffffffc05de488
Oct 05 09:42:08 xbox-am1m kernel: FS:  00007fa07db9e8c0(0000) GS:ffff88023ec00000(0000) knlGS:0000000000000000
Oct 05 09:42:08 xbox-am1m kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Oct 05 09:42:08 xbox-am1m kernel: CR2: 00007fa07db2f312 CR3: 00000002344a8000 CR4: 00000000000406f0
Oct 05 09:42:08 xbox-am1m kernel: Stack:
Oct 05 09:42:08 xbox-am1m kernel:  000012cf35a41c00 ffffffffc0575430 0000000000000096 ffff8802344f8000
Oct 05 09:42:08 xbox-am1m kernel:  ffff8802344f7bc8 0000000000000000 ffff88023558d7e8 0000000000000000
Oct 05 09:42:08 xbox-am1m kernel:  ffff8802344f7b08 ffffffff817c1a12 ffff8802344f7bb8 ffff88023558d8a8
Oct 05 09:42:08 xbox-am1m kernel: Call Trace:
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff817c1a12>] ? preempt_schedule_common+0x22/0x40
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff817c1a54>] ? preempt_schedule+0x24/0x30
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff81003012>] ? ___preempt_schedule+0x12/0x14
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc0383bb0>] ? asyncioSvcInitContext+0x30/0x30 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff817c4f20>] ? _raw_spin_unlock+0x20/0x30
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff817b2fe7>] ? klist_next+0x117/0x120
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc0383c70>] ? asyncioSvcRemoveFn+0x80/0x80 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc0340b03>] ? KAS_Initialize+0x133/0x1d0 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc0350682>] ? firegl_init+0xe2/0xf0 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc0362e40>] ? firegl_find_interrupt_by_sourceid+0x50/0x50 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc0362e60>] ? IRQMGR_CallbackWrapper+0x20/0x20 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc101027e>] ? firegl_init_module+0x27e/0x1000 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffffc1010000>] ? 0xffffffffc1010000
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff81002123>] ? do_one_initcall+0xb3/0x200
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff811b90d5>] ? __vunmap+0x95/0xf0
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff811d42ef>] ? kfree+0x14f/0x160
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff817bc597>] ? do_init_module+0x60/0x1e7
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff810fd94c>] ? load_module+0x166c/0x1c20
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff810f9ba0>] ? __symbol_put+0x50/0x50
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff810fe10a>] ? SyS_finit_module+0x9a/0xc0
Oct 05 09:42:08 xbox-am1m kernel:  [<ffffffff817c56f2>] ? entry_SYSCALL_64_fastpath+0x16/0x75
Oct 05 09:42:08 xbox-am1m kernel: Code: df 00 00 00 48 89 54 24 08 89 4c 24 04 ff e6 0f 29 7b f1 0f 29 73 e1 0f 29 6b d1 0f 29 63 c1 0f 29 5b b1 0f 29 53 a1 0f 29 4b 91 <0f> 29 43 81 e8 46 9a fc ff 48 89 c7 e8 5e ae fd ff 44 89 e1 c1 
Oct 05 09:42:08 xbox-am1m kernel: RIP  [<ffffffffc0378c51>] firegl_trace+0x61/0x1e0 [fglrx]
Oct 05 09:42:08 xbox-am1m kernel:  RSP <ffff8802344f7aa8>
Oct 05 09:42:09 xbox-am1m kernel: ---[ end trace c822d1037a10ac96 ]---


The following are the versions of the affected software components:

fglrx          - 2:15.201-0ubuntu1
fglrx-amdcccle - 2:15.201-0ubuntu1
fglrx-core     - 2:15.201-0ubuntu1


My system is as follows:

System:    Host: xbox-am1m Kernel: 4.2.0-14-lowlatency x86_64 (64 bit gcc: 5.2.1)
           Desktop: Xfce 4.12.3 (Gtk 2.24.28) dm: lightdm Distro: Ubuntu 15.10 wily
Machine:   System: ASUS product: All Series
           Mobo: ASUSTeK model: AM1M-A v: Rev X.0x Bios: American Megatrends v: 1301 date: 08/19/2015
CPU:       Quad core AMD Athlon 5350 APU with Radeon R3 (-MCP-) speed/max: 800/2100 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Kabini [Radeon HD 8400 / R3 Series]
           bus-ID: 00:01.0 chip-ID: 1002:9830
           Display Server: X.Org 1.17.2 drivers: (unloaded: fbdev,vesa) Resolution: 1920x1080@60.00hz
           GLX Renderer: Gallium 0.4 on AMD KABINI (DRM 2.43.0, LLVM 3.6.2)
           GLX Version: 3.0 Mesa 11.1.0-devel (git-6994ca2 2015-10-04 vivid-oibaf-ppa) Direct Rendering: Yes
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e000 bus-ID: 01:00.0 chip-ID: 10ec:8168
Drives:    HDD Total Size: 1000.2GB (47.5% used)
Info:      Processes: 216 Uptime: 8:42 Memory: 984.8/7414.0MB
           Init: systemd v: 225 runlevel: 5 default: 2 Gcc sys: 5.2.1
           Client: Shell (bash 4.3.421 running in xfce4-terminal) inxi: 2.2.19


Are bug reports on this site even being looked at by anyone from AMD? I understand that this is Unofficial AMD Bugzilla, but I hope that we get some replies from AMD concerning this issue in Catalyst 15.9.
Comment 7 gbisdeath 2015-10-19 11:46:50 CDT
Same here on Siduction (with fglrx from debian sid, which has patches for 4.2 applied.)

ii  fglrx-driver      1:15.9-2              amd64

From Kernel 4.2 onwards: builds fine but RIPs at boot.
Comment 8 gbisdeath 2015-10-20 07:35:03 CDT
Update: Installed kernel 4.2.0-1-amd64 from debian testing/unstable and it works. Maybe it's an issue with the kernel-config?
I had issues with my custom kernel and the siduction kernel (various versions). 

I'm currently trying to bisect this.
Comment 9 Iuri Diniz 2015-10-24 07:35:14 CDT
(In reply to gbisdeath from comment #8)
> I'm currently trying to bisect this.
Any progress on bisect?
Comment 10 gbisdeath 2015-10-25 06:08:30 CDT
(In reply to Iuri Diniz from comment #9)
> Any progress on bisect?

Unfortunately, not yet. Doesn't even work if i try to build the debian-kernel myself (fetch sources&patches via apt-get and using the .config file of this kernel).
I don't know yet what I'm overlooking.
Comment 11 Billy Way 2015-10-26 00:10:22 CDT
# ln -sf /usr/bin/gcc-4.9 /usr/bin/gcc

is actually gcc compatibility issue,
use gcc-4.9 would make it working.

------------8<----- working on my Ubuntu 15.10 with 4.2.0-16
➜  ~  fglrxinfo            
display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 8570   
OpenGL version string: 4.5.13399 Compatibility Profile Context 15.201.1151

➜  ~  uname -r             
4.2.0-16-generic

➜  ~  lsmod| grep fglrx
fglrx               13447168  173
amd_iommu_v2           20480  1 fglrx


=============8<=== steps to re-compile
sudo ln -sf /usr/bin/gcc-4.9 /usr/bin/gcc     // VERY IMPORTANT
sudo /etc/kernel/prerm.d/dkms 4.2.0-16-generic
sudo /etc/kernel/postinst.d/dkms 4.2.0-16-generic


origin thought
https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/1493888
Comment 12 gbisdeath 2015-10-26 05:10:25 CDT
That's interesting, I actually used gcc-versions 6.0.0 20151014, 5.2.1-22 and 4.9.3-5, both for kernel and fglrx. But I did this not by symlinking but by environment variables.

Thank you, I'll try it again.
Comment 13 Iuri Diniz 2015-10-26 05:58:25 CDT
(In reply to Billy Way from comment #11)
> # ln -sf /usr/bin/gcc-4.9 /usr/bin/gcc
> 
> is actually gcc compatibility issue,
> use gcc-4.9 would make it working.
> 

Interesting, fglrx works when compiled using gcc 5.2 and kernel (4.1.6) with gcc 4.8.4

-----------------------------<MM>-----------------------------
iuri@ubuntu-Inspiron-5447:~$ fglrxinfo 
display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon R7 M260 
OpenGL version string: 4.5.13399 Compatibility Profile Context 15.201.1151



iuri@ubuntu-Inspiron-5447:~$ cat /proc/version 
Linux version 4.1.6-040106-generic (kernel@gomeisa) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) ) #201508170230 SMP Mon Aug 17 06:32:14 UTC 2015




iuri@ubuntu-Inspiron-5447:~$ strings /lib/modules/4.1.6-040106-generic/updates/dkms/fglrx_updates.ko  | grep -i gcc
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010


iuri@ubuntu-Inspiron-5447:~$ lsmod | grep fglrx
fglrx               13447168  137
amd_iommu_v2           20480  1 fglrx


iuri@ubuntu-Inspiron-5447:~$ dmesg | grep fglrx
[    9.048485] fglrx: module license 'Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY' taints kernel.
[    9.056272] fglrx: module verification failed: signature and/or required key missing - tainting kernel
[    9.112853] <6>[fglrx] Maximum main memory to use for locked dma buffers: 15556 MBytes.
[    9.113025] <6>[fglrx]   vendor: 1002 device: 6900 revision: 0 count: 1
[    9.113275] <6>[fglrx] ioport: bar 4, base 0x3000, size: 0x100
[    9.113414] <6>[fglrx] Kernel PAT support is enabled
[    9.113430] <6>[fglrx] module loaded - fglrx 15.20.3 [Sep  8 2015] with 1 minors
[   10.735005] <6>[fglrx] Firegl kernel thread PID: 1039
[   10.735059] <6>[fglrx] Firegl kernel thread PID: 1040
[   10.735106] <6>[fglrx] Firegl kernel thread PID: 1041
[   10.735219] <6>[fglrx] IRQ 50 Enabled
[   10.760225] <6>[fglrx] Reserved FB block: Shared offset:0, size:1000000 
[   10.760227] <6>[fglrx] Reserved FB block: Unshared offset:f77a000, size:1000 
[   10.760228] <6>[fglrx] Reserved FB block: Unshared offset:f77b000, size:4000 
[   10.760229] <6>[fglrx] Reserved FB block: Unshared offset:f77f000, size:581000 
[   10.760230] <6>[fglrx] Reserved FB block: Unshared offset:7ff56000, size:aa000 
iuri@ubuntu-Inspiron-5447:~$
Comment 14 gbisdeath 2015-10-26 07:44:00 CDT
(In reply to Billy Way from comment #11)
> # ln -sf /usr/bin/gcc-4.9 /usr/bin/gcc
> 
> is actually gcc compatibility issue,
> use gcc-4.9 would make it working.
> 

That's it. Builds and boots just fine. Thanks again!
Comment 15 Vi0L0 2015-10-26 12:42:00 CDT
Can confirm it's working on gcc 4.9.3! :>

Doing symlink is no good imho, it's better to modify ati's make.sh file. On arch we are using modifed make.sh file, but on original you can hardcode it in 481 line of (path of uncompressed catalyst' archive) common/lib/modules/fglrx/build_mod/make.sh file so it would look like ie:

make CC=gcc-4.9 \
    LIBIP_PREFIX=$(echo "$LIBIP_PREFIX" | sed -e 's|^\([^/]\)|../\1|') \ 
(... and so on)



It's only a workaround so lets this bugreport stay oppened untill AMD would fix compilation on gcc 5.x for Linux kernel >= 4.2
Comment 16 Billy Way 2015-10-26 21:37:33 CDT
@gbisdeath, NP. glad to see this helping.

@Vi0L0 , Yes, using symbol link is a bad bad idea.
I was just too lazy and want a quick test.

Having a patched make.sh would be better.
Comment 17 Iuri Diniz 2015-10-29 17:21:51 CDT
Compiling with gcc 4.9 doesn't work for me on kernel 4.2.0-17-generic [ubuntu]. Kernel 4.1.6-040106-generic [vanilla] works fine.

So, I think is not only a GCC issue. 

My hardware is: [AMD/ATI] Topaz XT [Radeon R7 M260/M265]

Some users (https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/1493888) are reporting that everything works fine (other hardwares)
Comment 18 Vi0L0 2015-11-26 15:18:41 CST
Fixed in 15.11 AKA Crimson. Closing