Re: readlink bug?

Sam Steingold <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <864lyv8jak.fsf@sdsGazPro>
oops, C-c too fast.

basically, linklen == result, but linkbuf is incomplete, and, moreover,
is terminated with a newline(!) and a NULL (against the spec).

> * Sam Steingold <[email protected]> [2017-03-14 20:12:45 -0400]:
>
> I observe the following behavior:
>
> $ ls -l /proc/1627/fd/
> total 0
> 0 lrwx------ 1 sds sds 64 Mar 14 19:34 0 -> /dev/pts/23
> 0 l-wx------ 1 sds sds 64 Mar 14 19:34 1 -> /home/sds/src/clisp/current/build-porting64-gcc-standard_heapcodes/z
> 0 l-wx------ 1 sds sds 64 Mar 14 19:34 2 -> /home/sds/src/clisp/current/build-porting64-gcc-standard_heapcodes/z
> 0 lr-x------ 1 sds sds 64 Mar 14 19:34 3 -> /home/sds/src/clisp/current/build-porting64-gcc-standard_heapcodes/lisp.run*
> 0 l-wx------ 1 sds sds 64 Mar 14 19:34 4 -> /home/sds/src/clisp/current/build-porting64-gcc-standard_heapcodes/z
> 0 l-wx------ 1 sds sds 64 Mar 14 19:34 5 -> /home/sds/src/clisp/current/build-porting64-gcc-standard_heapcodes/z
>
> after
>
> GC_SAFE_SYSTEM_CALL(result = readlink(namestring_asciz,linkbuf,linklen));
>
> (gdb) p linkbuf
> $5 = "/home/sds/src/clisp/current/build-porting64-gcc-standard_heapcod\n"
> (gdb) p namestring_asciz
> $6 = 0x7fffffff7ff0 "/proc/1627/fd/1"
> (gdb) p fs->fs_stat
> $7 = {st_dev = 4, st_ino = 5336534, st_nlink = 1, st_mode = 41152,
> st_uid = 1001, st_gid = 1001, __pad0 = 0, st_rdev = 0, st_size = 64,
> st_blksize = 1024, st_blocks = 0, st_atim = {tv_sec = 1489534480,
> tv_nsec = 542647557}, st_mtim = {tv_sec = 1489534480, tv_nsec =
> 542647557}, st_ctim = {tv_sec = 1489534480, tv_nsec = 542647557},
> __glibc_reserved = {0, 0, 0}}

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 16.10 (yakkety) X 11.0.11804000
http://www.childpsy.net/ http://iris.org.il http://jihadwatch.org
http://palestinefacts.org http://ffii.org http://memri.org
Sometimes "pain in the ass" and "headache" are synonyms.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.