eyalroz / ssb-dbgen

Star Schema Benchmark data set generator (dbgen) - unified repository

Home Page:http://www.cs.umb.edu/~poneil/StarSchemaB.PDF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use proper, valid, seed table indices in calls to dss_random() and RANDOM()

eyalroz opened this issue · comments

If we build ssb-dbgen on GNU/Linux (kernel 4.10, Mint 18.3) with clang 5 instead of GCC and use -O1 optimizations, we get a segmentation fault (frame pointers shortened to 32-bit values to fit in line):

 thread #1, name = 'dbgen', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
frame #0: 0x00007ffff77a9bf7 libc.so.6`__strcpy_sse2_unaligned at strcpy-sse2-unaligned.S:296
frame #1: 0x004040e7 dbgen`pick_str(s=<unavailable>, c=<unavailable>, target=<unavailable>) at bm_utils.c:213 [opt]
frame #2: 0x00401cf4 dbgen`mk_part(index=<unavailable>, p=0x00007fffffffd428) at build.c:424 [opt]
frame #3: 0x004028fa dbgen`gen_tbl(tnum=<unavailable>, start=<unavailable>, count=<unavailable>, upd_num=<unavailable>) at driver.c:483 [opt]
frame #4: 0x00403d1c dbgen`main(ac=<unavailable>, av=<unavailable>) at driver.c:1140 [opt]
frame #5: 0x00007ffff7724830 libc.so.6`__libc_start_main(main=(dbgen`main at driver.c:928), argc=1, argv=0x00007fffffffd738, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffd728) at libc-start.c:291
frame #6: 0x00401219 dbgen`_start + 41

So, the issue was that the authors of the original SSB dbgen thought it was a good idea somehow to pass junk magic-number values as the seed index. And since dss_random() assumes the index is valid and manipulates the global seed table, this should trigger a segmentation violation or other kind of error. The fact that it hasn't so far is the weird part.