[bug #21376] Random Segmentation fault when run with -j n

2007-10-20 Thread Paul D. Smith

Update of bug #21376 (project make):

  Status:None => Duplicate  
 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

This is a duplicate of bug #20033.  There's a patch attached to that bug.

I only was able to determine this by looking at the stack trace you provided
to the mailing list; when reporting bugs please remember to add in stack
traces, etc. wherever possible.

Cheers.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


RE: Random Segmentation fault when run with -j n

2007-10-20 Thread Shahzad Muzaffar
30 0x0804d59c in variable_expand_for_file (line=0x94a6c40 "[EMAIL PROTECTED] 
\"$@ = $($@)\"", file=0x94a3ed0) at expand.c:463
#31 0x0804d79a in allocated_variable_expand_for_file (line=0x94a6c40 "[EMAIL 
PROTECTED] \"$@ = $($@)\"", file=0x94a3ed0) at expand.c:548
#32 0x08055562 in new_job (file=0x94a3ed0) at job.c:1600
#33 0x0804b57a in execute_file_commands (file=0x94a3ed0) at commands.c:394
#34 0x08061d20 in remake_file (file=0x94a3ed0) at remake.c:1123
#35 0x08061063 in update_file_1 (file=0x94a3ed0, depth=2) at remake.c:761
#36 0x0805fd3f in update_file (file=0x94a3ed0, depth=2) at remake.c:307
#37 0x080615dd in check_dep (file=0x94a3ed0, depth=2, this_mtime=1, 
must_make_ptr=0xbff5ad68) at remake.c:947
#38 0x08060596 in update_file_1 (file=0x94a0620, depth=1) at remake.c:508
#39 0x0805fd3f in update_file (file=0x94a0620, depth=0) at remake.c:307
#40 0x0805f929 in update_goal_chain (goals=0x94a6af8) at remake.c:154
#41 0x08058801 in main (argc=3, argv=0xbff5c7d4, envp=0xbff5c7e4) at main.c:2198

Cheers,
--Shahzad

-Original Message-
From: Philip Guenther [mailto:[EMAIL PROTECTED]
Sent: Sat 10/20/2007 14:43
To: Shahzad Muzaffar
Cc: bug-make@gnu.org
Subject: Re: Random Segmentation fault when run with -j n
 
On 10/20/07, Shahzad Muzaffar <[EMAIL PROTECTED]> wrote:
> I have this Makefile (attached) and when I run it with -j 8 then I get
> random segmentation fault(not always on same point). Running it without
> -j option works fine and I do not get segmentation fault all the time
> (it is just random).

This makefile causes no problems for me under OpenBSD, running either
version 3.80 or 3.81.  Yes, I ran it many times.  You should have
included the actual operating system that you're using in your bug
report.

You should also check whether you can reproduce this with GNU make
version 3.81, which has been out for over 18 months.


> My guess is that as I calculate values for some
> variable only on fly so may be when run with -j option, two threads try
> to calculate/access the same variable and that causes a crash.

GNU make does not use threads, so this explanation cannot be correct.


Philip Guenther



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: Random Segmentation fault when run with -j n

2007-10-20 Thread Philip Guenther
On 10/20/07, Shahzad Muzaffar <[EMAIL PROTECTED]> wrote:
> I have this Makefile (attached) and when I run it with -j 8 then I get
> random segmentation fault(not always on same point). Running it without
> -j option works fine and I do not get segmentation fault all the time
> (it is just random).

This makefile causes no problems for me under OpenBSD, running either
version 3.80 or 3.81.  Yes, I ran it many times.  You should have
included the actual operating system that you're using in your bug
report.

You should also check whether you can reproduce this with GNU make
version 3.81, which has been out for over 18 months.


> My guess is that as I calculate values for some
> variable only on fly so may be when run with -j option, two threads try
> to calculate/access the same variable and that causes a crash.

GNU make does not use threads, so this explanation cannot be correct.


Philip Guenther


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Random Segmentation fault when run with -j n

2007-10-20 Thread Shahzad Muzaffar

Hello,
I have this Makefile (attached) and when I run it with -j 8 then I get 
random segmentation fault(not always on same point). Running it without 
-j option works fine and I do not get segmentation fault all the time 
(it is just random). My guess is that as I calculate values for some 
variable only on fly so may be when run with -j option, two threads try 
to calculate/access the same variable and that causes a crash. If I 
force the calculation of those variables before any rule to run then it 
works fine. So may be there is some variable locking problem.


Cheers,
--Shahzad

comma:= ,
empty:= 
colon:= :
space:= $(epmty) $(empty)
##
define set_cached_var_func_arg_
cached_var_func_arg$(cached_var_func_arg_count_$(1))_$(1) := $(2)
cached_var_func_arg_count_$(1) := $(cached_var_func_arg_count_$(1))1
endef
define set_cached_var_
$(eval cached_var_func_arg_count_$(1) :=) 
$(foreach arg,$(subst $(comma),$(space),$(cached_var_function_$(1))),$(eval 
$(call set_cached_var_func_arg_,$(1),$(arg
cached_var_$(1):=$(call 
$(cached_var_func_arg_$(1)),$(cached_var_func_arg1_$(1)),$(cached_var_func_arg11_$(1)),$(cached_var_func_arg111_$(1)),$(cached_var_func_arg_$(1)),$(cached_var_func_arg1_$(1)))
endef
define get_cached_var_
$(if $(subst undefined,,$(origin cached_var_$(1))),$(cached_var_$(1)),$(eval 
$(call set_cached_var_,$(1)))$(cached_var_$(1)))
endef
define get_uniq_cached_var_
$(if $(subst undefined,,$(origin cached_var_$(1))),$(cached_var_$(1)),$(eval 
$(call set_cached_var_,$(1)))$(call Uniq,$(cached_var_$(1
endef
##
define Uniq
$(eval uniq_string_:=)$(strip $(foreach v,$(1),$(if $(filter 
$(v),$(uniq_string_)),,$(eval uniq_string_+=$(v$(uniq_string_))
endef
define AddCachedVariable
cached_var_function_$(1)  := $(subst $(colon),$(comma),$(2))
ifeq ($$(strip $(3)),)
$(1) = $$(call get_cached_var_,$(1))
else
$(1) = $$(call get_uniq_cached_var_,$(1))
endif
endef
define CalculateToolOrder
$(if $(strip $($(1)_LOC_USE)),$(shell perl \-e '@z=($(2) $(foreach 
dep,$(foreach d,$($(1)_LOC_USE),$($d)),$(comma)$($(dep)_ORDER))); @z=sort {$$a 
<=> $$b} @z;$$x=$$z[0];$$x--;print "$$x";'),$(2))
endef
define ProductCommonVarsExternal
$$(eval $$(call AddCachedVariable,$(1)_ORDER,CalculateToolOrder:$(1):9,))
endef
S0/P0_0 := P0_0
P0_0_LOC_USE := 
P0_0_EX_USE := 
ALL_PACKS := P0_0 $(ALL_PACKS)

S0/P0_1 := P0_1
P0_1_LOC_USE := S0/P0_0
P0_1_EX_USE := S0/P0_0
ALL_PACKS := P0_1 $(ALL_PACKS)

S0/P0_2 := P0_2
P0_2_LOC_USE := S0/P0_1 S0/P0_0
P0_2_EX_USE := S0/P0_1 S0/P0_0
ALL_PACKS := P0_2 $(ALL_PACKS)

S0/P0_3 := P0_3
P0_3_LOC_USE := S0/P0_1 S0/P0_0
P0_3_EX_USE := S0/P0_1 S0/P0_0
ALL_PACKS := P0_3 $(ALL_PACKS)

S0/P0_4 := P0_4
P0_4_LOC_USE := S0/P0_1 S0/P0_2
P0_4_EX_USE := S0/P0_1 S0/P0_2
ALL_PACKS := P0_4 $(ALL_PACKS)

S1/P1_0 := P1_0
P1_0_LOC_USE := S0/P0_0 S0/P0_2
P1_0_EX_USE := S0/P0_0 S0/P0_2
ALL_PACKS := P1_0 $(ALL_PACKS)

S1/P1_1 := P1_1
P1_1_LOC_USE := S0/P0_4 S0/P0_0
P1_1_EX_USE := S0/P0_4 S0/P0_0
ALL_PACKS := P1_1 $(ALL_PACKS)

S1/P1_2 := P1_2
P1_2_LOC_USE := S0/P0_3 S0/P0_1
P1_2_EX_USE := S0/P0_3 S0/P0_1
ALL_PACKS := P1_2 $(ALL_PACKS)

S1/P1_3 := P1_3
P1_3_LOC_USE := S0/P0_3 S0/P0_0
P1_3_EX_USE := S0/P0_3 S0/P0_0
ALL_PACKS := P1_3 $(ALL_PACKS)

S1/P1_4 := P1_4
P1_4_LOC_USE := S0/P0_2 S0/P0_0
P1_4_EX_USE := S0/P0_2 S0/P0_0
ALL_PACKS := P1_4 $(ALL_PACKS)

S2/P2_0 := P2_0
P2_0_LOC_USE := S1/P1_0 S1/P1_3
P2_0_EX_USE := S1/P1_0 S1/P1_3
ALL_PACKS := P2_0 $(ALL_PACKS)

S2/P2_1 := P2_1
P2_1_LOC_USE := S0/P0_0 S1/P1_3
P2_1_EX_USE := S0/P0_0 S1/P1_3
ALL_PACKS := P2_1 $(ALL_PACKS)

S2/P2_2 := P2_2
P2_2_LOC_USE := S0/P0_2 S1/P1_1
P2_2_EX_USE := S0/P0_2 S1/P1_1
ALL_PACKS := P2_2 $(ALL_PACKS)

S2/P2_3 := P2_3
P2_3_LOC_USE := S2/P2_1 S1/P1_0
P2_3_EX_USE := S2/P2_1 S1/P1_0
ALL_PACKS := P2_3 $(ALL_PACKS)

S2/P2_4 := P2_4
P2_4_LOC_USE := S1/P1_2 S2/P2_2
P2_4_EX_USE := S1/P1_2 S2/P2_2
ALL_PACKS := P2_4 $(ALL_PACKS)

S3/P3_0 := P3_0
P3_0_LOC_USE := S2/P2_2 S2/P2_0
P3_0_EX_USE := S2/P2_2 S2/P2_0
ALL_PACKS := P3_0 $(ALL_PACKS)

S3/P3_1 := P3_1
P3_1_LOC_USE := S2/P2_1 S0/P0_1
P3_1_EX_USE := S2/P2_1 S0/P0_1
ALL_PACKS := P3_1 $(ALL_PACKS)

S3/P3_2 := P3_2
P3_2_LOC_USE := S0/P0_4 S2/P2_4
P3_2_EX_USE := S0/P0_4 S2/P2_4
ALL_PACKS := P3_2 $(ALL_PACKS)

S3/P3_3 := P3_3
P3_3_LOC_USE := S1/P1_1 S1/P1_0
P3_3_EX_USE := S1/P1_1 S1/P1_0
ALL_PACKS := P3_3 $(ALL_PACKS)

S3/P3_4 := P3_4
P3_4_LOC_USE := S3/P3_2 S2/P2_4
P3_4_EX_USE := S3/P3_2 S2/P2_4
ALL_PACKS := P3_4 $(ALL_PACKS)

S4/P4_0 := P4_0
P4_0_LOC_USE := S0/P0_3 S2/P2_3
P4_0_EX_USE := S0/P0_3 S2/P2_3
ALL_PACKS := P4_0 $(ALL_PACKS)

S4/P4_1 := P4_1
P4_1_LOC_USE := S3/P3_3 S0/P0_2
P4_1_EX_USE := S3/P3_3 S0/P0_2
ALL_PACKS := P4_1 $(ALL_PACKS)

S4/P4_2 := P4_2
P4_2_LOC_USE := S3/P3_3 S0/P0_4
P4_2_EX_USE := S3/P3_3 S0/P0_4
ALL_PACKS := P4_2 $(ALL_PACKS)

S4/P4_3 := P4_3
P4_3_LOC_USE := S2/P2_3 S1/P1_1
P4_3_EX_USE := S2/P2_3 S1/P1_1

[bug #21376] Random Segmentation fault when run with -j n

2007-10-20 Thread Shahzad Muzaffar

URL:
  <http://savannah.gnu.org/bugs/?21376>

 Summary: Random Segmentation fault when run with -j n 
 Project: make
Submitted by: muzaffar
Submitted on: Saturday 10/20/2007 at 08:20
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 3.80
Operating System: POSIX-Based
   Fixed Release: None

___

Details:

Hello, 
  I have this Makefile (attached) and when I run it with -j 8 then I get
random segmentation faults(not always on same point). Running it without -j
option works fine and I do not get segmentation faults all the time (it just
random). My guess is that as I calculate values for some variable only on fly
so may be when run with -j option, two threads try to calculate/access the
same variable and that causes a crash. If I force the calculation of those
variables before any rule to run then it works fine. So may be there is some
variable locking problem.

Cheers,
--Shahzad



___

File Attachments:


---
Date: Saturday 10/20/2007 at 08:20  Name: Makefile  Size: 5kB   By: muzaffar

<http://savannah.gnu.org/bugs/download.php?file_id=14171>

___

Reply to this item at:

  <http://savannah.gnu.org/bugs/?21376>

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make