rakitzis / rc

rc shell -- independent re-implementation for Unix of the Plan 9 shell (from circa 1992)
Other
250 stars 23 forks source link

Tab completion causes crash. #75

Closed birchb1024 closed 1 year ago

birchb1024 commented 2 years ago

Tab completion causes crash.

How to reproduce

  1. start rc
  2. hit the Tab key
~ $ rc
; free(): double free detected in tcache 2
Aborted

Environment

; echo $version
1.7.4 $Release: @(#)rc 1.7.4 (git description unavailable) $
; apt list rc
Listing... Done
rc/stable,now 1.7.4+97.gceb59bb-4 amd64 [installed]
RamKromberg commented 2 years ago

I can't reproduce this with the current github master on Nix.

It looks like the Debian package is a few years behind upstream and is using an out-of-tree patch that was rejected over what sounds like a similar issue.

bernhardu commented 2 years ago

I came across this downstream Debian bug and found that the mentioned out-of-tree patch might do the efree(full); twice. I proposed there a fix by setting full to NULL after the first efree call.

xyb3rt commented 1 year ago

The bug was caused and fixed in Debian's patch.