[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 13, 2013 at 03:58:37PM -0400, Vince Weaver wrote:
 > On Thu, 13 Jun 2013, Tommi Rantala wrote:
 > 
 > > [221186.493638] traps: trinity-child30[375] trap divide error
 > > ip:40dbae sp:7fff3c1d7ae0 error:0 in trinity[400000+28000]
 > 
 > diff --git a/syscalls/perf_event_open.c b/syscalls/perf_event_open.c
 > index 32c11cf..11f49e8 100644
 > --- a/syscalls/perf_event_open.c
 > +++ b/syscalls/perf_event_open.c
 > @@ -406,6 +406,14 @@ static long long random_sysfs_config(__u32 *type, __u64 *config1) {
 >  	int i,j;
 >  	long long c=0,c1=0;
 >  
 > +	if (num_pmus==0) {
 > +		/* For some reason we didn't get initialized */
 > +		/* Fake it so we don't divide by zero        */
 > +		*type=rand32();
 > +		*config1=rand64();
 > +		return rand64();
 > +	}

Probably safer ?

+               *type = rand32() | 1;
+               *config1 = rand64() | 1;
+               return rand64() | 1;

	Dave

--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux