Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
I see many many section mismatches when compiling with gcc 4.1 and binutils 2.17.50.20070426 They appear to be from .sdata to .init.data. This is with basic zx1_defconfig with a few mods. The reason appears to be compiler weirdness.. WARNING: init/built-in.o(.sdata+0x30): Section mismatch: reference to .init.data:ino (after 'root_mountflags') (initramfs.s contains a 32-word table `head'. Code like: static __initdata struct hash {..} *head[32]; for (p = head; p < head + 32; p++) is generating: .section .sdata L24: .data8 head#+256 Rather than adding 256 to head at run time, the compiler loads L24 and uses that for the comparison. This triggers the warning. WARNING: arch/ia64/kernel/built-in.o(.sdata+0x110): Section mismatch: reference to .init.data:rsvd_region (between 'ia64_sal' and 'ia64_i_cache_stride_shift') WARNING: mm/built-in.o(.sdata+0x48): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x50): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x58): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x60): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x68): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x70): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x78): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x80): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x3c8): Section mismatch: reference to .init.data: (between 'swap_list' and 'slab_early_init') WARNING: mm/built-in.o(.sdata+0x3d8): Section mismatch: reference to .init.data:initkmem_list3 (between 'swap_list' and 'slab_early_init') WARNING: mm/built-in.o(.sdata+0x3e0): Section mismatch: reference to .init.data:initkmem_list3 (between 'swap_list' and 'slab_early_init') WARNING: drivers/built-in.o(.data.rel.local+0x20a8): Section mismatch: reference to .init.text:acpi_processor_start (between 'acpi_processor_driver' and 'acpi_thermal_driver') WARNING: drivers/built-in.o(.data.rel+0x1d80): Section mismatch: reference to .init.text:serial8250_console_setup (between 'serial8250_console' and 'dpm_active') WARNING: drivers/built-in.o(.sdata+0x788): Section mismatch: reference to .init.data: (between 'first.20152' and 'enabled') WARNING: drivers/built-in.o(.sdata+0x790): Section mismatch: reference to .init.data: (between 'first.20152' and 'enabled') WARNING: drivers/built-in.o(.sdata+0xa18): Section mismatch: reference to .init.data: (between 'scsi_null_device_strs' and 'fc_dev_loss_tmo') WARNING: drivers/built-in.o(.sdata+0xa20): Section mismatch: reference to .init.data: (between 'scsi_null_device_strs' and 'fc_dev_loss_tmo') WARNING: drivers/built-in.o(.sdata+0xa28): Section mismatch: reference to .init.data: (between 'scsi_null_device_strs' and 'fc_dev_loss_tmo') WARNING: drivers/built-in.o(.sdata+0xac8): Section mismatch: reference to .init.data: (between 'Symbios_trailer.24436' and 'try_direct_io') WARNING: drivers/built-in.o(.sdata+0xb00): Section mismatch: reference to .init.data: (between 'st_max_sg_segs' and 'osst_version') WARNING: arch/ia64/hp/common/built-in.o(.data.rel.local+0xa8): Section mismatch: reference to .init.text:acpi_sba_ioc_add (between 'acpi_sba_ioc_driver' and 'ioc_seq_ops') WARNING: arch/ia64/hp/common/built-in.o(.sdata+0x0): Section mismatch: reference to .init.data:__setup_str_sba_page_override before 'reserve_sba_gart' (at offset -0x204c2613) -- Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au http://www.ertos.nicta.com.au ERTOS within National ICT Australia - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> Tony, what system are you using to compile on, OS, etc? $ cat /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 5 Beta) -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
Luck, Tony wrote: I used the sn2_defconfig in the tree :) So there is something odd happening. Russ complained that he was still seeing several errors from the sn2_defconfig build too when I posted the "last fix" to Len. But I don't see them when I build. Adding Vivek. I've solved quite a few of the section mismatch errors as well. I'll take a look to see what the problem is. Tony, what system are you using to compile on, OS, etc? P. -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> I used the sn2_defconfig in the tree :) So there is something odd happening. Russ complained that he was still seeing several errors from the sn2_defconfig build too when I posted the "last fix" to Len. But I don't see them when I build. -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Thu, May 31, 2007 at 09:45:31PM -0700, Christoph Lameter wrote: > On Fri, 1 Jun 2007, Sam Ravnborg wrote: > > > On Thu, May 31, 2007 at 09:05:54PM -0700, Christoph Lameter wrote: > > > On Thu, 31 May 2007, Prarit Bhargava wrote: > > > > > > > I used the sn2_defconfig in the tree :) > > > > > > That is a static kernel build. Ideal for that kind of bug. > > Quite the opposite. > > I thought that a static kernel build would throw out the __exit sections? > So it should trigger the bug? Correct. But the other section mismatch warnings that Prarit posted was not related to .exit.text (IIRC). Anyway I will try to do a ia64 build tonight to take a short look at it. If there is something general then I will fix it in modpost. Sam - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Fri, 1 Jun 2007, Sam Ravnborg wrote: > On Thu, May 31, 2007 at 09:05:54PM -0700, Christoph Lameter wrote: > > On Thu, 31 May 2007, Prarit Bhargava wrote: > > > > > I used the sn2_defconfig in the tree :) > > > > That is a static kernel build. Ideal for that kind of bug. > Quite the opposite. I thought that a static kernel build would throw out the __exit sections? So it should trigger the bug? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Thu, May 31, 2007 at 09:05:54PM -0700, Christoph Lameter wrote: > On Thu, 31 May 2007, Prarit Bhargava wrote: > > > I used the sn2_defconfig in the tree :) > > That is a static kernel build. Ideal for that kind of bug. Quite the opposite. If modpost cannot resolve symbols you are jsut told what top-level file it is in. A allmodconfig should be more useful and give you warnings in all normal cases. Let me know if I shall look over some of the warnings. Sam - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Thu, 31 May 2007, Prarit Bhargava wrote: > I used the sn2_defconfig in the tree :) That is a static kernel build. Ideal for that kind of bug. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
Luck, Tony wrote: Tony, the ia64 section mismatch "whack-a-mole" is far from over :( Can you post the .config file that you are using when you see all those warnings ... I'll start bopping them on their cute little heads. Hi Tony, I used the sn2_defconfig in the tree :) P. -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> Tony, the ia64 section mismatch "whack-a-mole" is far from over :( Can you post the .config file that you are using when you see all those warnings ... I'll start bopping them on their cute little heads. -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Thu, 31 May 2007, Prarit Bhargava wrote: > Christoph, this is one less beer I owe you :) :) :) Finally the compile works. Thanks. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Thu, May 31, 2007 at 11:20:27AM -0400, Prarit Bhargava wrote: > > Something is borken in modpost because I found a bug in the loopback > code which is a _REAL_ bug. Here is the result for an i386 allmodconfig build: WARNING: arch/i386/kernel/built-in.o(.init.text+0x3966): Section mismatch: reference to .exit.text: (between 'microcode_init' and 'parse_maxcpus') WARNING: arch/i386/kernel/built-in.o(.init.text+0x3992): Section mismatch: reference to .exit.text: (between 'microcode_init' and 'parse_maxcpus') Building modules, stage 2. Kernel: arch/i386/boot/bzImage is ready (#4) MODPOST 2100 modules WARNING: drivers/acpi/asus_acpi.o(.init.text+0xb7): Section mismatch: reference to .exit.text: (after 'init_module') WARNING: drivers/acpi/toshiba_acpi.o(.init.text+0x13a): Section mismatch: reference to .exit.text: (after 'init_module') WARNING: drivers/block/loop.o(.init.text+0x6b): Section mismatch: reference to .exit.text: (after 'init_module') WARNING: drivers/isdn/hardware/eicon/divadidd.o(.init.text+0xc4): Section mismatch: reference to .exit.text: (between 'init_module' and 'diddfunc_init') WARNING: drivers/isdn/hardware/eicon/divas.o(.init.text+0xf4): Section mismatch: reference to .exit.text:divasfunc_exit (between 'init_module' and 'divasfunc_init') WARNING: drivers/isdn/hardware/eicon/divas.o(.init.text+0x10d): Section mismatch: reference to .exit.text:divasfunc_exit (between 'init_module' and 'divasfunc_init') WARNING: drivers/isdn/hardware/eicon/divas.o(.init.text+0x148): Section mismatch: reference to .exit.text:divasfunc_exit (between 'init_module' and 'divasfunc_init') WARNING: drivers/kvm/kvm-intel.o(.init.text+0xbd): Section mismatch: reference to .exit.text: (between 'hardware_setup' and 'vmx_disabled_by_bios') WARNING: drivers/net/hp100.o(.init.text+0x26a): Section mismatch: reference to .exit.text: (after 'init_module') Sam - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Thu, May 31, 2007 at 11:20:27AM -0400, Prarit Bhargava wrote: > > > Christoph Lameter wrote: > >On Wed, 30 May 2007, Luck, Tony wrote: > > > > > >>>Ahh okay. cscope will do that too But all have __exit. > >>> > >>The trick is that one of them *shouldn't* have __exit. With cscope > >>you'll have to use the "Find functions calling this function:" > >>mode to try and find the __init function that is calling an > >>__exit function. > >> > > > >Urgh... Does it have to be that difficult? > >- > > > > > Sometimes yes ... but in this case no. > > I flipped config options on and off until I tracked the problem down > into the loopback driver, and then manually ran modpost on > drivers/block/built-in.o to reveal: > > Nothing. > > Something is borken in modpost because I found a bug in the loopback > code which is a _REAL_ bug. In the initial version of the section mismatch check code I ignored references to .exit.text from .init.text code. Today I do not see why this should be allowed. So unless an allmodconfig build for i386 + maybe a few more archs does not show any significant regressions I will enable this check. My initial i386 allmodconfig build pointed out a number of places where this happened (I lost the warnings and are doing a rebuild now)A . One such place is microcode.c where we has static int __init microcode_init (void) { ... if (IS_ERR(microcode_pdev)) { microcode_dev_exit(); return PTR_ERR(microcode_pdev); } And: static void __exit microcode_dev_exit (void) { misc_deregister(µcode_dev); } I assume this is a real bug that we have not triggered during testing becasue this is in an error-path. The linker will not error out because .exit.text are discarded at run-time at least for i386. Sam - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
Christoph Lameter wrote: On Wed, 30 May 2007, Luck, Tony wrote: Ahh okay. cscope will do that too But all have __exit. The trick is that one of them *shouldn't* have __exit. With cscope you'll have to use the "Find functions calling this function:" mode to try and find the __init function that is calling an __exit function. Urgh... Does it have to be that difficult? - Sometimes yes ... but in this case no. I flipped config options on and off until I tracked the problem down into the loopback driver, and then manually ran modpost on drivers/block/built-in.o to reveal: Nothing. Something is borken in modpost because I found a bug in the loopback code which is a _REAL_ bug. The -mm tree contains a patch which calls __exit loop_exit from __init loop_init . (I'll submit this patch directly to Andrew in about 5 mins. I'm including the patch here just so Christoph can grab it and continue on.) Christoph, this is one less beer I owe you :) :) :) Tony, the ia64 section mismatch "whack-a-mole" is far from over :( WARNING: init/built-in.o(.sdata+0x48): Section mismatch: reference to .init.data: (after 'C.261.15930') WARNING: init/built-in.o(.sdata+0x50): Section mismatch: reference to .init.data: (after 'C.261.15930') WARNING: init/built-in.o(.sdata+0x58): Section mismatch: reference to .init.data:ino (after 'C.261.15930') WARNING: arch/ia64/kernel/built-in.o(.sdata+0x0): Section mismatch: reference to .init.data:smp_boot_data before 'acpi_irq_model' (at offset -0x0) WARNING: arch/ia64/kernel/built-in.o(.sdata+0x98): Section mismatch: reference to .init.data:rsvd_region (between 'ia64_sal' and 'ia64_i_cache_stride_shift') WARNING: arch/ia64/kernel/built-in.o(.sdata+0xa0): Section mismatch: reference to .init.data:rsvd_region (between 'ia64_sal' and 'ia64_i_cache_stride_shift') WARNING: arch/ia64/kernel/built-in.o(.sdata+0x228): Section mismatch: reference to .init.data:smp_boot_data (between 'cpu.25776' and 'smp_num_siblings') WARNING: arch/ia64/mm/built-in.o(.sdata+0x60): Section mismatch: reference to .init.data: (between 'hpage_shift' and 'first_time.26434') WARNING: arch/ia64/mm/built-in.o(.sdata+0x68): Section mismatch: reference to .init.data: (between 'hpage_shift' and 'first_time.26434') WARNING: mm/built-in.o(.sdata+0x0): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x8): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x10): Section mismatch: reference to .init.data:early_node_map before 'sysctl_lowmem_reserve_ratio' (at offset -0x0) WARNING: mm/built-in.o(.sdata+0x238): Section mismatch: reference to .init.data: (between 'htlb_alloc_mask' and 'slab_early_init') WARNING: mm/built-in.o(.sdata+0x240): Section mismatch: reference to .init.data:initkmem_list3 (between 'htlb_alloc_mask' and 'slab_early_init') WARNING: mm/built-in.o(.sdata+0x248): Section mismatch: reference to .init.data:initkmem_list3 (between 'htlb_alloc_mask' and 'slab_early_init') WARNING: drivers/built-in.o(.sdata+0x8b0): Section mismatch: reference to .init.data: (between 'scsi_null_device_strs' and 'fc_dev_loss_tmo') P. --- linux/drivers/block/loop.c.orig 2007-05-31 11:15:21.0 -0400 +++ linux/drivers/block/loop.c 2007-05-31 11:11:05.0 -0400 @@ -1456,7 +1456,7 @@ static struct kobject *loop_probe(dev_t return kobj; } -static void __exit loop_exit(void) +static void loop_exit(void) { unsigned long range; struct loop_device *lo, *next;
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 30 May 2007 17:09:56 -0700 (PDT) Christoph Lameter wrote: > On Wed, 30 May 2007, Randy Dunlap wrote: > > > OK. I would write the file to disk and view it with an editor. > > Then at each occurrence of /exit.text/, see if it's inside an __init > > function... > > Ahh okay. cscope will do that too But all have __exit. I did a cross-build, but I'm not having any luck finding the problem either. FWIW, mine shows up as: LD .tmp_vmlinux1 local symbol 0: discarded in section `.exit.text' from drivers/built-in.o make[1]: [.tmp_vmlinux1] Error 1 (ignored) KSYM.tmp_kallsyms1.S --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, May 30, 2007 at 04:31:35PM -0700, Christoph Lameter wrote: > On Wed, 30 May 2007, Luck, Tony wrote: > > > > > > `.exit.text' referenced in section `.init.text' of drivers/built-in.o: > > > defined in discarded section `.exit.text' of drivers/built-in.o > > > > > > This one is a fatal error ... the code is trying to call a function > > that has been marked __exit in a driver that has been built-in, instead > > of as a module. Since a builtin driver can never be unloaded, the kernel > > has thrown away all the __exit routines (at link time). > > > > The error message appears less than helpful in tracking down which > > routine in which driver is the problem though. > > Right. I have no idea where to look. The function has no name? Or is the > segment .exit.text referenced by namne in .init.text? Unfortunately modpost does not alows know how to resolve symbol names from addresses. Lately it has been improves by adding support for addends in ELF. But that is beyond my ELF knowledge atm so I cannot improve it. What you can do (apart from the cscope trick as Randy suggest) is to run modpost manual on all .o files in drivers/ If the cross reference happens in a single .o file you will get a hit there. And if it is say in scsi then you will get a hit in scsi/built-in.o Hope this helps. Sam - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 30 May 2007, Luck, Tony wrote: > > Ahh okay. cscope will do that too But all have __exit. > > The trick is that one of them *shouldn't* have __exit. With cscope > you'll have to use the "Find functions calling this function:" > mode to try and find the __init function that is calling an > __exit function. Urgh... Does it have to be that difficult? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> Ahh okay. cscope will do that too But all have __exit. The trick is that one of them *shouldn't* have __exit. With cscope you'll have to use the "Find functions calling this function:" mode to try and find the __init function that is calling an __exit function. -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, May 30, 2007 at 01:11:17PM -0700, Luck, Tony wrote: > > Hmmm - I wonder if my tree is screwed up in some weird way. I'm seeing link > > warnings as well: > > > > WARNING: init/built-in.o - Section mismatch: reference to .init.data: from > > .sdata after 'root_mountflags' (at offset 0x38) > > I thought that I'd got the section mis-match warnings down to > just one (and that was in ACPI code, so I sent a patch to Len > for it). > > Are you building from defconfig, or one of the standard ones? sn2defconfig + kernel debug option plus xfs options. > But I've had other complaints that these Section mismatch warnings > are still showing up in kernels built from the "standard" config > files (arch/ia64/configs/*) ... which I'm not seeing. So I'm more > than a little confused about this. > > These errors are unlikely to be related to the strace bug that > you've reported. I'll try to pound on this some more when I'm > back on the same continent as my test machines. Ok - no real hurry - they don't appear to be causing me any problems except build noise Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 30 May 2007, Randy Dunlap wrote: > OK. I would write the file to disk and view it with an editor. > Then at each occurrence of /exit.text/, see if it's inside an __init > function... Ahh okay. cscope will do that too But all have __exit. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> Saw this when running strace -f on a script on 2.6.21 on ia64 Run strace -f on 2.6.22-rc3 on Tiger4/Montecito. Couldn't reproduce this issue. Kernel was built with both defconfig and tiger_defconfig. Thanks. -Fenghua - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
Christoph Lameter wrote: On Wed, 30 May 2007, Randy Dunlap wrote: Right. I have no idea where to look. The function has no name? Or is the segment .exit.text referenced by namne in .init.text? Maybe 'objdump drivers/built-in.o and then grep that output (file) for /exit.text/ ... OK. I would write the file to disk and view it with an editor. Then at each occurrence of /exit.text/, see if it's inside an __init function... [EMAIL PROTECTED]:~/software/slub$ objdump -t drivers/built-in.o |grep "exit.text" ld .exit.text .exit.text ld *ABS* .rela.exit.text ld .IA_64.unwind_info.exit.text .IA_64.unwind_info.exit.text ld .IA_64.unwind.exit.text .IA_64.unwind.exit.text ld *ABS* .rela.IA_64.unwind.exit.text l F .exit.text 0050 pcie_portdrv_exit 0060 l F .exit.text 0040 aer_service_exit 00a0 l F .exit.text 0040 pci_hotplug_exit 00e0 l F .exit.text 00b0 pcied_cleanup 01a0 l F .exit.text 0160 mspec_exit 0300 l F .exit.text 0010 efi_rtc_exit 0320 l F .exit.text 0010 agp_exit 0340 l F .exit.text 00a0 sn_sal_module_exit 03e0 l F .exit.text 0040 firmware_class_exit 0420 l F .exit.text 0110 rd_cleanup 0540 l F .exit.text 01d0 loop_exit 0720 l F .exit.text 0040 tg3_cleanup 0760 l F .exit.text 0040 idedisk_exit 07a0 l F .exit.text 0040 ide_cdrom_exit 07e0 l F .exit.text 00a0 exit_scsi 0880 l F .exit.text 0080 spi_transport_exit 0900 l F .exit.text 00a0 fc_transport_exit 09a0 l F .exit.text 00e0 sas_transport_exit 0a80 l F .exit.text 0040 sas_class_exit 0ac0 l F .exit.text 0040 qla1280_exit 0b00 l F .exit.text 0140 qla2x00_module_exit 0c40 l F .exit.text 00a0 exit_sd 0ce0 l F .exit.text 0060 ata_exit 0d40 l F .exit.text 0040 vsc_sata_exit 0d80 l F .exit.text 00d0 fusion_exit 0e60 l F .exit.text 00e0 mptspi_exit 0f40 l F .exit.text 00d0 mptfc_exit 1020 l F .exit.text 00f0 mptsas_exit 1120 l F .exit.text 0060 cdrom_exit 1180 l F .exit.text 0080 input_exit 1200 l F .exit.text 0070 mousedev_exit 1280 l F .exit.text 0040 multipath_exit 12c0 l F .exit.text 0240 md_exit 1500 l F .exit.text 0090 dm_exit 15a0 l F .exit.text 0170 efivars_exit 1720 l F .exit.text 0010 hid_exit -- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 30 May 2007, Randy Dunlap wrote: > > Right. I have no idea where to look. The function has no name? Or is the > > segment .exit.text referenced by namne in .init.text? > > Maybe 'objdump drivers/built-in.o and then grep that output (file) > for /exit.text/ ... [EMAIL PROTECTED]:~/software/slub$ objdump -t drivers/built-in.o |grep "exit.text" ld .exit.text .exit.text ld *ABS* .rela.exit.text ld .IA_64.unwind_info.exit.text .IA_64.unwind_info.exit.text ld .IA_64.unwind.exit.text .IA_64.unwind.exit.text ld *ABS* .rela.IA_64.unwind.exit.text l F .exit.text 0050 pcie_portdrv_exit 0060 l F .exit.text 0040 aer_service_exit 00a0 l F .exit.text 0040 pci_hotplug_exit 00e0 l F .exit.text 00b0 pcied_cleanup 01a0 l F .exit.text 0160 mspec_exit 0300 l F .exit.text 0010 efi_rtc_exit 0320 l F .exit.text 0010 agp_exit 0340 l F .exit.text 00a0 sn_sal_module_exit 03e0 l F .exit.text 0040 firmware_class_exit 0420 l F .exit.text 0110 rd_cleanup 0540 l F .exit.text 01d0 loop_exit 0720 l F .exit.text 0040 tg3_cleanup 0760 l F .exit.text 0040 idedisk_exit 07a0 l F .exit.text 0040 ide_cdrom_exit 07e0 l F .exit.text 00a0 exit_scsi 0880 l F .exit.text 0080 spi_transport_exit 0900 l F .exit.text 00a0 fc_transport_exit 09a0 l F .exit.text 00e0 sas_transport_exit 0a80 l F .exit.text 0040 sas_class_exit 0ac0 l F .exit.text 0040 qla1280_exit 0b00 l F .exit.text 0140 qla2x00_module_exit 0c40 l F .exit.text 00a0 exit_sd 0ce0 l F .exit.text 0060 ata_exit 0d40 l F .exit.text 0040 vsc_sata_exit 0d80 l F .exit.text 00d0 fusion_exit 0e60 l F .exit.text 00e0 mptspi_exit 0f40 l F .exit.text 00d0 mptfc_exit 1020 l F .exit.text 00f0 mptsas_exit 1120 l F .exit.text 0060 cdrom_exit 1180 l F .exit.text 0080 input_exit 1200 l F .exit.text 0070 mousedev_exit 1280 l F .exit.text 0040 multipath_exit 12c0 l F .exit.text 0240 md_exit 1500 l F .exit.text 0090 dm_exit 15a0 l F .exit.text 0170 efivars_exit 1720 l F .exit.text 0010 hid_exit - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 30 May 2007 16:31:35 -0700 (PDT) Christoph Lameter wrote: > On Wed, 30 May 2007, Luck, Tony wrote: > > > > > > `.exit.text' referenced in section `.init.text' of drivers/built-in.o: > > > defined in discarded section `.exit.text' of drivers/built-in.o > > > > > > This one is a fatal error ... the code is trying to call a function > > that has been marked __exit in a driver that has been built-in, instead > > of as a module. Since a builtin driver can never be unloaded, the kernel > > has thrown away all the __exit routines (at link time). > > > > The error message appears less than helpful in tracking down which > > routine in which driver is the problem though. > > Right. I have no idea where to look. The function has no name? Or is the > segment .exit.text referenced by namne in .init.text? Maybe 'objdump drivers/built-in.o and then grep that output (file) for /exit.text/ ... --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 30 May 2007, Luck, Tony wrote: > > > `.exit.text' referenced in section `.init.text' of drivers/built-in.o: > > defined in discarded section `.exit.text' of drivers/built-in.o > > > This one is a fatal error ... the code is trying to call a function > that has been marked __exit in a driver that has been built-in, instead > of as a module. Since a builtin driver can never be unloaded, the kernel > has thrown away all the __exit routines (at link time). > > The error message appears less than helpful in tracking down which > routine in which driver is the problem though. Right. I have no idea where to look. The function has no name? Or is the segment .exit.text referenced by namne in .init.text? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> `.exit.text' referenced in section `.init.text' of drivers/built-in.o: > defined in discarded section `.exit.text' of drivers/built-in.o This one is a fatal error ... the code is trying to call a function that has been marked __exit in a driver that has been built-in, instead of as a module. Since a builtin driver can never be unloaded, the kernel has thrown away all the __exit routines (at link time). The error message appears less than helpful in tracking down which routine in which driver is the problem though. -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 30 May 2007, Luck, Tony wrote: > > WARNING: init/built-in.o - Section mismatch: reference to .init.data: from > > .sdata after 'root_mountflags' (at offset 0x38) > > I thought that I'd got the section mis-match warnings down to > just one (and that was in ACPI code, so I sent a patch to Len > for it). Hmmm... My compilation of 2.6.21-rc2-mm1 just aborted with: (used sn2_defconfig). LD .tmp_vmlinux1 `.exit.text' referenced in section `.init.text' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o make[2]: *** [.tmp_vmlinux1] Error 1 make[1]: *** [targz-pkg] Error 2 make: *** [targz-pkg] Error 2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> Hmmm - I wonder if my tree is screwed up in some weird way. I'm seeing link > warnings as well: > > WARNING: init/built-in.o - Section mismatch: reference to .init.data: from > .sdata after 'root_mountflags' (at offset 0x38) I thought that I'd got the section mis-match warnings down to just one (and that was in ACPI code, so I sent a patch to Len for it). Are you building from defconfig, or one of the standard ones? Changing config options always has the possibility of unearthing new spots where there are conflicts between __init, __cpuinit and __devinit. But I've had other complaints that these Section mismatch warnings are still showing up in kernels built from the "standard" config files (arch/ia64/configs/*) ... which I'm not seeing. So I'm more than a little confused about this. These errors are unlikely to be related to the strace bug that you've reported. I'll try to pound on this some more when I'm back on the same continent as my test machines. -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, May 30, 2007 at 01:30:41PM +1000, David Chinner wrote: > On Wed, May 23, 2007 at 10:44:16AM -0700, Luck, Tony wrote: > > > > Saw this when running strace -f on a script on 2.6.21 on ia64: > > > > > > > > BUG: sleeping function called from invalid context at kernel/fork.c:385 > > > > in_atomic():1, irqs_disabled():0 > > ... snip ... > > > > I could reproduce it via 'strace -f sleep 1' > > > > > > > > > > I'd say this is specific to ia64. Someone would have spotted it on > > > x86 by now. > > > > I tried the "strace -f sleep 1" on 2.6.22-rc2, and I didn't see this "BUG" > > there. Can you try your other test cases on the latest kernel. If it has > > already been fixed we can see about identifying the patch for possible > > backport > > to 2.6.21.stable > > Sorry for taking so long to get back to this - I still see this in > 2.6.22-rc2. Hmmm - I wonder if my tree is screwed up in some weird way. I'm seeing link warnings as well: AS .tmp_kallsyms2.o LD vmlinux SYSMAP System.map SYSMAP .tmp_System.map MODPOST vmlinux WARNING: init/built-in.o - Section mismatch: reference to .init.data: from .sdata after 'root_mountflags' (at offset 0x38) WARNING: init/built-in.o - Section mismatch: reference to .init.data:ino from .sdata after 'root_mountflags' (at offset 0x40) WARNING: arch/ia64/kernel/built-in.o - Section mismatch: reference to .init.data:smp_boot_data from .sdata before 'acpi_irq_model' (at offset -0x0) WARNING: arch/ia64/kernel/built-in.o - Section mismatch: reference to .init.data:rsvd_region from .sdata between 'ia64_sal' (at offset 0x118) and 'ia64_i_cache_stride_shift' WARNING: arch/ia64/kernel/built-in.o - Section mismatch: reference to .init.data:smp_boot_data from .sdata between 'cpu.25267' (at offset0x2e8) and 'sal_state_for_booting_cpu' WARNING: arch/ia64/mm/built-in.o - Section mismatch: reference to .init.data: from .sdata between 'hpage_shift' (at offset 0x50) and 'first_time.25897' WARNING: arch/ia64/mm/built-in.o - Section mismatch: reference to .init.data: from .sdata between 'hpage_shift' (at offset 0x68) and 'first_time.25897' WARNING: arch/ia64/mm/built-in.o - Section mismatch: reference to .init.data: from .sdata between 'hpage_shift' (at offset 0x70) and 'first_time.25897' WARNING: arch/ia64/mm/built-in.o - Section mismatch: reference to .init.data: from .sdata between 'hpage_shift' (at offset 0x88) and 'first_time.25897' WARNING: arch/ia64/mm/built-in.o - Section mismatch: reference to .init.data: from .sdata between 'hpage_shift' (at offset 0x90) and 'first_time.25897' . There's more errors, but they are all section mismatch warnings. I tried a make mrproper to see if that would fix but it didn't Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, May 23, 2007 at 10:44:16AM -0700, Luck, Tony wrote: > > > Saw this when running strace -f on a script on 2.6.21 on ia64: > > > > > > BUG: sleeping function called from invalid context at kernel/fork.c:385 > > > in_atomic():1, irqs_disabled():0 > ... snip ... > > > I could reproduce it via 'strace -f sleep 1' > > > > > > > I'd say this is specific to ia64. Someone would have spotted it on > > x86 by now. > > I tried the "strace -f sleep 1" on 2.6.22-rc2, and I didn't see this "BUG" > there. Can you try your other test cases on the latest kernel. If it has > already been fixed we can see about identifying the patch for possible > backport > to 2.6.21.stable Sorry for taking so long to get back to this - I still see this in 2.6.22-rc2. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: BUG: sleeping function called from invalid context at kernel/fork.c:385
> > Saw this when running strace -f on a script on 2.6.21 on ia64: > > > > BUG: sleeping function called from invalid context at kernel/fork.c:385 > > in_atomic():1, irqs_disabled():0 ... snip ... > > I could reproduce it via 'strace -f sleep 1' > > > > I'd say this is specific to ia64. Someone would have spotted it on > x86 by now. I tried the "strace -f sleep 1" on 2.6.22-rc2, and I didn't see this "BUG" there. Can you try your other test cases on the latest kernel. If it has already been fixed we can see about identifying the patch for possible backport to 2.6.21.stable -Tony - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: BUG: sleeping function called from invalid context at kernel/fork.c:385
On Wed, 23 May 2007 16:31:54 +1000 David Chinner <[EMAIL PROTECTED]> wrote: > Saw this when running strace -f on a script on 2.6.21 on ia64: > > BUG: sleeping function called from invalid context at kernel/fork.c:385 > in_atomic():1, irqs_disabled():0 > > Call Trace: > [] show_stack+0x80/0xa0 > sp=e0306e6f7a00 bsp=e0306e6f0ef8 > [] dump_stack+0x30/0x60 > sp=e0306e6f7bd0 bsp=e0306e6f0ee0 > [] __might_sleep+0x1f0/0x260 > sp=e0306e6f7bd0 bsp=e0306e6f0eb8 > [] mmput+0x20/0x220 > sp=e0306e6f7bd0 bsp=e0306e6f0e90 > [] sys_ptrace+0x460/0x1600 > sp=e0306e6f7bd0 bsp=e0306e6f0d80 > [] ia64_ret_from_syscall+0x0/0x20 > sp=e0306e6f7e30 bsp=e0306e6f0d80 > [] __kernel_syscall_via_break+0x0/0x20 > sp=e00000306e6f8000 bsp=e00000306e6f0d80 > BUG: sleeping function called from invalid context at kernel/fork.c:385 > in_atomic():1, irqs_disabled():0 > > Call Trace: > [] show_stack+0x80/0xa0 > sp=e0306e6f7a00 bsp=e0306e6f0ef8 > [] dump_stack+0x30/0x60 > sp=e0306e6f7bd0 bsp=e0306e6f0ee0 > [] __might_sleep+0x1f0/0x260 > sp=e0306e6f7bd0 bsp=e0306e6f0eb8 > [] mmput+0x20/0x220 > sp=e0306e6f7bd0 bsp=e0306e6f0e90 > [] sys_ptrace+0x460/0x1600 > sp=e0306e6f7bd0 bsp=e0306e6f0d80 > [] ia64_ret_from_syscall+0x0/0x20 > sp=e0306e6f7e30 bsp=e0306e6f0d80 > [] __kernel_syscall_via_break+0x0/0x20 > sp=e0306e6f8000 bsp=e0306e6f0d80 > > I could reproduce it via 'strace -f sleep 1' > I'd say this is specific to ia64. Someone would have spotted it on x86 by now. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
BUG: sleeping function called from invalid context at kernel/fork.c:385
Saw this when running strace -f on a script on 2.6.21 on ia64: BUG: sleeping function called from invalid context at kernel/fork.c:385 in_atomic():1, irqs_disabled():0 Call Trace: [] show_stack+0x80/0xa0 sp=e0306e6f7a00 bsp=e0306e6f0ef8 [] dump_stack+0x30/0x60 sp=e0306e6f7bd0 bsp=e0306e6f0ee0 [] __might_sleep+0x1f0/0x260 sp=e0306e6f7bd0 bsp=e0306e6f0eb8 [] mmput+0x20/0x220 sp=e0306e6f7bd0 bsp=e0306e6f0e90 [] sys_ptrace+0x460/0x1600 sp=e0306e6f7bd0 bsp=e0306e6f0d80 [] ia64_ret_from_syscall+0x0/0x20 sp=e0306e6f7e30 bsp=e0306e6f0d80 [] __kernel_syscall_via_break+0x0/0x20 sp=e0306e6f8000 bsp=e0306e6f0d80 BUG: sleeping function called from invalid context at kernel/fork.c:385 in_atomic():1, irqs_disabled():0 Call Trace: [] show_stack+0x80/0xa0 sp=e0306e6f7a00 bsp=e0306e6f0ef8 [] dump_stack+0x30/0x60 sp=e0306e6f7bd0 bsp=e0306e6f0ee0 [] __might_sleep+0x1f0/0x260 sp=e0306e6f7bd0 bsp=e0306e6f0eb8 [] mmput+0x20/0x220 sp=e0306e6f7bd0 bsp=e0306e6f0e90 [] sys_ptrace+0x460/0x1600 sp=e0306e6f7bd0 bsp=e0306e6f0d80 [] ia64_ret_from_syscall+0x0/0x20 sp=e0306e6f7e30 bsp=e0306e6f0d80 [] __kernel_syscall_via_break+0x0/0x20 sp=e0306e6f8000 bsp=e0306e6f0d80 I could reproduce it via 'strace -f sleep 1' Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/