vdso: improve print_fatal_signals support by adding memory maps
When compiling 2.6.17-rc6-mm2 (which contains this patch) my gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) complains about "int len;" being used uninitialized in print_vma(). AFAICS len is not initialized and then passed to pad_len_spaces(int len), which uses it for some calculations.
I also noticed that similar code is used in fs/proc/task_mmu.c, where show_map_internal() passes an uninitialised int len; to pad_len_spaces(struct seq_file *m, int len).
Please include my E-Mail address in replies as I am not subscribed to LKML.
Signature · 5 lines
OpenPGP/GnuPG Key: 0xB2204FA0 @ subkeys.pgp.net "There is no point in having Linux on the Desktop if it's at the cost of it being the same crap that Windows is." - Benjamin Herrenschmidt
Quoted 8 lines · On Sat, 17 Jun 2006 16:14:52 +0200 Simon Raffeiner wrote:
When compiling 2.6.17-rc6-mm2 (which contains this patch) my gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) complains about "int len;" being used uninitialized in
print_vma(). AFAICS len is not initialized and then passed topad_len_spaces(int len), which uses it for some calculations.I also noticed that similar code is used in
fs/proc/task_mmu.c, whereshow_map_internal()passes an uninitialised int len; topad_len_spaces(struct seq_file *m, int len).
Ack both of those. And both of them pass &len as a parameter to printk/seq_printf where it looks as though they want just <len> (after it has been initialized).
Quoted 1 line
Please include my E-Mail address in replies as I am not subscribed to LKML.
---
~Randy
Quoted 7 lines · On Sat, 17 Jun 2006 21:58:18 -0700 "Randy.Dunlap" <[email protected]> wrote:
Quoted 5 lines · On Sat, 17 Jun 2006 16:14:52 +0200 Simon Raffeiner wrote:
When compiling 2.6.17-rc6-mm2 (which contains this patch) my gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) complains about "int len;" being used uninitialized in
print_vma(). AFAICS len is not initialized and then passed topad_len_spaces(int len), which uses it for some calculations.
Quoted 8 lines
Quoted 3 lines
I also noticed that similar code is used in
fs/proc/task_mmu.c, whereshow_map_internal()passes an uninitialised int len; topad_len_spaces(struct seq_file *m, int len).Ack both of those. And both of them pass &len as a parameter to printk/seq_printf where it looks as though they want just <len> (after it has been initialized).
printk("%n", &len) will initialise `len'. gcc is being wrong again.
Am Sonntag, 18. Juni 2006 07:58 schrieben Sie:
Quoted 14 lines
On Sat, 17 Jun 2006 21:58:18 -0700
Quoted 11 lines · Randy.Dunlap
Quoted 9 lines · On Sat, 17 Jun 2006 16:14:52 +0200 Simon Raffeiner wrote:
When compiling 2.6.17-rc6-mm2 (which contains this patch) my gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) complains about "int len;" being used uninitialized in
print_vma(). AFAICS len is not initialized and then passed topad_len_spaces(int len), which uses it for some calculations.I also noticed that similar code is used in
fs/proc/task_mmu.c, whereshow_map_internal()passes an uninitialised int len; topad_len_spaces(struct seq_file *m, int len).
Quoted 5 lines
Quoted 3 lines
Ack both of those. And both of them pass &len as a parameter to printk/seq_printf where it looks as though they want just <len> (after it has been initialized).
printk("%n", &len)will initialise `len'. gcc is being wrong again.
pad_len_spaces() is called in the following way:
static int print_vma(struct vm_area_struct *vma)
{
int len;
(...)
pad_len_spaces(len);
(...)and is defined as:
static void pad_len_spaces(int len)
{
len = 25 + sizeof(void*) * 6 - len;
if (len < 1)
len = 1;
printk("%*c", len, ' ');
}len is passed to pad_len_spaces() without initialization and is used for calculations BEFORE printk() is called.
Signature · 5 lines
OpenPGP/GnuPG Key: 0xB2204FA0 @ subkeys.pgp.net "There is no point in having Linux on the Desktop if it's at the cost of it being the same crap that Windows is." - Benjamin Herrenschmidt
Quoted 49 lines · On Sun, 18 Jun 2006 15:25:35 +0200 Simon Raffeiner wrote:
Am Sonntag, 18. Juni 2006 07:58 schrieben Sie:
Quoted 14 lines
On Sat, 17 Jun 2006 21:58:18 -0700
Quoted 11 lines · Randy.Dunlap
Quoted 9 lines · On Sat, 17 Jun 2006 16:14:52 +0200 Simon Raffeiner wrote:
When compiling 2.6.17-rc6-mm2 (which contains this patch) my gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) complains about "int len;" being used uninitialized in
print_vma(). AFAICS len is not initialized and then passed topad_len_spaces(int len), which uses it for some calculations.I also noticed that similar code is used in
fs/proc/task_mmu.c, whereshow_map_internal()passes an uninitialised int len; topad_len_spaces(struct seq_file *m, int len).Quoted 5 lines
Quoted 3 lines
Ack both of those. And both of them pass &len as a parameter to printk/seq_printf where it looks as though they want just <len> (after it has been initialized).
printk("%n", &len)will initialise `len'. gcc is being wrong again.
pad_len_spaces()is called in the following way:static int
print_vma(struct vm_area_struct *vma){ int len; (...) pad_len_spaces(len); (...)and is defined as:
static void
pad_len_spaces(int len){ len = 25 + sizeof(void*) * 6 - len; if (len < 1) len = 1; printk("%*c", len, ' '); }
Quoted 2 lines
len is passed to
pad_len_spaces()without initialization and is used for calculations BEFOREprintk()is called.
Nope, len is used after printk(..., &len) is called. But I don't see how printk() inits len... ? :( Magic?
---
~Randy
Am Sonntag, 18. Juni 2006 19:42 schrieben Sie:
Quoted 50 lines · On Sun, 18 Jun 2006 15:25:35 +0200 Simon Raffeiner wrote:
Quoted 49 lines
Am Sonntag, 18. Juni 2006 07:58 schrieben Sie:
Quoted 14 lines
On Sat, 17 Jun 2006 21:58:18 -0700
Quoted 11 lines · Randy.Dunlap
Quoted 9 lines · On Sat, 17 Jun 2006 16:14:52 +0200 Simon Raffeiner wrote:
When compiling 2.6.17-rc6-mm2 (which contains this patch) my gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) complains about "int len;" being used uninitialized in
print_vma(). AFAICS len is not initialized and then passed topad_len_spaces(int len), which uses it for some calculations.I also noticed that similar code is used in
fs/proc/task_mmu.c, whereshow_map_internal()passes an uninitialised int len; topad_len_spaces(struct seq_file *m, int len).Quoted 5 lines
Quoted 3 lines
Ack both of those. And both of them pass &len as a parameter to printk/seq_printf where it looks as though they want just <len> (after it has been initialized).
printk("%n", &len)will initialise `len'. gcc is being wrong again.
pad_len_spaces()is called in the following way:static int
print_vma(struct vm_area_struct *vma){ int len; (...) pad_len_spaces(len); (...)and is defined as:
static void
pad_len_spaces(int len){ len = 25 + sizeof(void*) * 6 - len; if (len < 1) len = 1; printk("%*c", len, ' '); }
Quoted 5 lines
Quoted 2 lines
len is passed to
pad_len_spaces()without initialization and is used for calculations BEFOREprintk()is called.Nope, len is used after
printk(..., &len)is called. But I don't see howprintk()inits len... ? :( Magic?
I finally got it: %n in the format string advises printk (have a look at lib/vsprintf.c, where vsnprintf() does the real work) to store the number of characters that have been written so far to a given memory location. So len is actually initialised.
Signature · 5 lines
OpenPGP/GnuPG Key: 0xB2204FA0 @ subkeys.pgp.net "There is no point in having Linux on the Desktop if it's at the cost of it being the same crap that Windows is." - Benjamin Herrenschmidt
Quoted 54 lines · On Sun, 18 Jun 2006 20:29:21 +0200 Simon Raffeiner wrote:
Am Sonntag, 18. Juni 2006 19:42 schrieben Sie:
Quoted 53 lines · On Sun, 18 Jun 2006 15:25:35 +0200 Simon Raffeiner wrote:
Quoted 51 lines
Am Sonntag, 18. Juni 2006 07:58 schrieben Sie:
Quoted 14 lines
On Sat, 17 Jun 2006 21:58:18 -0700
Quoted 11 lines · Randy.Dunlap
Quoted 9 lines · On Sat, 17 Jun 2006 16:14:52 +0200 Simon Raffeiner wrote:
When compiling 2.6.17-rc6-mm2 (which contains this patch) my gcc 4.0.3 (Ubuntu 4.0.3-1ubuntu5) complains about "int len;" being used uninitialized in
print_vma(). AFAICS len is not initialized and then passed topad_len_spaces(int len), which uses it for some calculations.I also noticed that similar code is used in
fs/proc/task_mmu.c, whereshow_map_internal()passes an uninitialised int len; topad_len_spaces(struct seq_file *m, int len).Quoted 5 lines
Quoted 3 lines
Ack both of those. And both of them pass &len as a parameter to printk/seq_printf where it looks as though they want just <len> (after it has been initialized).
printk("%n", &len)will initialise `len'. gcc is being wrong again.
pad_len_spaces()is called in the following way:static int
print_vma(struct vm_area_struct *vma){ int len; (...) pad_len_spaces(len); (...)and is defined as:
static void
pad_len_spaces(int len){ len = 25 + sizeof(void*) * 6 - len; if (len < 1) len = 1; printk("%*c", len, ' '); }len is passed to
pad_len_spaces()without initialization and is used for calculations BEFOREprintk()is called.
Quoted 7 lines
Quoted 2 lines
Nope, len is used after
printk(..., &len)is called. But I don't see howprintk()inits len... ? :( Magic?I finally got it: %n in the format string advises printk (have a look at
lib/vsprintf.c, wherevsnprintf()does the real work) to store the number of characters that have been written so far to a given memory location. So len is actually initialised.
Carp. I knew that. I was just misreading it. Sorry about my confuzion.
---
~Randy