-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segment fault in 64bit-mode #87
Comments
Hi, |
@DarkaMaul Thanks for your reply. I noticed your changes about int&long long int in cgc_stdint.h But I got the same segment fault in FUN challenge.
I find the cgc_size_t in libcgc.h. Should I change them into [ long long int ] ?
|
@DarkaMaul for example Segment fault in [XStore] 64bit mode. I fixed the pointer type but got segment fault in another line. So I think that there might be some other parts which should be fixed.
|
I don't have the time to investigate, but here are my observations so far. However, they are indeed a few problems: In #ifdef X32_COMPILE
#define HEADER_PADDING 24
#else
#define HEADER_PADDING 48
#endif The header size was incorrect since it was comprised of multiple pointers. find . -name 'cgc_malloc.h' -exec sed -i "s/\(#define HEADER_PADDING 24\)/#ifdef X32_COMPILE\\n \1\\n#else\\n #define HEADER_PADDING 48\\n#endif/" {} \+ Moreover, an improved version of the #ifdef X32_COMPILE
# define INT_MIN INT32_MIN
# define LONG_MIN INT32_MIN
# define INT_MAX INT32_MAX
# define UINT_MAX UINT32_MAX
# define LONG_MAX INT32_MAX
# define ULONG_MAX UINT32_MAX
typedef int intptr_t;
typedef unsigned int uintptr_t;
#else
# define INT_MIN INT64_MIN
# define LONG_MIN INT64_MIN
# define INT_MAX INT64_MAX
# define UINT_MAX UINT64_MAX
# define LONG_MAX INT64_MAX
# define ULONG_MAX UINT64_MAX
typedef int64_t intptr_t;
typedef uint64_t uintptr_t;
#endif However, it is definitely not the only issue. Multiple structures in I guess it's easier to say that the challenges are "buildable" towards 64 bits architecture but solely for static analysis as they are not yet runnable. |
@DarkaMaul Thank you very very much. I will try to fix them. |
Hi,
In 64bit-mode, a lot of programs will crash with the segment fault at the start of the running. It's nearly all about cgc_memory function.
How to solve this problem?
My env:
OS: Ubuntu 20.04LTS
compiler : clang-7/ clang-10 / gcc-7 / gcc-9
The text was updated successfully, but these errors were encountered: