tg icon indicating copy to clipboard operation
tg copied to clipboard

error: ‘write’ reading 18 bytes from a region of size 17

Open Jay-null opened this issue 2 years ago • 5 comments

Hi, I got a problem with a python script, I did step by step actions, from manual in description:

 git clone --recursive https://github.com/vysheng/tg.git && cd tg
 sudo apt-get install libreadline-dev libconfig-dev libssl-dev 
 lua5.2 liblua5.2-dev libevent-dev     libjansson-dev libpython-dev make 

here I received error about libpython-dev: Package 'libpython-dev' has no installation candidate then I found that python package contains libpython-dev nowadays, I just ran apt-get without libpython-dev, then I typed this command:

sudo ./configure
 make

But also tried without sudo, anyway I get this:

configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2
-DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/main.d -MQ objs/main.o -o objs/main.o main.c
main.c: In function ‘termination_signal_handler’:
main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.c:29:
/usr/include/unistd.h:367:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
  367 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:48: objs/main.o] Error 1

Thanks for any feedback

Jay-null avatar Mar 27 '22 17:03 Jay-null

Try install python-dev.

Paulchen232 avatar Mar 27 '22 23:03 Paulchen232

dpkg -i /home/onepnch/Dependences/libpython-dev_2.7.13-2_amd64.deb             
Selecting previously unselected package libpython-dev:amd64.
(Reading database ... 293271 files and directories currently installed.)
Preparing to unpack .../libpython-dev_2.7.13-2_amd64.deb ...
Unpacking libpython-dev:amd64 (2.7.13-2) ...
dpkg: dependency problems prevent configuration of libpython-dev:amd64:
 libpython-dev:amd64 depends on libpython2.7-dev (>= 2.7.13-1~); however:
  Package libpython2.7-dev is not installed.
 python2.7-minimal (2.7.18-13) breaks libpython-dev (<< 2.7.18) and is installed.
  Version of libpython-dev:amd64 to be configured is 2.7.13-2.
 python2.7 (2.7.18-13) breaks libpython-dev (<< 2.7.18) and is installed.
  Version of libpython-dev:amd64 to be configured is 2.7.13-2.
 libpython2.7-stdlib:amd64 (2.7.18-13) breaks libpython-dev (<< 2.7.18) and is installed.
  Version of libpython-dev:amd64 to be configured is 2.7.13-2.
 libpython2.7-minimal:amd64 (2.7.18-13) breaks libpython-dev (<< 2.7.18) and is installed.
  Version of libpython-dev:amd64 to be configured is 2.7.13-2.

dpkg: error processing package libpython-dev:amd64 (--install):
 dependency problems - leaving unconfigured
Processing triggers for kali-menu (2021.4.2) ...
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 libpython-dev:amd64

Jay-null avatar Mar 28 '22 20:03 Jay-null

Have you not use sudo apt install libpython-dev or sudo apt install python-dev? To not have

cc1: all warnings being treated as errors

delete -Werror in Makefile (found in the installation directory).

Paulchen232 avatar Mar 29 '22 00:03 Paulchen232

Same here. Any luck with this?

DaviSMoura avatar Apr 17 '22 14:04 DaviSMoura

delete -Werror in Makefile (found in the installation directory).

Now it gives another error. I guess without libpython-dev it doesn't work :cry:

WhiteBlackGoose avatar Sep 14 '22 14:09 WhiteBlackGoose