Re: using sizeof operator
On Son, 2012-01-22 at 23:58 +0530, Sukrit Sangwan wrote: also i want to ask why not use simply 8 instead of sizeof(u8). Because it is wrong. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Best way to debug an Intel Core i5 hang - likely graphics (possibly power) related
Back again ;) On 01/22/2012 04:40 AM, Mulyadi Santosa wrote: Hi again :) On Sat, Jan 21, 2012 at 16:58, Graeme Russ graeme.r...@gmail.com wrote: Tell me about it :( - I've been here before, just not with the Linux kernel At least I can tell you will get hiccup less :) Anyway, you do have data backup, right? Just in case it causes corrupt and you lose some of your data. Better safe than sorry... I have /home and a separate HDD :) I got netconsole working and it took a while to crash, but it finally did and guess what - No oops :( Ok, no luckhow about serial console? same result? (I am not sure which one will be helpful in your case). Haven't tried serial console - not convinced it will help (see below) Just crossing my mind, is this bug also happen if you work strictly in text console i.e no X Window at all? I've added more (see attached config) From what I can see at a glance, you already enabled enough debugging featuresso just keep it that way at least for now. Also, I am using a very recent tip of linus' branch (commit ccb19d263fd1c9e34948e2158c53eacbff369344) I think this is the way it will go, you would likely doing bisecting. Thing is, you first need to find kernel version that works well. You said you have trouble with 3.1.9-fc...how about 3.1.8 or below? Hmmm, any way to test this theory? Let's say, switching cpu governor? What do you use now? ondemand? then try to switch to conservative. Or just lock the cpu frequency into certain number. I managed to make the system more unstable as I trimmed the kernel and added debugging info. The symptoms were slightly different (graphic freezes rather than flashing screen) To isolate i915, I've installed a nVidia 8600GT from my old machine. Even though I blacklisted i915, it still loads, so I've done an 'rmmod i915' to force it out. So far it all seems pretty stable - I'll leave it powered on for a few days to make sure. I'm then going to buy an ATI 5450 (cheap and passively cooled) and see how that goes. After a week of uptime, I'll switch back to the i915 driver and see what happens. If I get a hang, I'll get the i915 maintainer on board with my problem I think the lack of any kernel messages is due to a hardware conflict which hard-locks the machine. Even the reset button does not respond. Regards, Graeme ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
what is the + sigh in the modules folder name?
I have a path on system called: '/lib/modules/2.6.37+/' It used to be called: '/lib/modules/2.6.37/' where did the plus come from? I'm asking because I have a /lib directory and the kernel sources for it. the problem is there is a closed source driver in the /lib directory and I want to compile a new kernel image, but can't re-compile the closed source modules. I'm guessing my new kernel isn't working because it's looking in the path with the + after being recompiled. thanks, Chris ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Best way to debug an Intel Core i5 hang - likely graphics (possibly power) related
Hi :) On Mon, Jan 23, 2012 at 18:12, Graeme Russ graeme.r...@gmail.com wrote: I managed to make the system more unstable as I trimmed the kernel and added debugging info. The symptoms were slightly different (graphic freezes rather than flashing screen) Ouch.debugging brings more bugs...that's nasty.. To isolate i915, I've installed a nVidia 8600GT from my old machine. Even though I blacklisted i915, it still loads, so I've done an 'rmmod i915' to force it out. So far it all seems pretty stable If possible, try to run one or more games like Doom and see how it goes... IIRC there's a mode in Doom to run kinda automated play but I forgot the name. Just enable as much feature as it can to pound your graphic card at highest resolution possible. - I'll leave it powered on for a few days to make sure. I'm then going to buy an ATI 5450 (cheap and passively cooled) and see how that goes. After a week of uptime, I'll switch back to the i915 driver and see what happens. If I get a hang, I'll get the i915 maintainer on board with my problem I think the lack of any kernel messages is due to a hardware conflict which hard-locks the machine. Even the reset button does not respond. Looks like you're already on the right debugging track. Keep us informed :) -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
Hi... On Mon, Jan 23, 2012 at 23:15, Christopher Harvey ch...@basementcode.com wrote: I have a path on system called: '/lib/modules/2.6.37+/' It used to be called: '/lib/modules/2.6.37/' Hm strange. You said you have the kernel source, right? Can you show us about ten top lines of the Makefile in the main kernel source directory? I am suspecting there is + character in the extraversion..but that needs to be checked -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
On Tue, Jan 24, 2012 at 12:25:20AM +0700, Mulyadi Santosa wrote: Hi... On Mon, Jan 23, 2012 at 23:15, Christopher Harvey ch...@basementcode.com wrote: I have a path on system called: '/lib/modules/2.6.37+/' It used to be called: '/lib/modules/2.6.37/' Hm strange. You said you have the kernel source, right? Can you show us about ten top lines of the Makefile in the main kernel source directory? I am suspecting there is + character in the extraversion..but that needs to be checked No, it just means you have a modified kernel tree, that is not reall 2.6.37, you have changed it somehow. The build system asks git about this when building the kernel. It's normal, just only build a clean 2.6.37 and it will go away. greg k-h ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
On Tue, 24 Jan 2012, Mulyadi Santosa wrote: Hi... On Mon, Jan 23, 2012 at 23:15, Christopher Harvey ch...@basementcode.com wrote: I have a path on system called: '/lib/modules/2.6.37+/' It used to be called: '/lib/modules/2.6.37/' Hm strange. You said you have the kernel source, right? Can you show us about ten top lines of the Makefile in the main kernel source directory? I am suspecting there is + character in the extraversion..but that needs to be checked i'd check scripts/setlocalversion, particularly this snippet around line 50: if [ -z `git describe --exact-match 2/dev/null` ]; then # If only the short version is requested, don't bother # running further git commands if $short; then echo + return fi rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
On Mon, 23 Jan 2012, Greg KH wrote: On Tue, Jan 24, 2012 at 12:25:20AM +0700, Mulyadi Santosa wrote: Hi... On Mon, Jan 23, 2012 at 23:15, Christopher Harvey ch...@basementcode.com wrote: I have a path on system called: '/lib/modules/2.6.37+/' It used to be called: '/lib/modules/2.6.37/' Hm strange. You said you have the kernel source, right? Can you show us about ten top lines of the Makefile in the main kernel source directory? I am suspecting there is + character in the extraversion..but that needs to be checked No, it just means you have a modified kernel tree, that is not reall 2.6.37, you have changed it somehow. The build system asks git about this when building the kernel. you sure? i thought that if it was a modified working tree, you'd get the -dirty qualifier added, not just a +. i should know this since i remember documenting it once upon a time. rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: elf core dump - reading NT_PRPSINFO
Sorry for not clearly specifying. Yes core is a core dump file. I see that fs/binfmt_elf.c does put information about the process that cored in a .note elf section as NT_PRPSINFO. Is there a standard tool to dump this information? Tried googling, could nt find anything :(. -Fredrick On 01/21/2012 09:45 AM, Mulyadi Santosa wrote: Hi :) On Fri, Jan 20, 2012 at 13:57, Fredrickfjohn...@zoho.com wrote: Hi, $ readelf -n core is that core a core dump? Does anyone know how to read this NT_PRPSINFO ? Is hexdump the only way to decode this? Are there any tools to dump this data ? if it is indeed core dump, I think simply pass it to gdb, e.g: gdbprogram elf binary the above core name and start playing with it e.g dumping stack trace. NB: IMHO NT_PRPSINFO is just a section that describes the VMAs of the crashed program. Quite likely an ELF documentation will mention about it. Try googling... ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO driver module for Jetway NF98 board
Now that the code compiles, I need some help to debug it. I used the kernel headers shipped with my distribution (Ubuntu), namely (from uname -r) 2.6.38-13-generic Everything compiles fine, without any warning. But calling insmod, immediately triggers this error (from dmesg): [ 798.129707] generic-usb 0003:413C:2101.0002: input,hidraw0: USB HID v1.11 Keyboard [Dell Dell Smart Card Reader Keyboard] on usb-:00:1a.0-1.2/input0 [ 1414.832761] BUG: unable to handle kernel NULL pointer dereference at 0502 [ 1414.832880] IP: [a00300e4] jwnf98_gpio_init+0xe4/0x1000 [gpio_jwnf98] [ 1414.832982] PGD 20a704067 PUD 21a601067 PMD 0 [ 1414.833036] Oops: [#1] SMP [ 1414.833077] last sysfs file: /sys/devices/pci:00/:00:19.0/net/eth0/statistics/collisions [ 1414.833152] CPU 3 [ 1414.833172] Modules linked in: gpio_jwnf98(+) btrfs zlib_deflate libcrc32c ufs qnx4 hfsplus hfs minix ntfs vfat msdos fat jfs xfs exportfs reiserfs ppdev snd_hda_codec_hdmi snd_hda_codec_via snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event lm78 hwmon_vid snd_seq snd_timer snd_seq_device i915 drm_kms_helper psmouse drm i2c_algo_bit snd video soundcore snd_page_alloc serio_raw lp parport intel_ips usbhid hid firewire_ohci e1000e firewire_core crc_itu_t [ 1414.833725] [ 1414.833744] Pid: 28764, comm: insmod Not tainted 2.6.38-13-generic #54~lucid1-Ubuntu To be filled by O.E.M. To be filled by O.E.M./To be filled by O.E.M. [ 1414.833877] RIP: 0010:[a00300e4] [a00300e4] jwnf98_gpio_init+0xe4/0x1000 [gpio_jwnf98] [ 1414.833965] RSP: 0018:880208adbf18 EFLAGS: 00010206 [ 1414.834011] RAX: 8801e8e8f900 RBX: a04cf080 RCX: 8801e8e8f328 [ 1414.834071] RDX: 0538 RSI: 0538 RDI: 81a19438 [ 1414.834131] RBP: 880208adbf18 R08: R09: 8801e8e8f900 [ 1414.834191] R10: 0004 R11: 0001 R12: [ 1414.834251] R13: a003 R14: 0003 R15: 4000 [ 1414.834312] FS: 7fbb2f5a5700() GS:8800cb38() knlGS: [ 1414.834380] CS: 0010 DS: ES: CR0: 80050033 [ 1414.834430] CR2: 0502 CR3: 0002089b2000 CR4: 06e0 [ 1414.834490] DR0: DR1: DR2: [ 1414.834549] DR3: DR6: 0ff0 DR7: 0400 [ 1414.834610] Process insmod (pid: 28764, threadinfo 880208ada000, task 88021bad16e0) [ 1414.834678] Stack: [ 1414.834698] 880208adbf48 81002053 a04cf080 [ 1414.834775] 024a7010 0003 880208adbf78 810a3d4b [ 1414.834851] 7fff75d0d9da 7fff75d0d9da 024a7030 19db [ 1414.834927] Call Trace: [ 1414.834958] [81002053] do_one_initcall+0x43/0x190 [ 1414.835011] [810a3d4b] sys_init_module+0xfb/0x250 [ 1414.835062] [8100c082] system_call_fastpath+0x16/0x1b [ 1414.835114] Code: c7 c7 c0 93 a1 81 e8 5c d8 03 e1 45 31 c0 48 c7 c1 24 e0 4c a0 ba 01 00 00 00 be 38 05 00 00 48 c7 c7 c0 93 a1 81 e8 3c d8 03 e1 8a 04 25 02 05 00 00 48 c7 c7 00 f0 4c a0 83 c8 20 88 04 25 02 [ 1414.842138] RIP [a00300e4] jwnf98_gpio_init+0xe4/0x1000 [gpio_jwnf98] [ 1414.845597] RSP 880208adbf18 [ 1414.849064] CR2: 0502 [ 1414.921662] ---[ end trace d6d694e0e28fc4ad ]--- I am not aware of any pointer dereference in the code, so it is dificult to me to figure out what is wrong. Fortunately, the system does not become unresponsive (what a nice kernel!!!). The gpio_jwnf98 is listed in lsmod, but no chip directory appears under /sys/class/gpio. Finally, the module can not be removed, rmmod outputs: ERROR: Module gpio_jwnf98 is in use Thanks again for all the help. -- Joan Pau Beltran ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
On Mon, Jan 23, 2012 at 8:52 PM, Graeme Russ graeme.r...@gmail.com wrote: On 01/24/2012 05:15 AM, Greg KH wrote: On Mon, Jan 23, 2012 at 12:40:41PM -0500, Robert P. J. Day wrote: On Mon, 23 Jan 2012, Greg KH wrote: On Tue, Jan 24, 2012 at 12:25:20AM +0700, Mulyadi Santosa wrote: Hi... On Mon, Jan 23, 2012 at 23:15, Christopher Harvey ch...@basementcode.com wrote: I have a path on system called: '/lib/modules/2.6.37+/' It used to be called: '/lib/modules/2.6.37/' Hm strange. You said you have the kernel source, right? Can you show us about ten top lines of the Makefile in the main kernel source directory? I am suspecting there is + character in the extraversion..but that needs to be checked No, it just means you have a modified kernel tree, that is not reall 2.6.37, you have changed it somehow. The build system asks git about this when building the kernel. you sure? i thought that if it was a modified working tree, you'd get the -dirty qualifier added, not just a +. Try it and see :) From what I can tell, the '+' means you are building source which includes upstream commits after the last tag in the tree Well that commits not necessarily are upstream ;-) It only means that are commits after the last tag. Regards, -- Javier Martínez Canillas (+34) 682 39 81 69 Barcelona, Spain ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
Hi Javier, On Tue, Jan 24, 2012 at 8:30 AM, Javier Martinez Canillas martinez.jav...@gmail.com wrote: On Mon, Jan 23, 2012 at 8:52 PM, Graeme Russ graeme.r...@gmail.com wrote: On 01/24/2012 05:15 AM, Greg KH wrote: On Mon, Jan 23, 2012 at 12:40:41PM -0500, Robert P. J. Day wrote: On Mon, 23 Jan 2012, Greg KH wrote: On Tue, Jan 24, 2012 at 12:25:20AM +0700, Mulyadi Santosa wrote: Hi... On Mon, Jan 23, 2012 at 23:15, Christopher Harvey ch...@basementcode.com wrote: I have a path on system called: '/lib/modules/2.6.37+/' It used to be called: '/lib/modules/2.6.37/' Hm strange. You said you have the kernel source, right? Can you show us about ten top lines of the Makefile in the main kernel source directory? I am suspecting there is + character in the extraversion..but that needs to be checked No, it just means you have a modified kernel tree, that is not reall 2.6.37, you have changed it somehow. The build system asks git about this when building the kernel. you sure? i thought that if it was a modified working tree, you'd get the -dirty qualifier added, not just a +. Try it and see :) From what I can tell, the '+' means you are building source which includes upstream commits after the last tag in the tree Well that commits not necessarily are upstream ;-) It only means that are commits after the last tag. It would be worth testing if a checkout of a tag (say 3.2.0) plus a local commit causes '+' and 'dirty' Regards, Graeme ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
Hi Robert, On Tue, Jan 24, 2012 at 8:53 AM, Robert P. J. Day rpj...@crashcourse.ca wrote: On Tue, 24 Jan 2012, Graeme Russ wrote: It would be worth testing if a checkout of a tag (say 3.2.0) plus a local commit causes '+' and 'dirty' i think dirty only shows up if you have local, uncommitted changes. but i should probably verify that. Hmm, if that is the case, I wonder if there is a way in git to tell if there are local commits that are not upstream Regards, Graeme ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: what is the + sigh in the modules folder name?
On Tue, 24 Jan 2012, Graeme Russ wrote: It would be worth testing if a checkout of a tag (say 3.2.0) plus a local commit causes '+' and 'dirty' i think dirty only shows up if you have local, uncommitted changes. but i should probably verify that. rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
RO/NX Protections and Modules
Regarding the source code for kernel version 2.6.38. In kernel/module.c the function defined as: SYSCALL_DEFINE3(init_module...) Calls set_section_ro_nx for core and init. My first question is this: Q1: Why doesn't the exit text/data get the RO/NX page protection? In the set_section_ro_nx function the RO comment reads: Do not protect last partial page and the NX comment reads: Do not protect first partial page. In the presence of mixed pages this makes sense. However, change_page_attr_set_clr seems to check for page alignment. So my second question is this: Q2: Does the RO/NX only apply to page aligned sections? Thank you, Dannie -- Dannie M. Stanley ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
altinstructions and non-core texts
Regarding the source code for kernel version 2.6.38. Alternative instructions are extracted from the module's ELF section .altinstructions. The struct alt_instr has a member instr which seems to correspond to an offset in the text in the cases that I have seen. My question: Q1: Do .altinstructions get applied to sections other than .text? Q2: If yes to Q1, how do I know when an alt_instr applies to another section? (by the way, a similar question may apply in the case of jump_labels and smp_locks, so feel free to comment on those as well) Thanks! Dannie -- Dannie M. Stanley ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
git question
I have a git question regarding the linux kernel. I have cloned linux-stable. I want to merge fs/btrfs from another tree into my linux-stable repo. how can I do this? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: elf core dump - reading NT_PRPSINFO
Hi... On Tue, Jan 24, 2012 at 01:06, Fredrick fjohn...@zoho.com wrote: Sorry for not clearly specifying. Yes core is a core dump file. I see that fs/binfmt_elf.c does put information about the process that cored in a .note elf section as NT_PRPSINFO. Is there a standard tool to dump this information? Tried googling, could nt find anything :(. have you tried elfdump? sorry can't help much about it... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: git question
if you want to merge the whole branch..use git merge ( http://book.git-scm.com/3_basic_branching_and_merging.html ). You might get some conflicts..resolve them, add them and continue with git merge. On other hands, if you want to get only some of the commits and not the whole branch...you can use git cherry-pick ( http://wiki.koha-community.org/wiki/Using_Git_Cherry_Pick ). You still might get some conflicts..resolve and add them and use git commit -c commit id Links provided are good to follow. regards, Tirtha On Tue, Jan 24, 2012 at 4:32 AM, chromaticwt zac zac.3.14...@gmail.comwrote: I have a git question regarding the linux kernel. I have cloned linux-stable. I want to merge fs/btrfs from another tree into my linux-stable repo. how can I do this? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies