Bug 481453 - dellWirelessCtl segfault error 4 in _ctypes.so
dellWirelessCtl segfault error 4 in _ctypes.so
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: libsmbios (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Michael E Brown
Fedora Extras Quality Assurance
http://www.smolts.org/client/show/pub...
: Reopened
Depends On: 488396
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-24 21:33 EST by Jerry Amundson
Modified: 2018-04-11 12:35 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-11-08 16:24:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
stderr.txt (latD600) (3.37 MB, text/plain)
2009-02-05 02:10 EST, Jerry Amundson
no flags Details
stdout.txt (latD600) (170 bytes, text/plain)
2009-02-05 02:12 EST, Jerry Amundson
no flags Details
selinux alert description (2.47 KB, text/plain)
2009-02-13 20:13 EST, Josh Stone
no flags Details

  None (edit)
Description Jerry Amundson 2009-01-24 21:33:25 EST
Description of problem:
Continuous messages - dellWirelessCtl[12767]: segfault at 5f5f2720 i
p 00880201 sp bfa31f10 error 4 in _ctypes.so[874000+18000]

Version-Release number of selected component (if applicable):
smbios-utils-python-2.2.8-1.fc11.i386

How reproducible:
easily.

Steps to Reproduce:
1.check messages
2.
3.
  
Actual results:
error

Expected results:
no error

Additional info:
Dell D600 laptop.
Comment 1 Jerry Amundson 2009-01-25 16:36:26 EST
Lines from messages which may be symptoms, or tie into dbus, et al...

Jan 25 15:19:47 localhost kernel: dellWirelessCtl[7030]: segfault at 5f5f2720 ip 00d06201 sp bf8ff5d0 error 4 in _ctypes.so[cfa000+18000]
Jan 25 15:19:47 localhost NetworkManager: <WARN>  killswitch_getpower_reply(): Error getting killswitch power: /usr/lib/hal/scripts/linux/hal-system-killswitch-get-power-linux: line 112:  7030 Segmentation fault      $DELL_WCTL --st_wlan #012 org.freedesktop.Hal.Device.KillSwitch.NotSupported.
Jan 25 15:19:48 localhost dbus: Would reject message, 1 matched rules; type="method_call", sender=":1.33" (uid=500 pid=3064 comm="/usr/bin/python /usr/bin/guidance-power-manager ") interface="org.freedesktop.Hal.Device.CPUFreq" member="GetCPUFreqGovernor" error name="(unset)" requested_reply=0 destination=":1.0" (uid=0 pid=1877 comm="hald "))
Jan 25 15:19:53 localhost kernel: dellWirelessCtl[7044]: segfault at 5f5f2720 ip 00253201 sp bffdecc0 error 4 in _ctypes.so[247000+18000]
Jan 25 15:19:53 localhost NetworkManager: <WARN>  killswitch_getpower_reply(): Error getting killswitch power: /usr/lib/hal/scripts/linux/hal-system-killswitch-get-power-linux: line 112:  7044 Segmentation fault      $DELL_WCTL --st_wlan #012 org.freedesktop.Hal.Device.KillSwitch.NotSupported.
Jan 25 15:19:53 localhost dbus: Would reject message, 1 matched rules; type="method_call", sender=":1.33" (uid=500 pid=3064 comm="/usr/bin/python /usr/bin/guidance-power-manager ") interface="org.freedesktop.Hal.Device.CPUFreq" member="GetCPUFreqGovernor" error name="(unset)" requested_reply=0 destination=":1.0" (uid=0 pid=1877 comm="hald "))
Jan 25 15:19:58 localhost dbus: Would reject message, 1 matched rules; type="method_call", sender=":1.33" (uid=500 pid=3064 comm="/usr/bin/python /usr/bin/guidance-power-manager ") interface="org.freedesktop.Hal.Device.CPUFreq" member="GetCPUFreqGovernor" error name="(unset)" requested_reply=0 destination=":1.0" (uid=0 pid=1877 comm="hald "))
Comment 2 Matěj Cepl 2009-02-04 09:59:23 EST
There is nothing to triage here.

Switching to ASSIGNED so that developers have responsibility to do whatever they want to do with it.
Comment 3 Jerry Amundson 2009-02-04 12:16:33 EST
Heh, because the messages file hadn't filled up / lately, I'd lost track of this one.
But logwatch tells me it's still around:
 ################### Logwatch 7.3.6 (05/19/07) #################### 
        Processing Initiated: Tue Feb  3 06:06:42 2009
        Date Range Processed: yesterday
                              ( 2009-Feb-02 )
                              Period is day.
      Detail Level of Output: 0
              Type of Output: unformatted
           Logfiles for Host: walnut
  ################################################################## 
 
 --------------------- Kernel Begin ------------------------ 

 WARNING:  Segmentation Faults in these executables
    dellWirelessCtl :  13983 Time(s)
Comment 4 Michael E Brown 2009-02-04 12:22:06 EST
Sorry, missed this defect with all the spam in my inbox :(

I suspect this may be related to the other defect you have open (dellsysidplugin). Can you attach the debugging info requested there (or to this bz#)

Thanks
Comment 5 Michael E Brown 2009-02-04 12:47:16 EST

One idea. The last segfault that I fixed was in version 2.2.7 and only happened
if the "dcdbas" kernel module was not installed.

Can you check lsmod to see if dcdbas is loaded? If not, try 'modprobe dcdbas'
to see if the problem goes away. If that is it, then I should be able to fix
the segfault. (I've tested locally, and dellWirelessCtl works for me with
dcdbas loaded, and gives a reasonable error message if dcdbas is not loaded.)

Regardless of the above, the following should help me track down the error if
it is still segfaulting:

LIBSMBIOS_C_DEBUG_OUTPUT_ALL=1 dellWirelessCtl --st_wlan > stdout.txt
2>stderr.txt

Thanks
Comment 6 Jerry Amundson 2009-02-05 02:10:52 EST
Created attachment 330965 [details]
stderr.txt (latD600)

dcdbas is loaded at the time of command:
[root@walnut tmp]# LIBSMBIOS_C_DEBUG_OUTPUT_ALL=1 dellWirelessCtl --st_wlan > stdout.txt 2>stderr.txt
[root@walnut tmp]# lsmod | grep dcd
dcdbas                  6720  0
Comment 7 Jerry Amundson 2009-02-05 02:12:16 EST
Created attachment 330966 [details]
stdout.txt (latD600)
Comment 8 Michael E Brown 2009-02-05 13:46:30 EST
This doesnt appear to be segfaulting. Can you confirm that dellWirelessCtl no longer segfaults? If so, I think we can close this bug.
Comment 9 Jerry Amundson 2009-02-05 14:02:40 EST
True, the command above didn't segfault, but the kernel errors continue:

Feb  5 12:58:38 localhost kernel: dellWirelessCtl[25431]: segfault at 5f5f2720 ip
 00861201 sp bfa096e0 error 4 in _ctypes.so[855000+18000]
Feb  5 12:58:38 localhost NetworkManager: <WARN>  killswitch_getpower_reply(): 
Error getting killswitch power: /usr/lib/hal/scripts/linux/hal-system-killswitch-
get-power-linux: line 112: 25431 Segmentation fault      $DELL_WCTL --st_wlan 
#012 org.freedesktop.Hal.Device.KillSwitch.NotSupported.
Feb  5 12:58:41 localhost dbus: Would reject message, 1 matched rules; 
type="method_call", sender=":1.31" (uid=500 pid=2603 comm="/usr/bin/python 
/usr/bin/guidance-power-manager ") interface="org.freedesktop.Hal.Device.CPUFreq"
 member="GetCPUFreqGovernor" error name="(unset)" requested_reply=0 
destination=":1.0" (uid=0 pid=1897 comm="hald "))
Feb  5 12:58:44 localhost kernel: dellWirelessCtl[25435]: segfault at 5f5f2720 ip 
00c86201 sp bfef6bd0 error 4 in _ctypes.so[c7a000+18000]
Feb  5 12:58:44 localhost NetworkManager: <WARN>  killswitch_getpower_reply(): 
Error getting killswitch power: /usr/lib/hal/scripts/linux/hal-system-killswitch-
get-power-linux: line 112: 25435 Segmentation fault      $DELL_WCTL --st_wlan 
#012 org.freedesktop.Hal.Device.KillSwitch.NotSupported.
Feb  5 12:58:46 localhost dbus: Would reject message, 1 matched rules; 
type="method_call", sender=":1.31" (uid=500 pid=2603 comm="/usr/bin/python 
/usr/bin/guidance-power-manager ") interface="org.freedesktop.Hal.Device.CPUFreq"
 member="GetCPUFreqGovernor" error name="(unset)" requested_reply=0 
destination=":1.0" (uid=0 pid=1897 comm="hald "))
Comment 10 Michael E Brown 2009-02-05 18:40:32 EST
Ok, so another idea.

At the top of /usr/lib64/hal/scripts/linux/hal-system-killswitch-set-power-linux

add an "export LIBSMBIOS_C_DEBUG_OUTPUT_ALL=1"

And then on each of the $DELL_WCTL calls add an "> /tmp/logfile.txt 2>&1"

And see if it still segfaults. And if it still does, the data I need should be in /tmp/logfile.txt. 

The other option is to figure out a way to get dellWirelessCtl to segfault when running from the cmdline.
Comment 11 Jerry Amundson 2009-02-08 00:48:53 EST
Redireected output of both stdin and stdout from within /usr/lib/hal/scripts/linux/hal-system-killswitch-get-power-linux just create empty files.
Comment 12 Josh Stone 2009-02-13 20:13:08 EST
Created attachment 331889 [details]
selinux alert description

I am also seeing this segfault, and I think it's an selinux policy problem.  I'm attaching the alert log from my system in hopes that it helps identify the core issue.

When I put selinux in permissive mode, then the dellWirelessCtl segfaults go away.  I still get the alerts, but much less frequently.
Comment 13 Michael E Brown 2009-02-17 10:04:23 EST
re-assigning to selinux-policy component so that somebody in selinux can take a look at this.

Libsmbios does not itself do anything to require executable memory that I know of, so I expect that this bug is likely something to do with python or ctypes.
Comment 14 Daniel Walsh 2009-02-17 12:06:13 EST
This is not an SELInux issue.

dellWirelessCtl or one of the libraries it is using is trying to set memory both writable and executable.

Does this use assembly code?
Comment 15 Michael E Brown 2009-02-17 13:28:58 EST
Nothing in any of the code paths executed here do any assembly. There is nothing in libsmbios that does anything with anything that would require execmem.

I suspect it may be something in the python ctypes module. The dellWirelessCtl program is a python script that uses python ctypes to run code from libsmbios.so.1.
Comment 16 Michael E Brown 2009-02-17 16:20:37 EST
This might be related to this bug:

https://bugzilla.redhat.com/show_bug.cgi?id=251637
Comment 17 Daniel Walsh 2009-02-18 11:20:50 EST
Looks promising.
Comment 18 Christian Joensson 2009-02-18 14:37:39 EST
fwiw, I get something similar...

Feb 18 20:35:47 c640 setroubleshoot: SELinux is preventing dellWirelessCtl (hald_t) "execmem" hald_t. For complete SELinux messages. run sealert -l fbd6c3be-617e-4a62-8d87-13dbb81da8c1
Feb 18 20:35:51 c640 kernel: dellWirelessCtl[5689]: segfault at 5f5f2720 ip 002e4201 sp bfb017e0 error 4 in _ctypes.so[2d8000+18000]

this is on current rawhide...and it's a Dell Latitude C640
Comment 19 Jared Smith 2009-02-21 09:27:45 EST
I see the same problem (segfault + SELinux alert) on a Dell Latitude D600 on the latest Rawhide, and I'm happy to help troubleshoot the problem if needed.
Comment 20 Christian Joensson 2009-02-22 01:56:41 EST
it might be interesting, or irrelevant, but here's what I get 

[root@c640 ~]# sealert -l fbd6c3be-617e-4a62-8d87-13dbb81da8c1

Summary:

SELinux is preventing dellWirelessCtl (hald_t) "execmem" hald_t.

Detailed Description:

SELinux denied access requested by dellWirelessCtl. It is not expected that this
access is required by dellWirelessCtl and this access may signal an intrusion
attempt. It is also possible that the specific version or configuration of the
application is causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                system_u:system_r:hald_t:s0
Target Context                system_u:system_r:hald_t:s0
Target Objects                None [ process ]
Source                        dellWirelessCtl
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          c640.lucky.net
Source RPM Packages           python-2.6-4.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.6-5.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     c640.lucky.net
Platform                      Linux c640.lucky.net
                              2.6.29-0.137.rc5.git4.fc11.i586 #1 SMP Thu Feb 19
                              21:02:06 EST 2009 i686 i686
Alert Count                   42549
First Seen                    Sat Feb 14 08:35:21 2009
Last Seen                     Sun Feb 22 07:54:56 2009
Local ID                      fbd6c3be-617e-4a62-8d87-13dbb81da8c1
Line Numbers                  

Raw Audit Messages            

node=c640.lucky.net type=AVC msg=audit(1235285696.311:448): avc:  denied  { execmem } for  pid=5581 comm="dellWirelessCtl" scontext=system_u:system_r:hald_t:s0 tcontext=system_u:system_r:hald_t:s0 tclass=process

node=c640.lucky.net type=SYSCALL msg=audit(1235285696.311:448): arch=40000003 syscall=192 success=no exit=-13 a0=0 a1=ff0 a2=7 a3=22 items=0 ppid=5578 pid=5581 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="dellWirelessCtl" exe="/usr/bin/python" subj=system_u:system_r:hald_t:s0 key=(null)

Note that it was *first seem Sat Feb 14* as stated above, and note also that the system was initiated on Feb 10.
Comment 21 pgaltieri 2009-02-25 23:52:24 EST
I get these messages during boot.  To work around the problem I had to use the ctl-alt-F? keys to login and turn off network manager.  I then had to go edit the ifcfg-eth0 (my wired interface) and add in the ONBOOT, BOOTPROTO, NM_CONTROLLED and TYPE entries by hand.  After I rebooted the problem did no occur.

My system is a Dell Inspiron 8600 which has both a wired and a wireless interface and Network Manager does not seem to be smart enough to only bring up the wired interface not both.

After all this my system is still fairly useless since gdm fails to start.
Comment 22 Jerry Amundson 2009-02-26 23:51:43 EST
(In reply to comment #21)
> I get these messages during boot.  To work around the problem I had to use the
> ctl-alt-F? keys to login and turn off network manager.  I then had to go edit
> the ifcfg-eth0 (my wired interface) and add in the ONBOOT, BOOTPROTO,
> NM_CONTROLLED and TYPE entries by hand.  After I rebooted the problem did no
> occur.

And you set those variables to what?
Also, please check /var/log/messages, as the boot message may go away, but I fail to see how the above prevents the actual problem.
Comment 23 pgaltieri 2009-02-27 13:06:44 EST
Here's the ifcfg-eth0 file

# Broadcom Corporation BCM4401 100Base-T
DEVICE=eth0
HWADDR=00:0d:56:36:eb:13
ONBOOT=yes
BOOTPROTO=dhcp
NM_CONTROLLED=no
TYPE=Ethernet

The other interface eth1

# Intel Corporation PRO/Wireless LAN 2100 3B Mini PCI Adapter
DEVICE=eth1
HWADDR=00:04:23:6a:8e:1b


The reason it stops the problem from occurring is because Network Manager is no longer responsible for bringing up my network interfaces. When NM starts up it tries to bring up both my wired and my wireless interfaces. With NM disabled, and going back to the old way of starting/stopping interfaces via ifup/ifdown, the wireless interface no longer starts up so no more problem. As long as NM was trying to bring up the wireless interface the messages would continue to get displayed.  Now only the wired interface is started.
Comment 24 Jerry Amundson 2009-03-06 00:11:48 EST
Neat. I've re-installed this machine from scratch (F10 CD's, then to rawhide via yum). Now, I can't reproduce this bug. Requesting help from those cc'd that can. Maybe between us we can figure out the difference - recent rawhide updates, selinux restorecon (which I've done on this system), /.autorelabel, or whatever.

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 25 Christian Joensson 2009-03-10 16:08:21 EDT
FWIW, it works for me again now, no failures like this...
Comment 26 Matěj Cepl 2009-03-10 18:42:31 EDT
Closing this now as RAWHIDE. Please, anybody, if you are able to reproduce this, please reopen with additional information.

Thank you
Comment 27 Adam Goode 2009-03-16 22:09:48 EDT
Yes, I can reproduce this on rawhide.

 $ dellWirelessCtl 
Traceback (most recent call last):
  File "/usr/bin/dellWirelessCtl", line 32, in <module>
    import cli
  File "/usr/share/smbios-utils/cli.py", line 7, in <module>
    from libsmbios_c import memory, smi, cmos, pkgconfdir, localedir, GETTEXT_PACKAGE
  File "/usr/lib/python2.6/site-packages/libsmbios_c/__init__.py", line 9, in <module>
    import ctypes
  File "/usr/lib64/python2.6/ctypes/__init__.py", line 546, in <module>
    CFUNCTYPE(c_int)(lambda: None)
MemoryError



Also see bug #488396.
Comment 28 Bug Zapper 2009-06-09 06:53:04 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 29 Matěj Cepl 2009-11-05 13:21:34 EST
Since this bugzilla report was filed, there have been several major updates in various components of the Xorg system, which may have resolved this issue. Users who have experienced this problem are encouraged to upgrade their system to the latest version of their packages. For packages from updates-testing repository you can use command

yum upgrade --enablerepo='*-updates-testing'

Alternatively, you can also try to test whether this bug is reproducible with the upcoming Fedora 12 distribution by downloading LiveMedia of F12 Beta available at http://alt.fedoraproject.org/pub/alt/nightly-composes/ . By using that you get all the latest packages without need to install anything on your computer. For more information on using LiveMedia take a look at https://fedoraproject.org/wiki/FedoraLiveCD .

Please, if you experience this problem on the up-to-date system, let us now in the comment for this bug, or whether the upgraded system works for you.

If you won't be able to reply in one month, I will have to close this bug as INSUFFICIENT_DATA. Thank you.

[This is a bulk message for all open Fedora Rawhide Xorg-related bugs. I'm adding myself to the CC list for each bug, so I'll see any comments you make after this and do my best to make sure every issue gets proper attention.]
Comment 30 Jerry Amundson 2009-11-05 15:49:23 EST
I can no longer reproduce this on either fc11 or fc12 (rawhide).
Comment 31 Matěj Cepl 2009-11-08 16:24:48 EST
Thank you for letting us know.

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