Bug 113766 - yast segfaults, cause it accesses the udev database files directly
Summary: yast segfaults, cause it accesses the udev database files directly
Status: RESOLVED FIXED
: 115136 (view as bug list)
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: unspecified
Hardware: Other All
: P5 - None : Major
Target Milestone: ---
Assignee: Steffen Winterfeldt
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-29 08:54 UTC by Kay Sievers
Modified: 2005-09-05 08:05 UTC (History)
1 user (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kay Sievers 2005-08-29 08:54:20 UTC
Yast segfaults, cause it reads the private udev database without
the udev tools. That format has changed in a recent version. This udev version
is not submitted to autobuild until now. If you can't fix yast, we will need
to work around it for 10.0. But please never access these files directly, they
can change at any time to any format.

sbin/yast: line 207:  5217 Segmentation fault      $ybindir/y2base menu ncurses

#0  0x417bb8f4 in read_udevinfo () from
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../libhd.so.11                        
          │
#1  0x417c9192 in hd_scan_int () from
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../libhd.so.11                        
            │
#2  0x417bc061 in hd_scan () from
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../libhd.so.11                        
                │
#3  0x417bd6df in hd_list () from
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../libhd.so.11                        
                │
#4  0x41686a9b in HwProbe::checkPath () from
/usr/lib/YaST2/plugin/libpy2ag_hwprobe.so.2                                    
     │
#5  0x41688456 in HwProbe::Read () from
/usr/lib/YaST2/plugin/libpy2ag_hwprobe.so.2                                    
          │
Comment 1 Steffen Winterfeldt 2005-08-29 09:37:51 UTC
Yeah, well, the point is that 'udevinfo -d' of old times changed its output 
format and I figured if that's not stable I can as well read the db directly. 
 
I'm not aware of an official way to dump the db. 
 
Anyway libhd should not segfault even if the format changes. 
 
If you plan to submit it for beta-4 (aka today), then give me a test version 
before so I can fix libhd. 
Comment 2 Kay Sievers 2005-08-29 09:50:34 UTC
No, I will not submit it today. Probably during this week, but I can hold back
the db changes if needed. Not segfaulting would be good enough for now. :)

What information does yast need from udev? We can just add a "dump" and keep
it stable. The dump at this time is a private feature of HAL, that changes
the time we change the way HAL interacts with udev.
Comment 3 Kay Sievers 2005-08-29 10:07:38 UTC
Removing the first line "P:<devpath>" from a dbfile causes yast to segfault.
Comment 4 Steffen Winterfeldt 2005-08-29 10:29:16 UTC
Unless you submit it until 16:00 UT today (aka in time for ß4), it's not 
critical. I can look at it tomorrow, then. 
 
Hm, the 'P' line was seen as the start of a new entry. 
 
Anyway, what yast uses (if anything) is the the list of names udev 
creates for a device. But I'll have to check the code first. 
 
Can you give me such a brand new udev package? 
Comment 5 Kay Sievers 2005-08-29 10:40:19 UTC
No, it will not be submitted today, but fixing it during this week would be nice.

The new udev is not released until now or packaged. I can send only a snapshot
if you want, but I think we should rater add a sane "dump" instead and make
yast use this instead of the db files - will look into it now...

But note that udev does not store anything, if there is no custom information
for a device. Recent udev versions store on a usual box only 40 db files
for the 700 device nodes. Only if custom names or additional symlinks are
created, udev will write a db file cause it needs this information for the
"remove" event.
Comment 6 Steffen Winterfeldt 2005-08-29 10:52:25 UTC
That is actually great. It would be even better if someone would remove 
all those old 709 udev db entries during an update. :-) 
Comment 7 Kay Sievers 2005-08-29 11:03:11 UTC
Hmm, you are not on tmpfs with /dev (mounted from initramfs)?
That's the default for 10.0 and the db should not survive a reboot.
Comment 8 Steffen Winterfeldt 2005-08-29 11:48:46 UTC
No, seems not to be done for updated systems. 
Comment 9 Kay Sievers 2005-08-29 12:00:48 UTC
Hmm weird, you have 700 db files after a reboot with beta3 and a SUSE kernel?

How about a dump in this format, it will print the database content
for all devices with one invokation of udevinfo:

P: /block/hda/hda3
N: hda3
S: disk/by-id/ata-HTS726060M9AT00_MRH401M4G6UM9B-part3
S: disk/by-path/pci-0000:00:1f.1-ide-0:0-part3
S: disk/by-uuid/2E08712B0870F2E7
S: disk/by-label/XP
E: ID_TYPE=disk
E: ID_MODEL=HTS726060M9AT00
E: ID_SERIAL=MRH401M4G6UM9B
E: ID_REVISION=MH4OA6BA
E: ID_BUS=ata
E: ID_PATH=pci-0000:00:1f.1-ide-0:0
E: ID_FS_USAGE=filesystem
E: ID_FS_TYPE=ntfs
E: ID_FS_VERSION=3.1
E: ID_FS_UUID=2E08712B0870F2E7
E: ID_FS_LABEL=XP
E: ID_FS_LABEL_SAFE=XP

P: /block/hdc
N: hdc
S: dvdram
S: cdrom
S: dvd
S: cdrecorder
S: disk/by-path/pci-0000:00:1f.1-ide-1:0
E: ID_TYPE=cd
E: ID_MODEL=MATSHITADVD-RAM_UJ-811
E: ID_SERIAL=
E: ID_REVISION=H102
E: ID_BUS=ata
E: ID_PATH=pci-0000:00:1f.1-ide-1:0

P: /class/input/event0
N: input/event0

P: /class/input/event1
N: input/event1

P: /class/input/event2
N: input/event2

P: /class/input/event3
N: input/event3

...
Comment 10 Steffen Winterfeldt 2005-08-29 12:33:51 UTC
Yes. 
 
The format looks fine. 
Comment 11 Kay Sievers 2005-08-29 13:19:16 UTC
Here is a version with the segfault causing db and the export: "udevinfo -e":
  /work/built/mbuild/pomegranate-kasievers-115
Comment 12 Steffen Winterfeldt 2005-08-30 13:34:09 UTC
segfault fixed  
Comment 13 Steffen Winterfeldt 2005-08-30 13:48:40 UTC
using 'udevinfo -e' now 
Comment 14 Steffen Winterfeldt 2005-08-30 14:33:56 UTC
On a side note: I assume that N & S entries refer to something below /dev. 
So network interfaces will not appear in udevinfo, or not? 
Comment 15 Kay Sievers 2005-08-30 14:48:09 UTC
udev does not keep a state of network interfaces. the names can change at any
time. SUSE does not use udev ro rename netifs. yes, N and S are only for /dev
nodes.
Comment 16 Steffen Winterfeldt 2005-09-05 08:05:25 UTC
*** Bug 115136 has been marked as a duplicate of this bug. ***