Created attachment 862632 [details] Build Environmente & Log * ERROR: net-misc/dahdi-3.1.0-r3::gentoo failed (compile phase): * emake failed /var/tmp/portage/net-misc/dahdi-3.1.0-r3/work/dahdi-linux-3.1.0/drivers/dahdi/wct4xxp/base.c:45:10: fatal error: stdbool.h: No such file or directory 45 | #include <stdbool.h> | ^~~~~~~~~~~ compilation terminated.
Update. I changed every reference to <stdbool.h> to <linux/types.h>, so I was able to complete the build without errors. But, when loading the module with "modprobe cwain", the following messages are shown: dahdi: loading out-of-tree module taints kernel. dahdi: Version: 3.2.0 dahdi: Telephony Interface Registered on major 196 pci 0000:02:09.0: PCI IRQ 25 -> rerouted to legacy IRQ 17 BUG: unable to handle page fault for address: 00000000000026a8 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 1 PID: 446 Comm: modprobe Tainted: G O 6.1.27-gentoo-dist #1 Hardware name: FUJITSU SIEMENS D2239 /D2239, BIOS 4.06 Rev. 1.06.2239 12/07/2006 RIP: 0010:cwain_zap_cards+0x4f/0x390 [cwain] Code: 8b 44 24 04 45 31 f6 85 c0 0f 84 86 02 00 00 4b 8b 5c f4 18 44 89 f5 e8 0f ea fb ff 48 c7 c6 7c 33 70 c0 48 8d bb b8 26 00 00 <48> 89 83 a8 26 00 00 48 83 e7 f8 48 c7 40 10 6e 33 70 c0 89 d8 48 RSP: 0018:ffffacdf00057d80 EFLAGS: 00010282 RAX: ffff9fe9b30c8000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffffffffa9073870 RSI: ffffffffc070337c RDI: 00000000000026b8 RBP: 0000000000000001 R08: 0000000000000400 R09: 0000000000000000 R10: ffff9fe9b30c8000 R11: ffff9fe9849666bb R12: ffff9fe98a9054e0 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000 FS: 00007f62ecda5b80(0000) GS:ffff9fe9fdd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000026a8 CR3: 00000000329a2000 CR4: 00000000000006e0 Call Trace: <TASK> ? cwain_zap_cards+0x390/0x390 [cwain] init_module+0x42/0x60 [cwain] do_one_initcall+0x59/0x220 do_init_module+0x4a/0x1e0 __do_sys_finit_module+0x93/0xf0 do_syscall_64+0x5b/0xc0 ? exc_page_fault+0x70/0x170 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f62ecea4089 Code: 08 89 e8 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 bd 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007ffd2d46d248 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 000055f05ae5fee0 RCX: 00007f62ecea4089 RDX: 0000000000000000 RSI: 000055f05971a4d0 RDI: 0000000000000004 RBP: 000055f05971a4d0 R08: 0000000000000000 R09: 000055f05ae5fee0 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000040000 R13: 0000000000000000 R14: 000055f05ae5f5c0 R15: 0000000000000000 </TASK> Modules linked in: cwain(O+) dahdi(O) amdgpu iommu_v2 gpu_sched video wmi drm_buddy drm_ttm_helper iTCO_wdt ttm intel_pmc_bxt drm_display_helper gpio_ich iTCO_vendor_support cec ppdev kvm_intel drm_kms_helper ipmi_si kvm ipmi_devintf i2c_i801 lpc_ich ipmi_msghandler irqbypass i2c_smbus tg3 pcspkr cfg80211 rfkill parport_pc st i3000_edac parport loop fuse mptspi mptscsih mptbase aic7xxx scsi_transport_spi floppy serio_raw ata_generic pata_acpi CR2: 00000000000026a8 ---[ end trace 0000000000000000 ]--- RIP: 0010:cwain_zap_cards+0x4f/0x390 [cwain] Code: 8b 44 24 04 45 31 f6 85 c0 0f 84 86 02 00 00 4b 8b 5c f4 18 44 89 f5 e8 0f ea fb ff 48 c7 c6 7c 33 70 c0 48 8d bb b8 26 00 00 <48> 89 83 a8 26 00 00 48 83 e7 f8 48 c7 40 10 6e 33 70 c0 89 d8 48 RSP: 0018:ffffacdf00057d80 EFLAGS: 00010282 RAX: ffff9fe9b30c8000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffffffffa9073870 RSI: ffffffffc070337c RDI: 00000000000026b8 RBP: 0000000000000001 R08: 0000000000000400 R09: 0000000000000000 R10: ffff9fe9b30c8000 R11: ffff9fe9849666bb R12: ffff9fe98a9054e0 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000 FS: 00007f62ecda5b80(0000) GS:ffff9fe9fdd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000026a8 CR3: 00000000329a2000 CR4: 00000000000006e0 Every "modprobe -rf cwain" command fails...
Hi, Can you reproduce using dahdi 3.2.0? The cwain module doesn't form part of the offician DAHDI distribution so we'd need to look into that specifically assuming that 3.2.0 doesn't already fix that. Would need your kernel version that you're compiling against as well please. Kind Regards, Jaco
(In reply to Jaco Kroon from comment #2) > Hi, > > Can you reproduce using dahdi 3.2.0? > > The cwain module doesn't form part of the offician DAHDI distribution so > we'd need to look into that specifically assuming that 3.2.0 doesn't already > fix that. > > Would need your kernel version that you're compiling against as well please. > > Kind Regards, > Jaco Hi, first of all, thanks for your reply! I followed your suggest and i tried to emerge dahdi and dahdi-tools version 3.2.0. The process ended without errors, but, again, when i issue modprobe commandwith cwain there are this messages: ======================================================================================================================= dahdi: loading out-of-tree module taints kernel. dahdi: Version: 3.2.0 dahdi: Telephony Interface Registered on major 196 pci 0000:02:09.0: PCI IRQ 25 -> rerouted to legacy IRQ 17 BUG: unable to handle page fault for address: 00000000000026a8 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 0 PID: 41973 Comm: modprobe Tainted: G O 6.1.31-gentoo-dist #1 Hardware name: FUJITSU SIEMENS D2239 /D2239, BIOS 4.06 Rev. 1.06.2239 12/07/2006 RIP: 0010:cwain_zap_cards+0x4f/0x390 [cwain] Code: 8b 44 24 04 45 31 f6 85 c0 0f 84 86 02 00 00 4b 8b 5c f4 18 44 89 f5 e8 0f 4a fc ff 48 c7 c6 7c 43 98 c0 48 8d bb b8 26 00 00 <48> 89 83 a8 26 00 00 48 83 e7 f8 48 c7 40 10 6e 43 98 c0 89 d8 48 RSP: 0018:ffffbee487cf3d40 EFLAGS: 00010282 RAX: ffff986302f5bc00 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffffffffb6075870 RSI: ffffffffc098437c RDI: 00000000000026b8 RBP: 0000000000000001 R08: 0000000000000400 R09: 0000000000000000 R10: ffff986302f5bc00 R11: ffff9863367666bb R12: ffff98630d9aee40 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000 FS: 00007f306886db80(0000) GS:ffff98637dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000026a8 CR3: 000000000bfa8000 CR4: 00000000000006f0 Call Trace: <TASK> ? __die_body.cold+0x1a/0x1f ? page_fault_oops+0x12e/0x2a0 ? fixup_exception+0x22/0x300 ? exc_page_fault+0x70/0x170 ? asm_exc_page_fault+0x22/0x30 ? cwain_zap_cards+0x4f/0x390 [cwain] ? cwain_zap_cards+0x390/0x390 [cwain] init_module+0x42/0x60 [cwain] do_one_initcall+0x59/0x220 do_init_module+0x4a/0x1e0 __do_sys_finit_module+0x93/0xf0 do_syscall_64+0x5b/0xc0 ? syscall_exit_to_user_mode+0x17/0x40 ? do_syscall_64+0x67/0xc0 ? do_syscall_64+0x67/0xc0 ? exc_page_fault+0x70/0x170 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f306896c089 Code: 08 89 e8 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 bd 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007ffda3f07d88 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 0000565190c4def0 RCX: 00007f306896c089 RDX: 0000000000000000 RSI: 000056518f2c74d0 RDI: 0000000000000004 RBP: 000056518f2c74d0 R08: 0000000000000000 R09: 0000565190c4def0 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000040000 R13: 0000000000000000 R14: 0000565190c4d5d0 R15: 0000000000000000 </TASK> Modules linked in: cwain(O+) dahdi(O) amdgpu iommu_v2 gpu_sched video wmi drm_buddy drm_ttm_helper ttm iTCO_wdt drm_display_helper intel_pmc_bxt kvm_intel gpio_ich cec iTCO_vendor_support drm_kms_helper ppdev kvm ipmi_si irqbypass ipmi_devintf lpc_ich cfg80211 i2c_i801 ipmi_msghandler tg3 i2c_smbus rfkill pcspkr st parport_pc parport i3000_edac loop fuse aic7xxx mptspi mptscsih mptbase scsi_transport_spi floppy serio_raw ata_generic pata_acpi CR2: 00000000000026a8 ---[ end trace 0000000000000000 ]--- RIP: 0010:cwain_zap_cards+0x4f/0x390 [cwain] Code: 8b 44 24 04 45 31 f6 85 c0 0f 84 86 02 00 00 4b 8b 5c f4 18 44 89 f5 e8 0f 4a fc ff 48 c7 c6 7c 43 98 c0 48 8d bb b8 26 00 00 <48> 89 83 a8 26 00 00 48 83 e7 f8 48 c7 40 10 6e 43 98 c0 89 d8 48 RSP: 0018:ffffbee487cf3d40 EFLAGS: 00010282 RAX: ffff986302f5bc00 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffffffffb6075870 RSI: ffffffffc098437c RDI: 00000000000026b8 RBP: 0000000000000001 R08: 0000000000000400 R09: 0000000000000000 R10: ffff986302f5bc00 R11: ffff9863367666bb R12: ffff98630d9aee40 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000 FS: 00007f306886db80(0000) GS:ffff98637dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000026a8 CR3: 000000000bfa8000 CR4: 00000000000006f0 ======================================================================================================================= My Kernel is: Linux 6.1.31-gentoo-dist Thanks, Marco
My pleasure. One problem at a time really :). OK, so first off, the normal disclaimer: I'm not a kernel dev (although I've submitted small fixups here and there for obvious things). I'm not intimately familiar with DAHDI hardware either, and generally I'm just fixing up the code to compile, so it could be either that I screwed something up in the patching, or even that the driver has always been broken, I don't know. We will need a bit of back and forth to troubleshoot this, and it might be worthwhile to get the jnet person involved. The specific driver comes from https://www.junghanns.net/ The patch I'm applying are: https://github.com/jkroonza/dahdi-gentoo/blob/master/patches/03-dahdi-3.1.0-jnet-1.0.14.diff I know this is a pain, but does the stack trace remain identical on multiple loads? You'll probably have to reload since rmmod will likely fail. Also, lshw -C net may be helpful (assuming the relevant hardware will show up under class net, otherwise just lshw and find the right block for the cwain hardware please. Please also confirm if you've got one or more than one PCI card that's handled by cwain module. The cwain_zap_cards isn't a long one, but without line numbers in the trace it's unfortunately hard to figure out which memory access is causing the issue, also ztc_initialize could be inlined (it's only called once and marked static so the compiler could trivially make that happen) ... making it even harder. So if possible, a debug build for your kernel would be most helpful, I haven't done that in a very long time (2006 was when last I did semi-serious kernel work) so would need to find a guide in any case. With LTO even cwain_reset_card could well be inlined, making the haystack even larger. ? cwain_zap_cards+0x4f/0x390 [cwain] ? cwain_zap_cards+0x390/0x390 [cwain] To me at least hints to an inlined function, most probably ztcwain_initialize. I do notice that the return values are highly inconsistent from many of these functions, sometimes simply returning -1 and other times a specific -E* error. In the bigger scheme of things I don't think this matters given the way the rest of the code here functions (return value from cwain_zap_cards() is completely ignored for example, so failure won't even be relevant). Multiple cards was plainly an afterthought. dahdi: Telephony Interface Registered on major 196 Indicates that ztcwain_initialize() was called at least since that's what calls dahdi_create_device() which calls the sysfs stuff which outputs that. For starters, in cwain.c, line 2151 contains a commented out prink line, please uncomment that during install, ie, use the ebuild command to prepare the sources, then uncomment that printk for us, then merge, then load the module. This will indicate to us if the problem is in initialize or reset functions. We can then add additional debug printk's to the broken function to more accurately determine the underlying problem.
/usr/sbin/dahdi_hardware This might also pick up the hardware for us, including indicating which drivers may be required for it, prior to loading them. We can then dig for more details.
Last-rited, please see bug #914477.