linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Segmentation fault when running sparse with current linux master
@ 2020-09-17 11:08 Christian Eggers
  2020-09-17 14:20 ` Luc Van Oostenryck
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Eggers @ 2020-09-17 11:08 UTC (permalink / raw)
  To: linux-sparse; +Cc: Christian Eggers

Build of the current linux kernel breaks on my system due to segmentation fault when running sparse.

Sparse version: 0.6.2 (built by openSUSE build service)

Command line:
sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -D__ARMEL__ -D__arm__ --arch=arm -mlittle-endian -m32 -Wp,-MMD,kernel/time/.timekeeping.o.d -nostdinc -isystem /opt/orbiter-tiny/3.1.1/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.3.0/include -I/home/eggers/Projekte/jupiter/linux/linux-stable-rt/arch/arm/include -I./arch/arm/include/generated -I/home/eggers/Projekte/jupiter/linux/linux-stable-rt/include -I./include -I/home/eggers/Projekte/jupiter/linux/linux-stable-rt/arch/arm/include/uapi -I./arch/arm/include/generated/uapi -I/home/eggers/Projekte/jupiter/linux/linux-stable-rt/include/uapi -I./include/generated/uapi -include /home/eggers/Projekte/jupiter/linux/linux-stable-rt/include/linux/kconfig.h -include /home/eggers/Projekte/jupiter/linux/linux-stable-rt/include/linux/compiler_types.h -D__KERNEL__ -mlittle-endian -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-t
 rigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mfpu=vfp -funwind-tables -mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -Os --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -g -gdwarf-4 -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-po
 inter-types -Werror=designated-init -fmacro-prefix-map=/home/eggers/Projekte/jupiter/linux/linux-stable-rt/= -Wno-packed-not-aligned -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wpacked-not-aligned -Wstringop-truncation -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits --sysroot=/opt/orbiter-tiny/3.1.1/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-musleabi -W -I /home/eggers/Projekte/jupiter/linux/linux-stable-rt/kernel/time -I ./kernel/time -DKBUILD_MODFILE='"kernel/time/timekeeping"' -DKBUILD_BASENAME='"timekeeping"' -DKBUILD_MODNAME='"timekeeping"' /home/eggers/Projekte/jupiter/linux/linux-stable-rt/kernel/time/timekeeping.c

(gdb) backtrace 
#0  sset_test (idx=110, s=0x55a4fb42e440) at sset.h:43
#1  sset_testset (idx=110, s=0x55a4fb42e440) at sset.h:50
#2  ssa_convert_one_var (var=0x7f6cb181b548, ep=0x0) at ssa.c:210
#3  ssa_convert (ep=ep@entry=0x7f6cb1ca81d0) at ssa.c:395
#4  0x000055a4f9e93b61 in optimize (ep=ep@entry=0x7f6cb1ca81d0) at optimize.c:64
#5  0x000055a4f9e939f6 in linearize_fn (base_type=<optimized out>, sym=<optimized out>) at linearize.c:2516
#6  linearize_symbol (sym=<optimized out>) at linearize.c:2531
#7  0x000055a4f9e86f70 in check_symbols (list=0x7f6cb08e9890) at sparse.c:317
#8  0x000055a4f9e86a5d in main (argc=<optimized out>, argv=<optimized out>) at sparse.c:343

(gdb) print *s
$1 = {nbr = 0, off = 137, size = 30, sets = 0x55a4fb42e44c}

(gdb) info locals 
__idx = 4294967269
n = <optimized out>
__idx = <optimized out>
n = <optimized out>

So it looks like the sset is accessed with an invalid index.

regards
Christian




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

* Re: Segmentation fault when running sparse with current linux master
  2020-09-17 11:08 Segmentation fault when running sparse with current linux master Christian Eggers
@ 2020-09-17 14:20 ` Luc Van Oostenryck
  2020-09-21  7:44   ` Christian Eggers
  0 siblings, 1 reply; 6+ messages in thread
From: Luc Van Oostenryck @ 2020-09-17 14:20 UTC (permalink / raw)
  To: Christian Eggers; +Cc: linux-sparse

On Thu, Sep 17, 2020 at 01:08:57PM +0200, Christian Eggers wrote:
> Build of the current linux kernel breaks on my system due to segmentation fault when running sparse.
> 
> Sparse version: 0.6.2 (built by openSUSE build service)
> 

Hi, 

This has already been reported and fixed in the main tree in late July.
It's not clear to me if the latest OpenSUSE packages for sparse contain
or not the needed fix.

Can you try the version compiled from the source? It's super-easy:
	cd $dir
	git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
	cd sparse
	make 
	cp sparse ~/bin/

It's what is used by the test bots.

Best regards,
-- Luc

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

* Re: Segmentation fault when running sparse with current linux master
  2020-09-17 14:20 ` Luc Van Oostenryck
@ 2020-09-21  7:44   ` Christian Eggers
  2020-09-24 19:38     ` Luc Van Oostenryck
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Eggers @ 2020-09-21  7:44 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: linux-sparse

Hi Luc,

On Thursday, 17 September 2020, 16:20:17 CEST, Luc Van Oostenryck wrote:
> On Thu, Sep 17, 2020 at 01:08:57PM +0200, Christian Eggers wrote:
> > Build of the current linux kernel breaks on my system due to segmentation
> > fault when running sparse.
> > 
> > Sparse version: 0.6.2 (built by openSUSE build service)
> 
> Hi,
> 
> This has already been reported and fixed in the main tree in late July.
> It's not clear to me if the latest OpenSUSE packages for sparse contain
> or not the needed fix.
> 
> Can you try the version compiled from the source? It's super-easy:
> 	cd $dir
> 	git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
> 	cd sparse
> 	make
> 	cp sparse ~/bin/
> 

I fetched the source RPM from openSUSE and replaced the 0.6.2 tar.xz with the 
current master. After building an updating the RPM, sparse doesn't crash 
anymore.

openSUSE ships two versions of sparse [1]:
- official release: 20180324
- experimental: 0.6.2

It seems that both version are affected from this problem. The "experimental" 
version should be automatically updated after a new version of sparse is 
released. The "official release" will probably only accept patches resolving 
specific problems. If you can provide a patch against 20180324, I would try to 
write a bug report against the openSUSE package. This could save some time for 
the next person stumbling over this problem... If you provide the commit id, 
openSUSE can also decide themself whether to fix or upgrade the current 
version.

Best regards
Christian

[1] https://software.opensuse.org/package/sparse




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

* Re: Segmentation fault when running sparse with current linux master
  2020-09-21  7:44   ` Christian Eggers
@ 2020-09-24 19:38     ` Luc Van Oostenryck
  2020-09-25  5:37       ` Jiri Slaby
  0 siblings, 1 reply; 6+ messages in thread
From: Luc Van Oostenryck @ 2020-09-24 19:38 UTC (permalink / raw)
  To: Christian Eggers; +Cc: linux-sparse, Dirk Mueller, Jiri Slaby

On Mon, Sep 21, 2020 at 09:44:00AM +0200, Christian Eggers wrote:
> Hi Luc,
> 
> On Thursday, 17 September 2020, 16:20:17 CEST, Luc Van Oostenryck wrote:
> > On Thu, Sep 17, 2020 at 01:08:57PM +0200, Christian Eggers wrote:
> > > Build of the current linux kernel breaks on my system due to segmentation
> > > fault when running sparse.
> > >
> > > Sparse version: 0.6.2 (built by openSUSE build service)
> >
> > Hi,
> >
> > This has already been reported and fixed in the main tree in late July.
> > It's not clear to me if the latest OpenSUSE packages for sparse contain
> > or not the needed fix.
> >
> > Can you try the version compiled from the source? It's super-easy:
> >       cd $dir
> >       git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
> >       cd sparse
> >       make
> >       cp sparse ~/bin/
> >
> 
> I fetched the source RPM from openSUSE and replaced the 0.6.2 tar.xz with the
> current master. After building an updating the RPM, sparse doesn't crash
> anymore.
> 
> openSUSE ships two versions of sparse [1]:
> - official release: 20180324
> - experimental: 0.6.2
> 
> It seems that both version are affected from this problem. The "experimental"
> version should be automatically updated after a new version of sparse is
> released. The "official release" will probably only accept patches resolving
> specific problems. If you can provide a patch against 20180324, I would try to
> write a bug report against the openSUSE package. This could save some time for
> the next person stumbling over this problem... If you provide the commit id,
> openSUSE can also decide themself whether to fix or upgrade the current
> version.

In the official tree, there is a branch 'maint-v0.6.2' which just contain
4 patches fixing some problems with the release v0.6.2, the second patch
	77f35b796cc8 ("generic: fix missing inlining of generic expression")
being the one fixing this problem.

For info, I'll most probably make a new full release in a few weeks
(rc1 in 7-10 days, release 1-2 weeks later).

Best regards
-- Luc 

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

* Re: Segmentation fault when running sparse with current linux master
  2020-09-24 19:38     ` Luc Van Oostenryck
@ 2020-09-25  5:37       ` Jiri Slaby
  2020-09-25  8:46         ` Luc Van Oostenryck
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2020-09-25  5:37 UTC (permalink / raw)
  To: Luc Van Oostenryck, Christian Eggers; +Cc: linux-sparse, Dirk Mueller

On 24. 09. 20, 21:38, Luc Van Oostenryck wrote:
> On Mon, Sep 21, 2020 at 09:44:00AM +0200, Christian Eggers wrote:
>> Hi Luc,
>>
>> On Thursday, 17 September 2020, 16:20:17 CEST, Luc Van Oostenryck wrote:
>>> On Thu, Sep 17, 2020 at 01:08:57PM +0200, Christian Eggers wrote:
>>>> Build of the current linux kernel breaks on my system due to segmentation
>>>> fault when running sparse.
>>>>
>>>> Sparse version: 0.6.2 (built by openSUSE build service)
>>>
>>> Hi,
>>>
>>> This has already been reported and fixed in the main tree in late July.
>>> It's not clear to me if the latest OpenSUSE packages for sparse contain
>>> or not the needed fix.
>>>
>>> Can you try the version compiled from the source? It's super-easy:
>>>       cd $dir
>>>       git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
>>>       cd sparse
>>>       make
>>>       cp sparse ~/bin/
>>>
>>
>> I fetched the source RPM from openSUSE and replaced the 0.6.2 tar.xz with the
>> current master. After building an updating the RPM, sparse doesn't crash
>> anymore.
>>
>> openSUSE ships two versions of sparse [1]:
>> - official release: 20180324
>> - experimental: 0.6.2
>>
>> It seems that both version are affected from this problem. The "experimental"
>> version should be automatically updated after a new version of sparse is
>> released. The "official release" will probably only accept patches resolving
>> specific problems. If you can provide a patch against 20180324, I would try to
>> write a bug report against the openSUSE package. This could save some time for
>> the next person stumbling over this problem... If you provide the commit id,
>> openSUSE can also decide themself whether to fix or upgrade the current
>> version.
> 
> In the official tree, there is a branch 'maint-v0.6.2' which just contain
> 4 patches fixing some problems with the release v0.6.2, the second patch
> 	77f35b796cc8 ("generic: fix missing inlining of generic expression")
> being the one fixing this problem.

Being fixed in Tumbleweed:
https://build.opensuse.org/request/show/837254

If you want the fix on older distros, we can do that, but you have to
create a bug against the product first… 20180324 is pretty old version
and is both in 15.1 and even 15.2.

thanks,
-- 
js

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

* Re: Segmentation fault when running sparse with current linux master
  2020-09-25  5:37       ` Jiri Slaby
@ 2020-09-25  8:46         ` Luc Van Oostenryck
  0 siblings, 0 replies; 6+ messages in thread
From: Luc Van Oostenryck @ 2020-09-25  8:46 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Christian Eggers, linux-sparse, Dirk Mueller

On Fri, Sep 25, 2020 at 07:37:57AM +0200, Jiri Slaby wrote:
> On 24. 09. 20, 21:38, Luc Van Oostenryck wrote:
> > 
> > In the official tree, there is a branch 'maint-v0.6.2' which just contain
> > 4 patches fixing some problems with the release v0.6.2, the second patch
> > 	77f35b796cc8 ("generic: fix missing inlining of generic expression")
> > being the one fixing this problem.
> 
> Being fixed in Tumbleweed:
> https://build.opensuse.org/request/show/837254

Awesome! Thank you.
 
> If you want the fix on older distros, we can do that, but you have to
> create a bug against the product first… 20180324 is pretty old version
> and is both in 15.1 and even 15.2.

Mmmm, 20180324, that's sparse v0.5.2. It's very old indeed and
unusable for current kernel development anyway.

Best regards,
-- Luc

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

end of thread, other threads:[~2020-09-25  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 11:08 Segmentation fault when running sparse with current linux master Christian Eggers
2020-09-17 14:20 ` Luc Van Oostenryck
2020-09-21  7:44   ` Christian Eggers
2020-09-24 19:38     ` Luc Van Oostenryck
2020-09-25  5:37       ` Jiri Slaby
2020-09-25  8:46         ` Luc Van Oostenryck

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).