* segfault in sparse snapshot 2010-02-13 @ 2010-03-24 17:41 Randy Dunlap 2010-03-24 19:36 ` Josh Triplett 0 siblings, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2010-03-24 17:41 UTC (permalink / raw) To: linux-sparse (snapshot from Dave Jones: http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in Linus's mainline kernel tree) The last messages are: net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) net/bridge/br_fdb.c:225:9: left side has type bad type net/bridge/br_fdb.c:225:9: right side has type int net/bridge/br_fdb.c:225:9: error: cannot dereference this type /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c make[3]: *** [net/bridge/br_fdb.o] Error 139 --- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-24 17:41 segfault in sparse snapshot 2010-02-13 Randy Dunlap @ 2010-03-24 19:36 ` Josh Triplett [not found] ` <4BAA6C4C.8010103@xenotime.net> 0 siblings, 1 reply; 13+ messages in thread From: Josh Triplett @ 2010-03-24 19:36 UTC (permalink / raw) To: Randy Dunlap; +Cc: linux-sparse On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: > (snapshot from Dave Jones: > http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) > > > In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), > sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in > Linus's mainline kernel tree) > > > The last messages are: > > net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge > net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) > net/bridge/br_fdb.c:225:9: left side has type bad type > net/bridge/br_fdb.c:225:9: right side has type int > net/bridge/br_fdb.c:225:9: error: cannot dereference this type > /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-arg s -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe- > larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c > make[3]: *** [net/bridge/br_fdb.o] Error 139 Ouch. Can you attach a preprocessed source .i file that reproduces the problem? "make net/bridge/br_fdb.i" should work. - Josh Triplett ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <4BAA6C4C.8010103@xenotime.net>]
* Re: segfault in sparse snapshot 2010-02-13 [not found] ` <4BAA6C4C.8010103@xenotime.net> @ 2010-03-24 20:34 ` Josh Triplett 2010-03-24 21:01 ` Randy Dunlap 2010-03-25 10:49 ` Dan Carpenter 0 siblings, 2 replies; 13+ messages in thread From: Josh Triplett @ 2010-03-24 20:34 UTC (permalink / raw) To: Randy Dunlap; +Cc: linux-sparse On Wed, Mar 24, 2010 at 12:47:24PM -0700, Randy Dunlap wrote: > On 03/24/10 12:36, Josh Triplett wrote: > > On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: > >> (snapshot from Dave Jones: > >> http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) > >> > >> > >> In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), > >> sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in > >> Linus's mainline kernel tree) > >> > >> > >> The last messages are: > >> > >> net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge > >> net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) > >> net/bridge/br_fdb.c:225:9: left side has type bad type > >> net/bridge/br_fdb.c:225:9: right side has type int > >> net/bridge/br_fdb.c:225:9: error: cannot dereference this type > >> /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing- args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wfra > me- > >> larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c > >> make[3]: *** [net/bridge/br_fdb.o] Error 139 > > > > Ouch. > > > > Can you attach a preprocessed source .i file that reproduces the > > problem? "make net/bridge/br_fdb.i" should work. > > Sure, attached. I tried to reproduce this segfault with this file and current Sparse from Git, and couldn't seem to reproduce it. I tried the posted command line and many variations on it. I had to explicitly drop -Wall or add -Wno-shadow to get the code to pass Sparse, due to a pile of warnings about ______f and ______r. Apart from that, I didn't see any issue. - Josh Triplett ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-24 20:34 ` Josh Triplett @ 2010-03-24 21:01 ` Randy Dunlap 2010-03-24 22:00 ` Josh Triplett 2010-03-25 10:49 ` Dan Carpenter 1 sibling, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2010-03-24 21:01 UTC (permalink / raw) To: Josh Triplett; +Cc: linux-sparse On 03/24/10 13:34, Josh Triplett wrote: > On Wed, Mar 24, 2010 at 12:47:24PM -0700, Randy Dunlap wrote: >> On 03/24/10 12:36, Josh Triplett wrote: >>> On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: >>>> (snapshot from Dave Jones: >>>> http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) >>>> >>>> >>>> In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), >>>> sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in >>>> Linus's mainline kernel tree) >>>> >>>> >>>> The last messages are: >>>> >>>> net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge >>>> net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) >>>> net/bridge/br_fdb.c:225:9: left side has type bad type >>>> net/bridge/br_fdb.c:225:9: right side has type int >>>> net/bridge/br_fdb.c:225:9: error: cannot dereference this type >>>> /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing- args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wf ra >> me- >>>> larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c >>>> make[3]: *** [net/bridge/br_fdb.o] Error 139 >>> >>> Ouch. >>> >>> Can you attach a preprocessed source .i file that reproduces the >>> problem? "make net/bridge/br_fdb.i" should work. >> >> Sure, attached. > > I tried to reproduce this segfault with this file and current Sparse > from Git, and couldn't seem to reproduce it. I tried the posted command > line and many variations on it. > > I had to explicitly drop -Wall or add -Wno-shadow to get the code to > pass Sparse, due to a pile of warnings about ______f and ______r. Apart > from that, I didn't see any issue. OK, maybe I'll blame it on gcc then. I cloned the current git tree and still have the sparse segfault... thanks for looking. -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-24 21:01 ` Randy Dunlap @ 2010-03-24 22:00 ` Josh Triplett 2010-03-24 22:02 ` Randy Dunlap 0 siblings, 1 reply; 13+ messages in thread From: Josh Triplett @ 2010-03-24 22:00 UTC (permalink / raw) To: Randy Dunlap; +Cc: linux-sparse On Wed, Mar 24, 2010 at 02:01:47PM -0700, Randy Dunlap wrote: > On 03/24/10 13:34, Josh Triplett wrote: > > On Wed, Mar 24, 2010 at 12:47:24PM -0700, Randy Dunlap wrote: > >> On 03/24/10 12:36, Josh Triplett wrote: > >>> On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: > >>>> (snapshot from Dave Jones: > >>>> http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) > >>>> > >>>> > >>>> In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), > >>>> sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in > >>>> Linus's mainline kernel tree) > >>>> > >>>> > >>>> The last messages are: > >>>> > >>>> net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge > >>>> net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) > >>>> net/bridge/br_fdb.c:225:9: left side has type bad type > >>>> net/bridge/br_fdb.c:225:9: right side has type int > >>>> net/bridge/br_fdb.c:225:9: error: cannot dereference this type > >>>> /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoin g-args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wf > ra > >> me- > >>>> larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c > >>>> make[3]: *** [net/bridge/br_fdb.o] Error 139 > >>> > >>> Ouch. > >>> > >>> Can you attach a preprocessed source .i file that reproduces the > >>> problem? "make net/bridge/br_fdb.i" should work. > >> > >> Sure, attached. > > > > I tried to reproduce this segfault with this file and current Sparse > > from Git, and couldn't seem to reproduce it. I tried the posted command > > line and many variations on it. > > > > I had to explicitly drop -Wall or add -Wno-shadow to get the code to > > pass Sparse, due to a pile of warnings about ______f and ______r. Apart > > from that, I didn't see any issue. > > OK, maybe I'll blame it on gcc then. I cloned the current git tree > and still have the sparse segfault... > > thanks for looking. Can you successfully reproduce the segfault with the .i file, or only as part of the kernel build? - Josh Triplett ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-24 22:00 ` Josh Triplett @ 2010-03-24 22:02 ` Randy Dunlap 0 siblings, 0 replies; 13+ messages in thread From: Randy Dunlap @ 2010-03-24 22:02 UTC (permalink / raw) To: Josh Triplett; +Cc: linux-sparse On 03/24/10 15:00, Josh Triplett wrote: > On Wed, Mar 24, 2010 at 02:01:47PM -0700, Randy Dunlap wrote: >> On 03/24/10 13:34, Josh Triplett wrote: >>> On Wed, Mar 24, 2010 at 12:47:24PM -0700, Randy Dunlap wrote: >>>> On 03/24/10 12:36, Josh Triplett wrote: >>>>> On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: >>>>>> (snapshot from Dave Jones: >>>>>> http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) >>>>>> >>>>>> >>>>>> In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), >>>>>> sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in >>>>>> Linus's mainline kernel tree) >>>>>> >>>>>> >>>>>> The last messages are: >>>>>> >>>>>> net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge >>>>>> net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) >>>>>> net/bridge/br_fdb.c:225:9: left side has type bad type >>>>>> net/bridge/br_fdb.c:225:9: right side has type int >>>>>> net/bridge/br_fdb.c:225:9: error: cannot dereference this type >>>>>> /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoin g-args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow - Wf >> ra >>>> me- >>>>>> larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c >>>>>> make[3]: *** [net/bridge/br_fdb.o] Error 139 >>>>> >>>>> Ouch. >>>>> >>>>> Can you attach a preprocessed source .i file that reproduces the >>>>> problem? "make net/bridge/br_fdb.i" should work. >>>> >>>> Sure, attached. >>> >>> I tried to reproduce this segfault with this file and current Sparse >>> from Git, and couldn't seem to reproduce it. I tried the posted command >>> line and many variations on it. >>> >>> I had to explicitly drop -Wall or add -Wno-shadow to get the code to >>> pass Sparse, due to a pile of warnings about ______f and ______r. Apart >>> from that, I didn't see any issue. >> >> OK, maybe I'll blame it on gcc then. I cloned the current git tree >> and still have the sparse segfault... >> >> thanks for looking. > > Can you successfully reproduce the segfault with the .i file, or only > as part of the kernel build? Only as part of the kernel build. -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-24 20:34 ` Josh Triplett 2010-03-24 21:01 ` Randy Dunlap @ 2010-03-25 10:49 ` Dan Carpenter 2010-03-25 15:46 ` Josh Triplett 1 sibling, 1 reply; 13+ messages in thread From: Dan Carpenter @ 2010-03-25 10:49 UTC (permalink / raw) To: Josh Triplett; +Cc: Randy Dunlap, linux-sparse On Wed, Mar 24, 2010 at 01:34:29PM -0700, Josh Triplett wrote: > On Wed, Mar 24, 2010 at 12:47:24PM -0700, Randy Dunlap wrote: > > On 03/24/10 12:36, Josh Triplett wrote: > > > On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: > > >> (snapshot from Dave Jones: > > >> http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) > > >> > > >> > > >> In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), > > >> sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in > > >> Linus's mainline kernel tree) > > >> > > >> > > >> The last messages are: > > >> > > >> net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge > > >> net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) > > >> net/bridge/br_fdb.c:225:9: left side has type bad type > > >> net/bridge/br_fdb.c:225:9: right side has type int > > >> net/bridge/br_fdb.c:225:9: error: cannot dereference this type > > >> /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoin g-args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wfra > > me- > > >> larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c > > >> make[3]: *** [net/bridge/br_fdb.o] Error 139 > > > > > > Ouch. > > > > > > Can you attach a preprocessed source .i file that reproduces the > > > problem? "make net/bridge/br_fdb.i" should work. > > > > Sure, attached. > > I tried to reproduce this segfault with this file and current Sparse > from Git, and couldn't seem to reproduce it. I tried the posted command > line and many variations on it. > > I had to explicitly drop -Wall or add -Wno-shadow to get the code to > pass Sparse, due to a pile of warnings about ______f and ______r. Apart > from that, I didn't see any issue. Those are from the __branch_check__ macro in include/linux/compiler.h. They get turned off if __CHECKER__ is defined, but doing the "make net/bridge/br_fdb.i" will not have that. That change could explain why the preprocessed code doesn't segfault. regards, dan carpenter > > - Josh Triplett > -- > To unsubscribe from this list: send the line "unsubscribe linux-sparse" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-25 10:49 ` Dan Carpenter @ 2010-03-25 15:46 ` Josh Triplett 2010-03-25 16:28 ` Randy Dunlap 0 siblings, 1 reply; 13+ messages in thread From: Josh Triplett @ 2010-03-25 15:46 UTC (permalink / raw) To: Dan Carpenter; +Cc: Randy Dunlap, linux-sparse On Thu, Mar 25, 2010 at 01:49:47PM +0300, Dan Carpenter wrote: > On Wed, Mar 24, 2010 at 01:34:29PM -0700, Josh Triplett wrote: > > On Wed, Mar 24, 2010 at 12:47:24PM -0700, Randy Dunlap wrote: > > > On 03/24/10 12:36, Josh Triplett wrote: > > > > On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: > > > >> (snapshot from Dave Jones: > > > >> http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) > > > >> > > > >> > > > >> In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), > > > >> sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in > > > >> Linus's mainline kernel tree) > > > >> > > > >> > > > >> The last messages are: > > > >> > > > >> net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge > > > >> net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) > > > >> net/bridge/br_fdb.c:225:9: left side has type bad type > > > >> net/bridge/br_fdb.c:225:9: right side has type int > > > >> net/bridge/br_fdb.c:225:9: error: cannot dereference this type > > > >> /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgo ing-args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow - > Wfra > > > me- > > > >> larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c > > > >> make[3]: *** [net/bridge/br_fdb.o] Error 139 > > > > > > > > Ouch. > > > > > > > > Can you attach a preprocessed source .i file that reproduces the > > > > problem? "make net/bridge/br_fdb.i" should work. > > > > > > Sure, attached. > > > > I tried to reproduce this segfault with this file and current Sparse > > from Git, and couldn't seem to reproduce it. I tried the posted command > > line and many variations on it. > > > > I had to explicitly drop -Wall or add -Wno-shadow to get the code to > > pass Sparse, due to a pile of warnings about ______f and ______r. Apart > > from that, I didn't see any issue. > > Those are from the __branch_check__ macro in include/linux/compiler.h. > They get turned off if __CHECKER__ is defined, but doing the > "make net/bridge/br_fdb.i" will not have that. > > That change could explain why the preprocessed code doesn't segfault. Good catch! Randy, could you perhaps add a "#define __CHECKER__" at the top of br_fdb.c and then do "make net/bridge/br_fdb.i" again? That *should* produce a .i file which matches what Sparse would see. Hopefully we can reproduce the bug with that. - Josh Triplett ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-25 15:46 ` Josh Triplett @ 2010-03-25 16:28 ` Randy Dunlap 2010-03-25 17:20 ` Christopher Li 0 siblings, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2010-03-25 16:28 UTC (permalink / raw) To: Josh Triplett; +Cc: Dan Carpenter, linux-sparse On 03/25/10 08:46, Josh Triplett wrote: > On Thu, Mar 25, 2010 at 01:49:47PM +0300, Dan Carpenter wrote: >> On Wed, Mar 24, 2010 at 01:34:29PM -0700, Josh Triplett wrote: >>> On Wed, Mar 24, 2010 at 12:47:24PM -0700, Randy Dunlap wrote: >>>> On 03/24/10 12:36, Josh Triplett wrote: >>>>> On Wed, Mar 24, 2010 at 10:41:44AM -0700, Randy Dunlap wrote: >>>>>> (snapshot from Dave Jones: >>>>>> http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ ) >>>>>> >>>>>> >>>>>> In the linux-next-20100324 or akpm's kernel patchset (mmotm-2010-03-23), >>>>>> sparse segfaults when checking net/bridge/br_fdb.c. (does not happen in >>>>>> Linus's mainline kernel tree) >>>>>> >>>>>> >>>>>> The last messages are: >>>>>> >>>>>> net/bridge/br_fdb.c:225:9: error: no member 'hash' in struct net_bridge >>>>>> net/bridge/br_fdb.c:225:9: error: incompatible types for operation (+) >>>>>> net/bridge/br_fdb.c:225:9: left side has type bad type >>>>>> net/bridge/br_fdb.c:225:9: right side has type int >>>>>> net/bridge/br_fdb.c:225:9: error: cannot dereference this type >>>>>> /bin/sh: line 1: 28041 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -D__x86_64__ -m64 -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -Wp,-MD,net/bridge/.br_fdb.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.4.1/include -I/lnx/src/NEXT/linux-next-20100324/arch/x86/include -Iinclude -I/lnx/src/NEXT/linux-next-20100324/include -include include/generated/autoconf.h -I/lnx/src/NEXT/linux-next-20100324/net/bridge -Inet/bridge -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoin g-args -fstack-protector -fno-builtin-memcpy -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow - >> Wfra >>>> me- >>>>>> larger-than=2048 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -fprofile-arcs -ftest-coverage -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(br_fdb)" -D"KBUILD_MODNAME=KBUILD_STR(bridge)" -D"DEBUG_HASH=21" -D"DEBUG_HASH2=11" /lnx/src/NEXT/linux-next-20100324/net/bridge/br_fdb.c >>>>>> make[3]: *** [net/bridge/br_fdb.o] Error 139 >>>>> >>>>> Ouch. >>>>> >>>>> Can you attach a preprocessed source .i file that reproduces the >>>>> problem? "make net/bridge/br_fdb.i" should work. >>>> >>>> Sure, attached. >>> >>> I tried to reproduce this segfault with this file and current Sparse >>> from Git, and couldn't seem to reproduce it. I tried the posted command >>> line and many variations on it. >>> >>> I had to explicitly drop -Wall or add -Wno-shadow to get the code to >>> pass Sparse, due to a pile of warnings about ______f and ______r. Apart >>> from that, I didn't see any issue. >> >> Those are from the __branch_check__ macro in include/linux/compiler.h. >> They get turned off if __CHECKER__ is defined, but doing the >> "make net/bridge/br_fdb.i" will not have that. >> >> That change could explain why the preprocessed code doesn't segfault. > > Good catch! > > Randy, could you perhaps add a "#define __CHECKER__" at the top of > br_fdb.c and then do "make net/bridge/br_fdb.i" again? That *should* > produce a .i file which matches what Sparse would see. Hopefully we can > reproduce the bug with that. OK, I emailed that file, but it's huge -- it probably won't be on the mailing list, so I also uploaded it to here: http://www.xenotime.net/linux/doc/br_fdb.i -- ~Randy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-25 16:28 ` Randy Dunlap @ 2010-03-25 17:20 ` Christopher Li 2010-03-29 7:50 ` Christopher Li 0 siblings, 1 reply; 13+ messages in thread From: Christopher Li @ 2010-03-25 17:20 UTC (permalink / raw) To: Randy Dunlap; +Cc: Josh Triplett, Dan Carpenter, linux-sparse On Thu, Mar 25, 2010 at 9:28 AM, Randy Dunlap <rdunlap@xenotime.net> wrote: > > OK, I emailed that file, but it's huge -- it probably won't be on the > mailing list, so I also uploaded it to here: > http://www.xenotime.net/linux/doc/br_fdb.i Thanks, I can duplicate the segfault now. Looking at it. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-25 17:20 ` Christopher Li @ 2010-03-29 7:50 ` Christopher Li 2010-03-29 16:46 ` Randy Dunlap 0 siblings, 1 reply; 13+ messages in thread From: Christopher Li @ 2010-03-29 7:50 UTC (permalink / raw) To: Randy Dunlap; +Cc: Josh Triplett, Dan Carpenter, linux-sparse On Thu, Mar 25, 2010 at 10:20 AM, Christopher Li <sparse@chrisli.org> wrote: > On Thu, Mar 25, 2010 at 9:28 AM, Randy Dunlap <rdunlap@xenotime.net> wrote: >> >> OK, I emailed that file, but it's huge -- it probably won't be on the >> mailing list, so I also uploaded it to here: >> http://www.xenotime.net/linux/doc/br_fdb.i > > Thanks, I can duplicate the segfault now. > > Looking at it. Hi, I check in a change at. commit 703499e552b45542a328e3016868419d65143f2b Author: Christopher <sparse@chrisli.org> Date: Sun Mar 28 22:41:49 2010 -0700 evaluate: check for NULL type inside typeof This should fix the segfault report by Randy. It still doesn't parse the struct attribute correctly though. Signed-off-by: Christopher <sparse@chrisli.org> diff --git a/evaluate.c b/evaluate.c index 28bfd7c..cdbd064 100644 --- a/evaluate.c +++ b/evaluate.c @@ -340,7 +340,9 @@ static inline int classify_type(struct symbol *type, struct sy type = type->ctype.base_type; if (type->type == SYM_TYPEOF) { type = evaluate_expression(type->initializer); - if (type->type == SYM_NODE) + if (!type) + type = &bad_ctype; + else if (type->type == SYM_NODE) type = type->ctype.base_type; } if (type->type == SYM_ENUM) That should stop the segfault. Please verify. More work needs to be done to parse the struct attribute correctly. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-29 7:50 ` Christopher Li @ 2010-03-29 16:46 ` Randy Dunlap 2010-03-29 17:29 ` Christopher Li 0 siblings, 1 reply; 13+ messages in thread From: Randy Dunlap @ 2010-03-29 16:46 UTC (permalink / raw) To: Christopher Li; +Cc: Josh Triplett, Dan Carpenter, linux-sparse On Mon, 29 Mar 2010 00:50:31 -0700 Christopher Li wrote: > On Thu, Mar 25, 2010 at 10:20 AM, Christopher Li <sparse@chrisli.org> wrote: > > On Thu, Mar 25, 2010 at 9:28 AM, Randy Dunlap <rdunlap@xenotime.net> wrote: > >> > >> OK, I emailed that file, but it's huge -- it probably won't be on the > >> mailing list, so I also uploaded it to here: > >> http://www.xenotime.net/linux/doc/br_fdb.i > > > > Thanks, I can duplicate the segfault now. > > > > Looking at it. > > Hi, > > I check in a change at. > > commit 703499e552b45542a328e3016868419d65143f2b > Author: Christopher <sparse@chrisli.org> > Date: Sun Mar 28 22:41:49 2010 -0700 > > evaluate: check for NULL type inside typeof > > This should fix the segfault report by Randy. > It still doesn't parse the struct attribute correctly though. > > Signed-off-by: Christopher <sparse@chrisli.org> > > diff --git a/evaluate.c b/evaluate.c > index 28bfd7c..cdbd064 100644 > --- a/evaluate.c > +++ b/evaluate.c > @@ -340,7 +340,9 @@ static inline int classify_type(struct symbol > *type, struct sy > type = type->ctype.base_type; > if (type->type == SYM_TYPEOF) { > type = evaluate_expression(type->initializer); > - if (type->type == SYM_NODE) > + if (!type) > + type = &bad_ctype; > + else if (type->type == SYM_NODE) > type = type->ctype.base_type; > } > if (type->type == SYM_ENUM) > > > That should stop the segfault. Please verify. More work needs to be done > to parse the struct attribute correctly. Hi Chris, Yes, this gets it past the segfault problem. Thanks. [Just had a little trouble applying it because it's full of spaces instead of tabs. Once I realized that, it was no problem.] --- ~Randy -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: segfault in sparse snapshot 2010-02-13 2010-03-29 16:46 ` Randy Dunlap @ 2010-03-29 17:29 ` Christopher Li 0 siblings, 0 replies; 13+ messages in thread From: Christopher Li @ 2010-03-29 17:29 UTC (permalink / raw) To: Randy Dunlap; +Cc: Josh Triplett, Dan Carpenter, linux-sparse On Mon, Mar 29, 2010 at 9:46 AM, Randy Dunlap <rdunlap@xenotime.net> wrote: > Hi Chris, > > Yes, this gets it past the segfault problem. Thanks. > > [Ju:st had a little trouble applying it because it's full of spaces > instead of tabs. Once I realized that, it was no problem.] You can just pull from the sparse chrisl branch. Sorry I did not make it clear. Proper parsing the struct foo __attribute__() { ...} is more challenging than this simple fix. But I guess a NULL pointer check shouldn't hurt for now. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2010-03-29 17:29 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-03-24 17:41 segfault in sparse snapshot 2010-02-13 Randy Dunlap 2010-03-24 19:36 ` Josh Triplett [not found] ` <4BAA6C4C.8010103@xenotime.net> 2010-03-24 20:34 ` Josh Triplett 2010-03-24 21:01 ` Randy Dunlap 2010-03-24 22:00 ` Josh Triplett 2010-03-24 22:02 ` Randy Dunlap 2010-03-25 10:49 ` Dan Carpenter 2010-03-25 15:46 ` Josh Triplett 2010-03-25 16:28 ` Randy Dunlap 2010-03-25 17:20 ` Christopher Li 2010-03-29 7:50 ` Christopher Li 2010-03-29 16:46 ` Randy Dunlap 2010-03-29 17:29 ` Christopher Li
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).