Opened 8 years ago

Closed 6 years ago

#1284 closed defect (fixed)

random behaviour in condense of structs

Reported by: Dimitar Misev Owned by: bbell
Priority: major Milestone: 10.0
Component: qlparser Version: development
Keywords: Cc: Peter Baumann, Alex Toader, Alex Dumitru, Vlad Merticariu
Complexity: Medium

Description

condense on structs behaves a bit randomly. Some examples below.

  • works as expected:
    $ rasql -q 'select condense min over i in [0:9] using {100,100} from mr as c' --out string
    
      Result element 1: { 100, 100 }
    
  • works as expected:
    $ rasql -q 'select condense min over i in [0:9] using {100, c[100,100]} from mr as c' --out string
      Result element 1: { 100, 163 }
    
  • should output { 163, 100 }:
    $ rasql -q 'select condense min over i in [0:9] using {c[100,100], 100} from mr as c' --out string
      Result element 1: { 163, 1677983744 }
    
  • sometimes correct ({0}), sometimes outputs random value, like:
    $ rasql -q 'select condense min over i in [0:9] using {i[0]} from mr as c' --out string
      Result element 1: { -67108744 }
    
  • always correct:
    $ rasql -q 'select condense min over i in [0:9] using {i[0],100} from mr as c' --out string
      Result element 1: { 0, 100 }
    
    $ rasql -q 'select condense min over i in [0:9] using {100,i[0]} from mr as c' --out string
      Result element 1: { 100, 0 }
    
  • random output:
    $ rasql -q 'select condense min over i in [0:9] using {c[100,100],i[0]} from mr as c' --out string
      Result element 1: { 163, 16515072 }
    

Change History (5)

comment:1 by Dimitar Misev, 7 years ago

Owner: set to bbell
Status: newassigned

comment:2 by Dimitar Misev, 7 years ago

@bbell which case is still an issue here?

comment:3 by bbell, 7 years ago

The issue here is when there is a struct {X, Y} where Y is generated in the query but not assigned the "char" type. Most likely, the memory is being allocated and initialized, but it is not being handled correctly. My justification for this is that performing the operation:

valgrind directql -q 'select condense min over i in [0:9] using {c[100,100], 100} from mr as c' —out string -d ~/../RASBASE

Result element 1: { 163, 1677983744 }

describes no unexpected and uninitialized values that do not already appear in every directql query (which we have narrowed down to 1 or 2 so far, I believe).

Also, as far as I know, the result element here is going to be the same on every system. It is not random.

comment:4 by bbell, 6 years ago

Was going through some old tickets, and this one seems to work for me now (probably resolved by the struct patch before the summer). Can anyone confirm?

comment:5 by Dimitar Misev, 6 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.