Re: crash-5.0: zero-size memory-allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- "ville mattila" <ville.mattila@xxxxxxxxxxxxx> wrote:

> That would be usefull, just warn that some major corruption seems to have
> happen.It is always good to get atleast some crash info out. For example
> dmesg and bt. I'll gladly test patches, if needed.

Patch attached...
 
> Also one question. Is there some hidden option that will show all the
> hidden crash command line options, e.g. --no_kmem_cache and alike?

No, for the most part they are there for debugging crash itself,
or were put in place as a result of specific odd-ball vmcores,
or short-time kernels that were missing a key ingredient, etc.

So, for example, with the attached patch, --no_kmem_cache should
not be needed, even with your horrifically corrupted vmcore...

Dave

Index: memory.c
===================================================================
RCS file: /nfs/projects/cvs/crash/memory.c,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -r1.207 -r1.208
--- memory.c	22 Dec 2009 20:43:30 -0000	1.207
+++ memory.c	13 Jan 2010 20:10:08 -0000	1.208
@@ -7525,6 +7525,7 @@
 	int nr_node_ids;
 
 	if ((THIS_KERNEL_VERSION < LINUX(2,6,22)) ||
+	    !(vt->flags & PERCPU_KMALLOC_V2_NODES) ||
 	    !kernel_symbol_exists("cache_cache") ||
 	    !MEMBER_EXISTS("kmem_cache", "buffer_size"))
 		return;
@@ -7541,7 +7542,6 @@
 		MEMBER_OFFSET("kmem_cache", "buffer_size"));
 
 	if (buffer_size < SIZE(kmem_cache_s)) {
-		ASSIGN_SIZE(kmem_cache_s) = buffer_size;
 
 		if (kernel_symbol_exists("nr_node_ids")) {
 			get_symbol_data("nr_node_ids", sizeof(int),
@@ -7551,6 +7551,14 @@
 		} else
 			vt->kmem_cache_len_nodes = 1;
 
+		if (buffer_size >= (uint)(OFFSET(kmem_cache_s_lists) + 
+	    	    (sizeof(void *) * vt->kmem_cache_len_nodes)))
+			ASSIGN_SIZE(kmem_cache_s) = buffer_size;
+		else
+			error(WARNING, 
+			    "questionable cache_cache.buffer_size: %d\n",
+				buffer_size);
+
 		if (CRASHDEBUG(1)) {
      			fprintf(fp, 
 			    "\nkmem_cache_downsize: SIZE(kmem_cache_s): %ld "
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux