Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1516772 - Getting Segmentation fault for a python code
Summary: Getting Segmentation fault for a python code
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: glibc team
QA Contact: qe-baseos-tools
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-23 11:19 UTC by Ehteshaam
Modified: 2017-11-27 15:56 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-27 15:56:17 UTC


Attachments (Terms of Use)

Description Ehteshaam 2017-11-23 11:19:54 UTC
Description of problem:

Segmentation Fault in a python program

Version-Release number of selected component (if applicable):


How reproducible:
Not sure

Steps to Reproduce:
1.
2.
3.

Actual results:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7228e00 in __strncmp_sse42 () from /lib64/libc.so.6

Expected results:


Additional info:

Comment 2 Florian Weimer 2017-11-23 11:40:32 UTC
This bug report does not contain sufficient information.  We need a full backtrace, with debugging symbols installed, and ideally, instructions how to reproduce the issue (e.g., installed Python modules).

If you need assistence with obtain this information, please file a support request at:

  <https://access.redhat.com/support/>

Comment 3 Ehteshaam 2017-11-27 05:55:04 UTC
Backtrace :


(gdb) backtrace
#0  0x00007ffff7228e00 in __strncmp_sse42 () from /lib64/libc.so.6
#1  0x00007ffff03b3a48 in __xmlParserInputBufferCreateFilename (URI=0x9c7f3c "/opt/monitor/tools/etc/pmonspec.xml", enc=XML_CHAR_ENCODING_NONE) at xmlIO.c:2476
#2  0x00007ffff038cd44 in xmlNewInputFromFile__internal_alias (ctxt=0xa012a0, filename=0x9c7f3c "/opt/monitor/tools/etc/pmonspec.xml") at parserInternals.c:1463
#3  0x00007ffff03b59a2 in xmlDefaultExternalEntityLoader (URL=0x9c7f3c "/opt/monitor/tools/etc/pmonspec.xml", ID=0x0, ctxt=0xa012a0) at xmlIO.c:3832
#4  0x00007ffff085d722 in __pyx_f_4lxml_5etree__local_resolver (__pyx_v_c_url=0x9c7f3c "/opt/monitor/tools/etc/pmonspec.xml", __pyx_v_c_pubid=0x0, __pyx_v_c_context=0xa012a0)
    at src/lxml/lxml.etree.c:63618
#5  0x00007ffff03a4bd0 in xmlCtxtReadFile__internal_alias (ctxt=0xa012a0, filename=0x9c7f3c "/opt/monitor/tools/etc/pmonspec.xml", encoding=0x0, options=83970) at parser.c:14487
#6  0x00007ffff08754b4 in __pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile (__pyx_v_self=0x7b6640, __pyx_v_c_filename=0x9c7f3c "/opt/monitor/tools/etc/pmonspec.xml")
    at src/lxml/lxml.etree.c:68146
#7  0x00007ffff083316f in __pyx_f_4lxml_5etree__parseDocFromFile (__pyx_v_filename8=0x9c7f18, __pyx_v_parser=0x7b6640) at src/lxml/lxml.etree.c:71175
#8  0x00007ffff0833239 in __pyx_f_4lxml_5etree__parseDocumentFromURL (__pyx_v_url=0x7fffffffda14, __pyx_v_parser=0x7fff00000000) at src/lxml/lxml.etree.c:72080
#9  0x00007ffff0885768 in __pyx_f_4lxml_5etree__parseDocument (__pyx_v_source=0x9c7f18, __pyx_v_parser=0x66d2b0 <_Py_NoneStruct>, __pyx_v_base_url=0x66d2b0 <_Py_NoneStruct>)
    at src/lxml/lxml.etree.c:71797
#10 0x00007ffff08863aa in __pyx_pf_4lxml_5etree_12_ElementTree_parse (__pyx_v_self=0x9cc170, __pyx_args=<optimized out>, __pyx_kwds=<optimized out>) at src/lxml/lxml.etree.c:39625
#11 0x00000000004a0476 in call_function (pp_stack=<optimized out>, oparg=<optimized out>) at Python/ceval.c:4012
#12 PyEval_EvalFrameEx (f=0x7f7170, throwflag=<optimized out>) at Python/ceval.c:2665
#13 0x00000000004a1f74 in PyEval_EvalCodeEx (co=0x7ffff7ee63b0, globals=<optimized out>, locals=<optimized out>, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
    at Python/ceval.c:3252
#14 0x00000000004a20f2 in PyEval_EvalCode (co=0x7fffffffda14, globals=0x7fff00000000, locals=0x4) at Python/ceval.c:666
#15 0x00000000004c4e90 in run_mod (mod=<optimized out>, filename=<optimized out>, globals=0x7fff00000000, locals=0x4, flags=<optimized out>, arena=<optimized out>) at Python/pythonrun.c:1346
#16 PyRun_FileExFlags (fp=0x776630, filename=0x7fffffffe615 "/opt/monitor/tools/bin/pmon_my", start=<optimized out>, globals=0x6f2140, locals=0x6f2140, closeit=1, flags=0x7fffffffe1ac)
    at Python/pythonrun.c:1332
#17 0x00000000004c6109 in PyRun_SimpleFileExFlags (fp=0x776630, filename=0x7fffffffe615 "/opt/monitor/tools/bin/pmon_my", closeit=1, flags=0x7fffffffe1ac) at Python/pythonrun.c:936
#18 0x000000000041462c in Py_Main (argc=<optimized out>, argv=0x7fffffffe358) at Modules/main.c:599
#19 0x00007ffff7114c05 in __libc_start_main () from /lib64/libc.so.6
#20 0x0000000000413aba in _start ()

Comment 4 Ehteshaam 2017-11-27 05:57:37 UTC
Background :

This program used to work fine on RHEL 6 and RHEL 7.3 machines in our environments.

Comment 5 Florian Weimer 2017-11-27 07:23:50 UTC
What is the version of libxml2?  Do you have another version of libxml2 installed which is not the system version?  The line numbers do not match the version which we ship in Red Hat Enterprise Linux 7.4, and it appears to have been compiled differently.

This is relevant because the only strncmp call is here:

   2652 #ifdef HAVE_ZLIB_H
   2653         if ((xmlInputCallbackTable[i].opencallback == xmlGzfileOpen) &&
   2654                 (strcmp(URI, "-") != 0)) {
   2655 #if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1230
   2656             ret->compressed = !gzdirect(context);
   2657 #else
   2658             if (((z_stream *)context)->avail_in > 4) {
   2659                 char *cptr, buff4[4];
   2660                 cptr = (char *) ((z_stream *)context)->next_in;
   2661                 if (gzread(context, buff4, 4) == 4) {
   2662                     if (strncmp(buff4, cptr, 4) == 0)
   2663                         ret->compressed = 0;
   2664                     else
   2665                         ret->compressed = 1;
   2666                     gzrewind(context);
   2667                 }
   2668             }
   2669 #endif
   2670         }
   2671 #endif

And the version in Red Hat Enterprise Linux 7 calls gzdirect (because zlib is newer than the version check), so it lacks the crashing strncmp call.

Comment 6 Ehteshaam 2017-11-27 07:31:33 UTC
I see 2 copies. One is installed and one is shipped from central repository.

[XXXX@XXX-XXXX-XXX-XXX ~]$ sudo rpm -qa | grep libxml2
libxml2-2.9.1-6.el7_2.3.x86_64
libxml2-python-2.9.1-6.el7_2.3.x86_64


[XXXX@XXX-XXXX-XXX-XXX ~]$ find /opt/monitor/ -name *libxml* | grep libxml*$
/opt/monitor/os/linux/i686/include/libxml2/libxml
/opt/monitor/os/linux/x86_64/include/libxml2/libxml

Comment 7 Florian Weimer 2017-11-27 09:37:33 UTC
It seems that the application is overriding a system library.  If you need further help, please contact the software vendor, or open a support case, as explained in comment 2.

Comment 8 Ehteshaam 2017-11-27 14:31:44 UTC
Thanks Florian.

Do you suspect it has anything to do with following change ?

Bug 1292230 - ld doesn't resolve symbols in linked to library

Comment 9 Florian Weimer 2017-11-27 15:56:17 UTC
Bug 1292230 is a link editor bug, so if you haven't recompiled/relinked the binaries, it can't be the cause for the behavioral change.


Note You need to log in before you can comment on or make changes to this bug.