public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* scsi_id segfault with udev-009
@ 2003-12-17 17:29 Martin Schlemmer
  2003-12-17 18:07 ` Greg KH
  2003-12-17 18:17 ` Daniel Stekloff
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Schlemmer @ 2003-12-17 17:29 UTC (permalink / raw)
  To: Linux Kernel Mailing Lists; +Cc: Greg KH

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

Hi

Getting this with scsi_id and udev-009:

--
Starting program:
/space/var/tmp/portage/udev-009/work/udev-009/extras/scsi_id/scsi_id -p
0x80 -s /block/sdb
 
Program received signal SIGSEGV, Segmentation fault.
0x080499c5 in sysfs_get_attr (dev=0x80d2d68, attr=0x80b559c "dev") at
scsi_id.h:45
45              return
sysfs_get_value_from_attributes(dev->directory->attributes,
(gdb) k
Kill the program being debugged? (y or n) y
(gdb) run -p 0x83 -s /block/sdb
Starting program:
/space/var/tmp/portage/udev-009/work/udev-009/extras/scsi_id/scsi_id -p
0x83 -s /block/sdb
 
Program received signal SIGSEGV, Segmentation fault.
0x080499c5 in sysfs_get_attr (dev=0x80d2d68, attr=0x80b559c "dev") at
scsi_id.h:45
45              return
sysfs_get_value_from_attributes(dev->directory->attributes,
(gdb) q
--

I cannot see why to be honest.


Thanks,

-- 

Martin Schlemmer
Gentoo Linux Developer, Desktop/System Team Developer
Cape Town, South Africa



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: scsi_id segfault with udev-009
  2003-12-17 17:29 scsi_id segfault with udev-009 Martin Schlemmer
@ 2003-12-17 18:07 ` Greg KH
  2003-12-17 18:17 ` Daniel Stekloff
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2003-12-17 18:07 UTC (permalink / raw)
  To: Martin Schlemmer, dsteklof, patmans; +Cc: Linux Kernel Mailing Lists

On Wed, Dec 17, 2003 at 07:29:58PM +0200, Martin Schlemmer wrote:
> Hi
> 
> Getting this with scsi_id and udev-009:
> 
> --
> Starting program:
> /space/var/tmp/portage/udev-009/work/udev-009/extras/scsi_id/scsi_id -p
> 0x80 -s /block/sdb
>  
> Program received signal SIGSEGV, Segmentation fault.
> 0x080499c5 in sysfs_get_attr (dev=0x80d2d68, attr=0x80b559c "dev") at
> scsi_id.h:45
> 45              return
> sysfs_get_value_from_attributes(dev->directory->attributes,
> (gdb) k
> Kill the program being debugged? (y or n) y

Yeah, I bet this is due to the libsysfs change that is now in udev.  If
I get a chance, I'll look into it.  Unless Pat or Dan beats me to it...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: scsi_id segfault with udev-009
  2003-12-17 17:29 scsi_id segfault with udev-009 Martin Schlemmer
  2003-12-17 18:07 ` Greg KH
@ 2003-12-17 18:17 ` Daniel Stekloff
  2003-12-17 19:40   ` Martin Schlemmer
  2003-12-18  0:36   ` Greg KH
  1 sibling, 2 replies; 7+ messages in thread
From: Daniel Stekloff @ 2003-12-17 18:17 UTC (permalink / raw)
  To: azarah, Linux Kernel Mailing Lists; +Cc: Greg KH

On Wednesday 17 December 2003 09:29 am, Martin Schlemmer wrote:
> Hi
>
> Getting this with scsi_id and udev-009:


Hi,

Scsi_id hasn't been changed to use the latest libsysfs changes. The 
"directory" in the sysfs_class_device is now considered "private" and only 
should be accessed using functions. Treating the structures as handles lets 
us only load information when it's needed, reducing caching or stale 
information and also helping performance. 

Here's the problem.

static inline char *sysfs_get_attr(struct sysfs_class_device *dev,
                                    const char *attr)
{
        return sysfs_get_value_from_attributes(dev->directory->attributes,
                                               attr);
}

Please try this quick fix:

--- udev/extras/scsi_id/scsi_id.h	2003-12-08 01:42:46.000000000 -0800
+++ udev-fix/extras/scsi_id/scsi_id.h	2003-12-17 09:52:31.032184768 -0800
@@ -42,8 +42,14 @@
 static inline char *sysfs_get_attr(struct sysfs_class_device *dev,
 				    const char *attr)
 {
-	return sysfs_get_value_from_attributes(dev->directory->attributes,
-					       attr);
+	struct dlist *attributes = NULL;
+
+	attributes = sysfs_get_classdev_attributes(dev);
+
+	if (attributes == NULL)
+		return NULL;
+
+	return sysfs_get_value_from_attributes(attributes, attr);
 }
 
 extern int scsi_get_serial (struct sysfs_class_device *scsi_dev,
--- udev/extras/scsi_id/scsi_id.c	2003-12-08 01:42:46.000000000 -0800
+++ udev-fix/extras/scsi_id/scsi_id.c	2003-12-17 09:55:54.113311744 -0800
@@ -133,7 +133,7 @@
 		return -1;
 
 	snprintf(bus_dev_name, MAX_NAME_LEN, "%s/%s/%s/%s/%s", sysfs_mnt_path,
-		 SYSFS_BUS_DIR, bus, SYSFS_DEVICES_NAME, bus_id);
+		 SYSFS_BUS_NAME, bus, SYSFS_DEVICES_NAME, bus_id);
 
 	if (stat(sysfs_path, &stat_buf))
 		return -1;


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: scsi_id segfault with udev-009
  2003-12-17 18:17 ` Daniel Stekloff
@ 2003-12-17 19:40   ` Martin Schlemmer
  2003-12-17 19:43     ` Daniel Stekloff
  2003-12-18  0:36   ` Greg KH
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Schlemmer @ 2003-12-17 19:40 UTC (permalink / raw)
  To: Daniel Stekloff; +Cc: Linux Kernel Mailing Lists, Greg KH

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

On Wed, 2003-12-17 at 20:17, Daniel Stekloff wrote:
> On Wednesday 17 December 2003 09:29 am, Martin Schlemmer wrote:
> > Hi
> >
> > Getting this with scsi_id and udev-009:
> 
> 
> Hi,
> 
> Scsi_id hasn't been changed to use the latest libsysfs changes. The 
> "directory" in the sysfs_class_device is now considered "private" and only 
> should be accessed using functions. Treating the structures as handles lets 
> us only load information when it's needed, reducing caching or stale 
> information and also helping performance. 
> 
> Here's the problem.
> 
> static inline char *sysfs_get_attr(struct sysfs_class_device *dev,
>                                     const char *attr)
> {
>         return sysfs_get_value_from_attributes(dev->directory->attributes,
>                                                attr);
> }
> 
> Please try this quick fix:
> 

Yep, that fixes it, thanks.  Btw, any reason it wont actually display
anything ?


Thanks,

-- 

Martin Schlemmer
Gentoo Linux Developer, Desktop/System Team Developer
Cape Town, South Africa



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: scsi_id segfault with udev-009
  2003-12-17 19:40   ` Martin Schlemmer
@ 2003-12-17 19:43     ` Daniel Stekloff
  2003-12-17 21:09       ` Martin Schlemmer
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Stekloff @ 2003-12-17 19:43 UTC (permalink / raw)
  To: azarah; +Cc: Linux Kernel Mailing Lists, Greg KH, patmans

On Wednesday 17 December 2003 11:40 am, Martin Schlemmer wrote:
> On Wed, 2003-12-17 at 20:17, Daniel Stekloff wrote:
> > On Wednesday 17 December 2003 09:29 am, Martin Schlemmer wrote:
> > > Hi
> > >
> > > Getting this with scsi_id and udev-009:
> >
> > Hi,
> >
> > Scsi_id hasn't been changed to use the latest libsysfs changes. The
> > "directory" in the sysfs_class_device is now considered "private" and
> > only should be accessed using functions. Treating the structures as
> > handles lets us only load information when it's needed, reducing caching
> > or stale information and also helping performance.
> >
> > Here's the problem.
> >
> > static inline char *sysfs_get_attr(struct sysfs_class_device *dev,
> >                                     const char *attr)
> > {
> >         return
> > sysfs_get_value_from_attributes(dev->directory->attributes, attr);
> > }
> >
> > Please try this quick fix:
>
> Yep, that fixes it, thanks.  Btw, any reason it wont actually display
> anything ?
>
>
> Thanks,


Sorry, what won't display anything? Do you mean scsi_id or the fix? 

Thanks,

Dan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: scsi_id segfault with udev-009
  2003-12-17 19:43     ` Daniel Stekloff
@ 2003-12-17 21:09       ` Martin Schlemmer
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Schlemmer @ 2003-12-17 21:09 UTC (permalink / raw)
  To: Daniel Stekloff; +Cc: Linux Kernel Mailing Lists, Greg KH, patmans

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

On Wed, 2003-12-17 at 21:43, Daniel Stekloff wrote:

> > Yep, that fixes it, thanks.  Btw, any reason it wont actually display
> > anything ?
> >
> >
> > Thanks,
> 
> 
> Sorry, what won't display anything? Do you mean scsi_id or the fix? 
> 

Nevermind :D

-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: scsi_id segfault with udev-009
  2003-12-17 18:17 ` Daniel Stekloff
  2003-12-17 19:40   ` Martin Schlemmer
@ 2003-12-18  0:36   ` Greg KH
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2003-12-18  0:36 UTC (permalink / raw)
  To: Daniel Stekloff; +Cc: azarah, Linux Kernel Mailing Lists

On Wed, Dec 17, 2003 at 10:17:28AM -0800, Daniel Stekloff wrote:
> 
> Please try this quick fix:

I've applied this, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-18  0:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-17 17:29 scsi_id segfault with udev-009 Martin Schlemmer
2003-12-17 18:07 ` Greg KH
2003-12-17 18:17 ` Daniel Stekloff
2003-12-17 19:40   ` Martin Schlemmer
2003-12-17 19:43     ` Daniel Stekloff
2003-12-17 21:09       ` Martin Schlemmer
2003-12-18  0:36   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox