Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Two issues found with -fsanitize=undefined



On 2015.09.17 at 10:16 -0700, Bart Schaefer wrote:
> On Sep 17,  9:57am, Markus Trippelsdorf wrote:
> }
> } I've build zsh trunk with -fsanitize=undefined and two issue popped up
> } while running the testsuite:
> 
> It would be helpful if you included at least part of the output (after the
> "for:") to indicate WHICH tests reported these errors.
> 
> }  compmatch.c:341:6: runtime error: null pointer passed as argument 2, which is declared to never be null}
> } Test ./Y02compmatch.ztst failed: output differs from expected as shown above for:
> 
> Could be anything.  The error indicates that "matchbuf" is NULL at the
> point where we expect to copy it into a new buffer, but if there is a
> deeper reason why that is unexpectedly NULL it would be better to fix
> that than to simply skip the copy.

Sorry:

./Y02compmatch.ztst: starting.
*** /tmp/zsh.ztst.out.27917     Thu Sep 17 19:20:46 2015
--- /tmp/zsh.ztst.tout.27917    Thu Sep 17 19:20:46 2015
***************
*** 1,3 ****
  line: {tst nolistbeep }{}
! COMPADD:{}
  INSERT_POSITIONS:{14}
--- 1,3 ----
  line: {tst nolistbeep }{}
! COMPADD:{compmatch.c:341:6: runtime error: null pointer passed as argument 2, which is declared to never be null}
  INSERT_POSITIONS:{14}
Test ./Y02compmatch.ztst failed: output differs from expected as shown above for:
  example1_list=(
        kshoptionprint        shglob              
        listambiguous         shinstdin           
        listbeep              shnullcmd           
        listpacked            shoptionletters     
        listrowsfirst         shortloops          
        listtypes             shwordsplit
   )
 options_matcher='L:|[nN][oO]= M:_= M:{A-Z}={a-z}'
 test_code $options_matcher example1_list
 comptest $'tst nolistbee\t'
Was testing: Documentation example for options, input "nolistbee"
./Y02compmatch.ztst: test failed.

And it is quite easy to reproduce (with gcc-5):

zsh-code % ./.preconfig
zsh-code % CC="gcc -fsanitize=undefined" ./configure 
zsh-code % make && make check 

BTW why isn't the make -j option passed on?
e.g. "make -j4" still builds single threaded.

-- 
Markus



Messages sorted by: Reverse Date, Date, Thread, Author