#221 opreport to find nonexistent symbol cause segfault

None
closed-fixed
None
5
2013-07-29
2012-09-24
Li Wang
No

When run the follow command:
#opreport -l -i xxx -X # xxx shows nonexistent symbol
It happens the follow segfault:
opreport[383]: segfault at 8 ip 080abbcd sp bfcadc10 error 4 in opreport[8047000+c3000]
Segmentation fault

oprofile: opreport call un-initialize function pointer

When no finding symbol, the function "summarize_binaries" still
call an un-initialize function pointer.
It will cause opreport segfault.

The follow is my fix patch, and it is in attachment, too.
It already tested ok.
Signed-off-by: Li Wang <li.wang@windriver.com>
---
libpp/xml_utils.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libpp/xml_utils.cpp b/libpp/xml_utils.cpp
index 11dfcdb..364aac8 100644
--- a/libpp/xml_utils.cpp
+++ b/libpp/xml_utils.cpp
@@ -688,7 +688,8 @@ summarize_binaries(extra_images const & extra_found_images)
}

// close out last binary and module
- current_binary->close_binary(symbols_end);
+ if (current_binary)
+ current_binary->close_binary(symbols_end);
}

--

Discussion

  • Li Wang

    Li Wang - 2012-09-24
    • assigned_to: nobody --> maynardj
     
  • Maynard Johnson

    Maynard Johnson - 2012-09-24

    Thanks for the patch. I accepted it and pushed it upstream.

     
  • Maynard Johnson

    Maynard Johnson - 2012-09-24
    • status: open --> open-fixed
     
  • Maynard Johnson

    Maynard Johnson - 2013-07-29
    • status: open-fixed --> closed-fixed
    • Group: -->
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks