🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.programowanie
Article #72962

Re: ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: Nie ma takiego pliku ani katalogu

#72962
From: RM
Date: Thu, 20 Aug 2020 17:33
82 lines
3992 bytes
W dniu 20.08.2020 o 14:39, RM pisze:
> W dniu 20.08.2020 o 14:36, Mateusz Viste pisze:
>> 2020-08-20 o 14:32 +0200, RM napisał:
>>> W dniu 20.08.2020 o 13:48, RM pisze:
>>>
>>>> kod:
>>>>       TRACE("php_result_dir before:" << php_result_dir.length() <<
>>>> ",argv[2] before:" << strlen(argv[2]));
>>>> produkuje:
>>>>       php_result_dir before:9574696,argv[2] before:72
>>>> Nie wiem o co chodzi bo jedyną modyfikację jaką robię na
>>>> php_result_dir wcześniej jest:
>>>>           php_result_dir = "";
>>>> w konstruktorze (zrobiłem Find in Files w VSCode).
>>>
>>> Jak przedtem zrobię php_result_dir.clear() to mam na tej instrukcji
>>> SIGSEGV Segmentation fault.
>>
>> To potwierdza raczej, że źle inicjalizujesz/alokujesz (czy co tam
>> innego trzeba zrobić w C++) obiekt php_result_dir, i wywołując jego
>> metody trafiasz w dziurę czasoprzestrzenną. W jaki sposób stworzyłeś
>> ten obiekt?
>>
>> Mateusz
>>
> 
> class obfuscator {
> private:
>      ...
>      std::string php_application_dir, php_result_dir;
>      ...
> public:
>      obfuscator() {
>          status = s_not_ready;
>          php_application_dir = "";
>          php_result_dir = "";
>      ...
>      }
>      ...
> }
> 
> Nic innego nie robię.

Nie wiem czy to ma jakiś związek, ale jak zrobię:

class obfuscator {
...
public:
     obfuscator() { // TUTAJ PROBLEM
         status = s_not_ready;
         php_application_dir = "";
         php_result_dir = "";
         keywords = " " + reserved_keywords + " " + 
strtoupper(reserved_keywords) + " ";
         random_identifiers_length = default_random_identifiers_length;
         extension = default_extension;
         identifiers = new strvector[index_what_num];
         random_identifiers = new strvector[index_what_num];
         framework_identifiers = new strvector[index_what_num];
         error_messages = "";
     }
...
}

int main(int argc, const char *argv[]) {
     using namespace std;
     TRACE("main called" << endl);
     obfuscator dirty;

to dostaję błąd:

#9  0x0000000000409f4f in std::operator+<char, std::char_traits<char>, 
std::allocator<char> > (__lhs=...,
     __rhs=<error reading variable: Cannot create a lazy string with 
address 0x0, and a non-zero length.>) at 
/usr/include/c++/7/bits/basic_string.h:5955
#10 0x0000000000408406 in obfuscator::obfuscator (this=0x7ffd5adb6070)
     at src/obfuscator.hpp:79
#11 0x000000000040786b in main (argc=6, argv=0x7ffd5adb65b8)

Problem nie występuje jeśli mam w main():
     obfuscator *dirty = new obfuscator();
Technical Details
Message-ID: <rhmc4e$1trtj$1@portraits.wsisiz.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED.user-5-173-128-235.play-internet.pl!not-for-mail
References: <rh69ni$21vgn$1@portraits.wsisiz.edu.pl> <20200814200505.3b77dc82@mateusz> <rhiu00$17eoh$1@portraits.wsisiz.edu.pl> <rhlbpr$1s42c$1@portraits.wsisiz.edu.pl> <20200820103955.7c6a9db1@mateusz> <rhli9c$1rre$1@gioia.aioe.org> <rhlnuv$1sr38$1@portraits.wsisiz.edu.pl> <rhlqhc$1suv2$1@portraits.wsisiz.edu.pl> <20200820143649.45b72fab@mateusz> <rhlqua$1svff$1@portraits.wsisiz.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED.user-5-173-128-235.play-internet.pl!not-for-mail
From: RM <robert_magdziarz@wp.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: Re: ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: Nie ma takiego pliku ani katalogu
Date: Thu, 20 Aug 2020 19:33:01 +0200
Organization: http://www.wit.edu.pl
Message-ID: <rhmc4e$1trtj$1@portraits.wsisiz.edu.pl>
References: <rh69ni$21vgn$1@portraits.wsisiz.edu.pl> <20200814200505.3b77dc82@mateusz> <rhiu00$17eoh$1@portraits.wsisiz.edu.pl> <rhlbpr$1s42c$1@portraits.wsisiz.edu.pl> <20200820103955.7c6a9db1@mateusz> <rhli9c$1rre$1@gioia.aioe.org> <rhlnuv$1sr38$1@portraits.wsisiz.edu.pl> <rhlqhc$1suv2$1@portraits.wsisiz.edu.pl> <20200820143649.45b72fab@mateusz> <rhlqua$1svff$1@portraits.wsisiz.edu.pl>
Mime-Version: 1.0
Injection-Date: Thu, 20 Aug 2020 17:33:02 -0000 (UTC)
Injection-Info: portraits.wsisiz.edu.pl; posting-host="user-5-173-128-235.play-internet.pl:5.173.128.235"; logging-data="2027443"; mail-complaints-to="abuse@wsisiz.edu.pl"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1
In-Reply-To: <rhlqua$1svff$1@portraits.wsisiz.edu.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit