Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » U++ 2019.1.rc4 released
Re: U++ 2019.1.rc4 released [message #51620 is a reply to message #51618] Sat, 20 April 2019 01:06 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Will check all those too, but

Ops.h:3:51: runtime error: load of misaligned address

(and stores)

- that one is impossible to fix, it is meant to be.

Note #ifdef CPU_UNALIGNED before it...

Mirek
Re: U++ 2019.1.rc4 released [message #51621 is a reply to message #51620] Sat, 20 April 2019 04:46 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Fri, 19 April 2019 19:06
Will check all those too, but

Ops.h:3:51: runtime error: load of misaligned address

(and stores)

- that one is impossible to fix, it is meant to be.

Note #ifdef CPU_UNALIGNED before it...

Mirek


Do you mind adding code below to Defs.h and marking PeekXXle and PokeXXle with NO_UBSAN ?
// ***** Sanitizer-related
#if defined(__has_feature)

#if __has_feature(address_sanitizer)
  #define NO_ASAN __attribute__((no_sanitize_address))
#else
  #define NO_ASAN
#endif

#if __has_feature(memory_sanitizer)
  #define NO_MSAN __attribute__((no_sanitize_memory))
#else
  #define NO_MSAN
#endif

#else

// gcc doesn't have __has_feature
#if defined (__GNUC__)
  #define NO_ASAN __attribute__((no_sanitize_address))
#else
  #define NO_ASAN
#endif

  // gcc doesn't support memory sanitizer.
  #define NO_MSAN
  // gcc doesn't support safe-stack sanitizer.
  // gcc doesn't support shadow-call-stack sanitizer.
  
#endif

#if defined(__clang__) || defined (__GNUC__)
  #define NO_UBSAN __attribute__((no_sanitize("undefined")))
#else
  #define NO_UBSAN
#endif

Thank you in advance.


Regards,
Novo
Re: U++ 2019.1.rc4 released [message #51627 is a reply to message #51615] Mon, 22 April 2019 11:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Sat, 20 April 2019 00:33
I do not know what is wrong with the GUI_APP_MAIN, but I'm getting 1.2 Mb of complains from valgrind. Please check attached file.


Looks like something that affects menu item enabling is not initialized in OC class...

Mirek
Re: U++ 2019.1.rc4 released [message #51628 is a reply to message #51616] Mon, 22 April 2019 11:08 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
"__interceptor_malloc" - It is very unlikely that U++ called that malloc (normally we do not allocated memory via malloc).
Re: U++ 2019.1.rc4 released [message #51646 is a reply to message #51628] Tue, 23 April 2019 09:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
TheIDE now seems to run 'ubsan clean' (with GCC), but I really have mixed feeling about santizing bools:

struct Foo { bool a, b; };

Foo a, b;

a = b;


Above code fails with ubsan, as a / b are uninitialized. In practice this means you have to initialize all bool member variables if the struct is to be copied even if code logic absolutely does not need it....

[Updated on: Tue, 23 April 2019 09:54]

Report message to a moderator

Re: U++ 2019.1.rc4 released [message #51653 is a reply to message #51628] Tue, 23 April 2019 15:05 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Mon, 22 April 2019 05:08
"__interceptor_malloc" - It is very unlikely that U++ called that malloc (normally we do not allocated memory via malloc).

I'm using standard allocator with static build + shared libraries. Otherwise it won't link.
"All shared" will link fine with U++ allocator, if I remember correctly.


Regards,
Novo
Re: U++ 2019.1.rc4 released [message #51654 is a reply to message #51646] Tue, 23 April 2019 15:33 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Tue, 23 April 2019 03:53
TheIDE now seems to run 'ubsan clean' (with GCC), but I really have mixed feeling about santizing bools:

struct Foo { bool a, b; };

Foo a, b;

a = b;


Above code fails with ubsan, as a / b are uninitialized. In practice this means you have to initialize all bool member variables if the struct is to be copied even if code logic absolutely does not need it....

I'm personally not getting any messages with ubsan + gcc + C++17 + Debug in this case. Everything is clean.
I'm getting them with ubsan + clang + C++17 + Debug.
/home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Hash.cpp:308:33: runtime error: load of misaligned address 0x0000008c646e for type 'const unsigned int', which requires 4 byte alignment
0x0000008c646e: note: pointer points here
 41 47 45 00 45 6d  70 74 79 20 64 72 69 76  65 00 44 72 69 76 65 20  76 61 63 c3 ad 6f 00 4c  65 65
             ^ 
/home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Ops.h:7:63: runtime error: store to misaligned address 0x7f7ca993b222 for type 'Upp::dword' (aka 'unsigned int'), which requires 4 byte alignment
0x7f7ca993b222: note: pointer points here
 65 65  46 72 65 65 46 72 65 65  46 72 65 65 46 72 65 65  46 72 65 65 46 72 65 65  46 72 65 65 46 72
              ^ 
/home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Ops.h:3:59: runtime error: load of misaligned address 0x7f7ca993b222 for type 'const Upp::dword' (aka 'const unsigned int'), which requires 4 byte alignment
0x7f7ca993b222: note: pointer points here
 35 00  46 72 fe 4c 6c 56 65 65  46 72 65 65 46 72 65 65  46 72 65 65 46 72 65 65  46 72 65 65 46 72
              ^ 

It doesn't look like NOUBSAN is defined for Clang.

I'm also getting a bunch of warnings with Clang + C++17.
In file included from /home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Core.h:280:
/home/ssg/dvlp/cpp/upp/git/uppsrc/Core/Stream.h:94:141: warning: add explicit braces to avoid dangling else [-Wdangling-else]
        void      Put(const void *data, int size)  { ASSERT(size >= 0); if(size) if(ptr + size <= wrlim) { memcpy(ptr, data, size);
     ptr += size; } else _Put(data, size); }


One of the reasons why I'm using Clang on Linux is because it has the best support for sanitizers.

I attached my project and build methods for clang and gcc.


Regards,
Novo
Re: U++ 2019.1.rc4 released [message #51655 is a reply to message #51646] Tue, 23 April 2019 15:36 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Tue, 23 April 2019 03:53
TheIDE now seems to run 'ubsan clean' (with GCC)

Thank you very much!


Regards,
Novo
Previous Topic: Dark theme support changes
Next Topic: U++ 2019.1.rc1 released
Goto Forum:
  


Current Time: Thu Mar 28 10:58:44 CET 2024

Total time taken to generate the page: 0.01643 seconds