profile
viewpoint
Salvatore Sanfilippo antirez Redis Labs Campobello di Licata, Sicily, Italy http://invece.org Computer programmer based in Sicily, Italy. I mostly write OSS software. Born 1977. Not a puritan.

antirez/disque 7711

Disque is a distributed message broker

antirez/kilo 4738

A text editor in less than 1000 LOC with syntax highlight and search.

antirez/linenoise 2551

A small self-contained alternative to readline and libedit

antirez/neural-redis 2186

Neural networks module for Redis

antirez/dump1090 1626

Dump1090 is a simple Mode S decoder for RTLSDR devices

antirez/lamernews 1343

Lamer News -- an HN style social news site written in Ruby/Sinatra/Redis/JQuery

antirez/hping 835

hping network tool

antirez/load81 493

SDL based Lua programming environment for kids similar to Codea

antirez/disque-module 456

Disque ported as Redis module

antirez/lua-cmsgpack 296

A self contained Lua MessagePack C implementation.

pull request commentredis/redis

Handle binary safe string for REQUIREPASS and MASTERAUTH directives

Oh look, no more antirez :D. I still think his original suggestion made sense. I think we should extend the createStringconfig() to support createSDSConfig(). It's a different type, so I think it should have a different variable. I would look at the way numerics are handled for an example.

My soul keep watching on you.

QuChen88

comment created time in 11 days

push eventantirez/load81

antirez

commit sha f3b4404c2ba9fe24dcad3fdc8679de9662fcc1f5

SDL2 porting file removed.

view details

push time in 3 months

push eventantirez/load81

antirez

commit sha 3be2606397bbb0e6441495278c09b55cdf3c3796

SDL2: fix sprite.

view details

push time in 3 months

push eventantirez/load81

antirez

commit sha 7b7dec5b06caa38806fa2a82653708878699bd3c

SDL2: getpixel() fixed.

view details

push time in 3 months

push eventantirez/load81

antirez

commit sha c98b5267a4294be7d5d2e5c7186ca4bf639d00d4

SDL2: initial porting. Many things to fix yet.

view details

antirez

commit sha 897515f1807f7b1278e88b43e27d351f713d0f98

SDL2: fix editor keys handling.

view details

antirez

commit sha cfb7988df3b1ad7aef03ec254338d7a48710a85f

SDL2: lua program keyboard events fixed.

view details

antirez

commit sha ea53fa44c84d9b02a58c4d2f681e4fbd6583b3ac

SDL2: fix rendering.

view details

push time in 3 months

pull request commentantirez/kilo

Fixing the ‘UINT32_MAX’ undeclared problem

Thanks @unknowntpo

unknowntpo

comment created time in 3 months

push eventantirez/kilo

unknowntpo

commit sha 262d5567728abe5c61a0d2b6cccdc48c5d641bee

Fixing the ‘UINT32_MAX’ undeclared problem This commit fix the ‘UINT32_MAX’ undeclared problem in Linux I mentioned in the issue #67 by including <stdint.h>

view details

Salvatore Sanfilippo

commit sha 69c3ce609d1e8df3956cba6db3d296a7cf3af3de

Merge pull request #68 from unknowntpo/master Fixing the ‘UINT32_MAX’ undeclared problem

view details

push time in 3 months

PR merged antirez/kilo

Fixing the ‘UINT32_MAX’ undeclared problem

This commit fix the ‘UINT32_MAX’ undeclared problem in Linux I mentioned in the issue #67 by including <stdint.h>

+1 -0

0 comment

1 changed file

unknowntpo

pr closed time in 3 months

pull request commentantirez/linenoise

Another implementation for utf8 support.

Ok I took some time to read both the implementations. They are both nice in different ways. But my feeling is that this implementation is too complex for the linenoise design idea of minimality, and @ManzoniGiuseppe implementation, which is more in the right direction, is too conservative in the abstractions, so it ends making a lot of math with buffer positions. I want to attempt a more minimal implementation, and I'll post it as a PR as well. Let's see if there is a possible, really minimal approach. Thanks.

yhirose

comment created time in 3 months

issue closedantirez/kilo

Why does it work

I get an error when kilo is compiled, but why does it work. Why is that? The compiler I are using is Clang

closed time in 3 months

ghost

issue commentantirez/kilo

Why does it work

This is just a compiler "warning". Not an error, but something the compiler warns you about, even if it is actually able to produce a binary. Btw this problem is now resolved.

ghost

comment created time in 3 months

issue closedantirez/kilo

Integer Overflow && heap-buffer-overflow in kilo.c

There is a heap overflow caused by integer overflow in kilo.c. POC:

python -c "print '\t'*477218598" > ./exp

In command line:

make CC="clang-4.0 -fsanitize=address"
./kilo  ./exp

Output:

=================================================================
==18601==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x608000000077 at pc 0x00000050f641 bp 0x7ffd0126fe50 sp 0x7ffd0126fe48
WRITE of size 1 at 0x608000000077 thread T0
    #0 0x50f640  (/home/kirin/kilo/kilo+0x50f640)
    #1 0x50fde0  (/home/kirin/kilo/kilo+0x50fde0)
    #2 0x511ae0  (/home/kirin/kilo/kilo+0x511ae0)
    #3 0x514833  (/home/kirin/kilo/kilo+0x514833)
    #4 0x7f99a53a0b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #5 0x41c339  (/home/kirin/kilo/kilo+0x41c339)

0x608000000077 is located 0 bytes to the right of 87-byte region [0x608000000020,0x608000000077)
allocated by thread T0 here:
    #0 0x4d1990  (/home/kirin/kilo/kilo+0x4d1990)
    #1 0x50f45e  (/home/kirin/kilo/kilo+0x50f45e)
    #2 0x50fde0  (/home/kirin/kilo/kilo+0x50fde0)
    #3 0x511ae0  (/home/kirin/kilo/kilo+0x511ae0)
    #4 0x514833  (/home/kirin/kilo/kilo+0x514833)
    #5 0x7f99a53a0b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/kirin/kilo/kilo+0x50f640) 
Shadow bytes around the buggy address:
  0x0c107fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c107fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c107fff8000: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[07]fa
  0x0c107fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c107fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==18601==ABORTING

Analyze: There is an integer overflow in function editorUpdateRow:

    for (j = 0; j < row->size; j++)
        if (row->chars[j] == TAB) tabs++;

    row->render = malloc(row->size + tabs*8 + nonprint*9 + 1);
    idx = 0;
    for (j = 0; j < row->size; j++) {
        if (row->chars[j] == TAB) {
            row->render[idx++] = ' ';
......

The space size being malloc will be calculated based on the number of TABs in one row. When the number of TAB is too big,it will lead to Integer Overflow. And it will lead to heap-buffer-overflow finally.

closed time in 3 months

Kirin-say

push eventantirez/kilo

antirez

commit sha 7709a04ae8520c5b04d261616098cebf742f5a23

Fix integer overflow in row allocation. #60.

view details

push time in 3 months

issue commentantirez/kilo

Integer Overflow && heap-buffer-overflow in kilo.c

Fixed, thanks!

Kirin-say

comment created time in 3 months

push eventantirez/kilo

antirez

commit sha 0099562d0e79aea0c6deedfa1ee0ef4a3a8883b7

Simplify features macro.

view details

push time in 3 months

push eventantirez/kilo

antirez

commit sha 22cf54f3108974ede3031b887cb944dd54b24bc0

Make Linux/Macos discoverable by macros.

view details

push time in 3 months

push eventantirez/kilo

antirez

commit sha 806d41273267e48611c6c1171c61afa43b88b0c0

Get rid of non ANSI C strdup().

view details

push time in 3 months

PR closed antirez/kilo

Handle SIGWINCH signal

These changes will make kilo properly handle the SIGWINCH signal, so that if the window is resized, the editing area is also updated.

Some compile warnings have been removed as well.

+28 -15

2 comments

1 changed file

lpereira

pr closed time in 3 months

pull request commentantirez/kilo

Handle SIGWINCH signal

Thanks, merged with a few changes to make it compile on OSX and don't collied with other PRs I already merged.

lpereira

comment created time in 3 months

push eventantirez/kilo

Leandro Pereira

commit sha e10bc606f03750a211ae430b6e2079d8e5b1ed85

Handle SIGWINCH signal to properly resize editor

view details

push time in 3 months

pull request commentantirez/kilo

Added <time.h>, all C/C++ keywords, defined _DEFAULT_SOURCE, and changed -W to -Wextra

Thanks, I only merged a subset of this PR (the one adding C/C++ keywords).

Property404

comment created time in 3 months

push eventantirez/kilo

Property404

commit sha c1a27fa340cc8921a35971e442a0836781b1e923

Added all C and C++ keywords.

view details

push time in 3 months

PR closed antirez/kilo

Highlighting and movements

Added syntax highlighting for Python and added HOME and END key movements. Stopped comments from being comment-highlighted while they are in strings.

+103 -44

1 comment

2 changed files

RiordanIX

pr closed time in 3 months

pull request commentantirez/kilo

Highlighting and movements

Too many things in a single PR :D

RiordanIX

comment created time in 3 months

PR closed antirez/kilo

dublicate stdio.h, clear screen after quit
+28 -4

2 comments

1 changed file

fruitJazzy

pr closed time in 3 months

pull request commentantirez/kilo

dublicate stdio.h, clear screen after quit

I don't like clearing the screen :) The implementation is not ok btw.

fruitJazzy

comment created time in 3 months

pull request commentantirez/kilo

rm repeat header file

👍

dayuoba

comment created time in 3 months

push eventantirez/kilo

dayu

commit sha a2bd567932e8d66890378a782c1f005174cc111f

rm repeat header file i found that there were two same `stdlib.h`,if there is some magic for that case .pls ignore this pr :)

view details

Salvatore Sanfilippo

commit sha 29aa77781c5c7d00823bf8be2c4af51e453b575d

Merge pull request #33 from dayuoba/patch-1 rm repeat header file

view details

push time in 3 months

PR merged antirez/kilo

rm repeat header file

i found that there were two same stdlib.h,if there is some magic for that case .pls ignore this pr :)

+0 -1

0 comment

1 changed file

dayuoba

pr closed time in 3 months

pull request commentantirez/kilo

Remove unnecessary initialization code for editor

Obvious > Implicit :) Closing.

ghost

comment created time in 3 months

PR closed antirez/kilo

Fixed a warning.

Added a header file 'time.h' for time() sys call.

+1 -0

1 comment

1 changed file

pushb

pr closed time in 3 months

pull request commentantirez/kilo

Fixed a warning.

Thanks, I merged a different PR.

pushb

comment created time in 3 months

pull request commentantirez/kilo

Fix memory leak

Thanks, merged.

vuonghv

comment created time in 3 months

push eventantirez/kilo

Vuong Hoang

commit sha 8e9a9bb750504593180591ba927df136252a2532

Fix memory leak Call FIND_RESTORE_HL make a memory leak

view details

Salvatore Sanfilippo

commit sha 5375e13141b733d5213440f396342729889c22ba

Merge pull request #52 from vuonghv/master Fix memory leak

view details

push time in 3 months

PR merged antirez/kilo

Fix memory leak

Call FIND_RESTORE_HL make a memory leak

+1 -0

0 comment

1 changed file

vuonghv

pr closed time in 3 months

pull request commentantirez/kilo

Use _POSIX_C_SOURCE, drop _BSD_SOURCE, _GNU_SOURCE (#5, #12)

Thanks, merged.

skeeto

comment created time in 3 months

push eventantirez/kilo

Christopher Wellons

commit sha d65f4c92e8ed405937a7bac3248d24fa6b40eb6f

Use _POSIX_C_SOURCE, drop _BSD_SOURCE, _GNU_SOURCE (#5, #12) The only need for _BSD_SOURCE is a single use of the trivial, but non-standard, strdup(). The only need for _GNU_SOURCE is for getline(). This function was standardized by POSIX 10 years ago, so you only need to ask for it with _POSIX_C_SOURCE. Also added time.h which is only included by luck from the removed feature test macros. This is better than PR #5 because _DEFAULT_SOURCE isn't needed at all.

view details

Salvatore Sanfilippo

commit sha f12546b4f3dc8a4b84fbba3f2e06a02a9322ccc0

Merge pull request #55 from skeeto/master Use _POSIX_C_SOURCE, drop _BSD_SOURCE, _GNU_SOURCE (#5, #12)

view details

push time in 3 months

PR merged antirez/kilo

Use _POSIX_C_SOURCE, drop _BSD_SOURCE, _GNU_SOURCE (#5, #12)

The only need for _BSD_SOURCE is a single use of the trivial, but non-standard, strdup(). The only need for _GNU_SOURCE is for getline(). This function was standardized by POSIX 10 years ago, so you only need to ask for it with _POSIX_C_SOURCE.

Also added time.h which is only included by luck via the removed feature test macros.

This is better than PR #5 because _DEFAULT_SOURCE isn't needed at all.

+2 -2

2 comments

1 changed file

skeeto

pr closed time in 3 months

issue commentantirez/redis

Bug Report - Server crashed due to ziplist

Hello @stutiredboy, we no longer received in any new version of Redis a similar bug report, and we can't investigate bugs related to Redis 3. Please upgrade to Redis 6, that is compatible with Redis 3, so that you can run new code that is hopefully a lot saner :) Cheers.

fgaule

comment created time in 3 months

issue commentantirez/redis

rax.h raxRemove recompression not working as expected

(Btw excellent bug report)

MEDSMEDS

comment created time in 3 months

issue commentantirez/redis

rax.h raxRemove recompression not working as expected

Thank you @MEDSMEDS, please could you resubmit to https://github.com/antirez/rax ? Thank you.

MEDSMEDS

comment created time in 3 months

issue commentantirez/redis

High CPU usage and HZ works contrary to what the documentation specifies

Hi @mvasi90, what instances are using an high CPU usage, master, replica or sentinel? An idle Redis instance should consume a very small amount of CPU, very far (much lower) from the 5% you see. More informations are needed. What version are you using and in what system? Also an INFO output could be useful.

mvasi90

comment created time in 3 months

pull request commentantirez/redis

skip a test that uses +inf on valgrind

That's super odd, any hint you were able to collect about why this is the case?

oranagra

comment created time in 3 months

more