All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Stone <ahs3 at redhat.com>
To: devel@acpica.org
Subject: [Devel] [RFC] proposed patch for some segfaults encountered
Date: Mon, 01 Jun 2015 14:59:22 -0600	[thread overview]
Message-ID: <556CC7AA.4010000@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

It's not clear to me that this is the correct way to handle a segfault that
was reported to me via Fedora.

Using the ssdt9.dat file attached, a simple "iasl -d ssdt9.dat" will segfault
around calls to AcpiDmPromoteTarget -- and it turns out that the Target pointer
being passed into that function was sometimes null but not being checked in the
calling function, AcpiDmCheckForSymbolicOpcode.  So, this patch adds in some
checks for null pointers and can now get through this particular problem.

However, I did not study AcpiDmCheckForSymbolicOpcode long enough to determine
if the Target pointer in that function should or should not ever be null.  So,
this patch fixes this issue, but it may not be the proper long term solution.

-- 
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3(a)redhat.com
-----------------------------------

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: segfault.patch --]
[-- Type: text/x-patch, Size: 1207 bytes --]

diff -Naur acpica-unix2-20150515.orig/source/components/disassembler/dmcstyle.c acpica-unix2-20150515/source/components/disassembler/dmcstyle.c
--- acpica-unix2-20150515.orig/source/components/disassembler/dmcstyle.c	2015-06-01 14:32:51.769218887 -0600
+++ acpica-unix2-20150515/source/components/disassembler/dmcstyle.c	2015-06-01 14:37:38.973898839 -0600
@@ -407,7 +407,7 @@
         {
             AcpiDmPromoteTarget (Op, Target);
 
-            if (!Target->Common.OperatorSymbol)
+            if (Target && !Target->Common.OperatorSymbol)
             {
                 Target->Common.OperatorSymbol = " = ";
             }
@@ -425,7 +425,7 @@
         Target = Child1->Common.Next;
         AcpiDmPromoteTarget (Op, Target);
 
-        if (!Target->Common.OperatorSymbol)
+        if (Target && !Target->Common.OperatorSymbol)
         {
             Target->Common.OperatorSymbol = " = ";
         }
@@ -446,7 +446,10 @@
             /* Valid target, not a placeholder */
 
             AcpiDmPromoteTarget (Op, Target);
-            Target->Common.OperatorSymbol = " = ~";
+	    if (Target)
+	    {
+            	Target->Common.OperatorSymbol = " = ~";
+	    }
         }
         else
         {

             reply	other threads:[~2015-06-01 20:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 20:59 Al Stone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-01 21:58 [Devel] [RFC] proposed patch for some segfaults encountered Moore, Robert
2015-06-02 15:07 Al Stone
2015-06-02 16:26 Moore, Robert
2015-06-02 16:47 Al Stone
2015-06-02 18:55 Moore, Robert
2015-06-02 19:06 Moore, Robert
2015-06-02 20:05 Moore, Robert
2015-06-02 20:13 Al Stone
2015-06-03  0:37 Zheng, Lv
2015-06-03 14:57 Moore, Robert
2015-06-03 19:54 Al Stone
2015-06-03 20:36 Moore, Robert
2015-06-03 21:06 Moore, Robert
2015-06-03 21:26 Al Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556CC7AA.4010000@redhat.com \
    --to=devel@acpica.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.