What is causing me to get a Segmentation fault (core dumped)How to debug using gdb?How to generate a core dump in Linux on a segmentation fault?What is a segmentation fault?what is Segmentation fault (core dumped)?Segmentation fault (core dumped)Segmentation fault (Core dumped) - simplePointers - Segmentation fault (core dumped)Show “ Segmentation fault ” on cygwinC - Segmentation Fault (core dumped)Segmentation fault with no parameters on main( )C strcpy() copies string literals without segmentation fault
Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?
noalign caused by multirow and colors
Why is the length of the Kelvin unit of temperature equal to that of the Celsius unit?
So a part of my house disappeared... But not because of a chunk resetting
Is it possible to have 2 different but equal size real number sets that have the same mean and standard deviation?
How to create a cubic equation that include sums of the roots of another cubic equation
bash vs. zsh: What are the practical differences?
Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?
Tikz-cd diagram arrow passing under a node - not crossing it
Was planting UN flag on Moon ever discussed?
The significance of kelvin as a unit of absolute temperature
What is the reason for setting flaps 1 on the ground at high temperatures?
Transfer custom ringtones to iPhone using a computer running Linux
C++ logging library
The origin of the Russian proverb about two hares
Why do radiation hardened IC packages often have long leads?
Zig-zag function - coded solution
What should I discuss with my DM prior to my first game?
Proving that a Russian cryptographic standard is too structured
Why ambiguous grammars are bad?
What's the meaning of the expression "short circuit" in the text bellow?
As easy as Three, Two, One... How fast can you go from Five to Four?
That's not my X, its Y is too Z
How can powerful telekinesis avoid violating Newton's 3rd Law?
What is causing me to get a Segmentation fault (core dumped)
How to debug using gdb?How to generate a core dump in Linux on a segmentation fault?What is a segmentation fault?what is Segmentation fault (core dumped)?Segmentation fault (core dumped)Segmentation fault (Core dumped) - simplePointers - Segmentation fault (core dumped)Show “ Segmentation fault ” on cygwinC - Segmentation Fault (core dumped)Segmentation fault with no parameters on main( )C strcpy() copies string literals without segmentation fault
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm reading a book on coding an operating system and I'm writing the C code examples they have in the book and compiling and testing the code in the terminal but I ran into a problem with this code.
The file with this code in it is named "hello.c".
I compiled the file with "gcc hello.c -o hello
"
and then ran it with "./hello
".
I received the message Segmentation fault (core dumped),
and I'm unsure of what I'm doing wrong.
#include <stdio.h>
void preinit1()
printf("%sn", __FUNCTION__);
void preinit2()
printf("%sn", __FUNCTION__);
void init1()
printf("%sn", __FUNCTION__);
void init2()
printf("%sn", __FUNCTION__);
typedef void (*preinit)();
typedef void (*init)();
__attribute__((section(".init_array"))) preinit
preinit_arr[2] = preinit1, preinit2;
__attribute__((section(".init_array"))) init
init_arr[2] = init1, init2;
int main(int argc, char *argv[])
printf("hello world!n");
return 0;
c linux fault
add a comment |
I'm reading a book on coding an operating system and I'm writing the C code examples they have in the book and compiling and testing the code in the terminal but I ran into a problem with this code.
The file with this code in it is named "hello.c".
I compiled the file with "gcc hello.c -o hello
"
and then ran it with "./hello
".
I received the message Segmentation fault (core dumped),
and I'm unsure of what I'm doing wrong.
#include <stdio.h>
void preinit1()
printf("%sn", __FUNCTION__);
void preinit2()
printf("%sn", __FUNCTION__);
void init1()
printf("%sn", __FUNCTION__);
void init2()
printf("%sn", __FUNCTION__);
typedef void (*preinit)();
typedef void (*init)();
__attribute__((section(".init_array"))) preinit
preinit_arr[2] = preinit1, preinit2;
__attribute__((section(".init_array"))) init
init_arr[2] = init1, init2;
int main(int argc, char *argv[])
printf("hello world!n");
return 0;
c linux fault
ericlippert.com/2014/03/05/how-to-debug-small-programs stackoverflow.com/questions/2069367/how-to-debug-using-gdb
– Yunnosch
Mar 24 at 22:02
2
Isstdout
initialized when the various initialization functions are called, or are they called before the system library is initialized? Have you tried usingwrite(0, __FUNCTION__, strlen(__FUNCTION__));
instead ofprintf()
? (That omits the newlines; they're a nicety that can be foregone, temporarily.)
– Jonathan Leffler
Mar 24 at 22:07
add a comment |
I'm reading a book on coding an operating system and I'm writing the C code examples they have in the book and compiling and testing the code in the terminal but I ran into a problem with this code.
The file with this code in it is named "hello.c".
I compiled the file with "gcc hello.c -o hello
"
and then ran it with "./hello
".
I received the message Segmentation fault (core dumped),
and I'm unsure of what I'm doing wrong.
#include <stdio.h>
void preinit1()
printf("%sn", __FUNCTION__);
void preinit2()
printf("%sn", __FUNCTION__);
void init1()
printf("%sn", __FUNCTION__);
void init2()
printf("%sn", __FUNCTION__);
typedef void (*preinit)();
typedef void (*init)();
__attribute__((section(".init_array"))) preinit
preinit_arr[2] = preinit1, preinit2;
__attribute__((section(".init_array"))) init
init_arr[2] = init1, init2;
int main(int argc, char *argv[])
printf("hello world!n");
return 0;
c linux fault
I'm reading a book on coding an operating system and I'm writing the C code examples they have in the book and compiling and testing the code in the terminal but I ran into a problem with this code.
The file with this code in it is named "hello.c".
I compiled the file with "gcc hello.c -o hello
"
and then ran it with "./hello
".
I received the message Segmentation fault (core dumped),
and I'm unsure of what I'm doing wrong.
#include <stdio.h>
void preinit1()
printf("%sn", __FUNCTION__);
void preinit2()
printf("%sn", __FUNCTION__);
void init1()
printf("%sn", __FUNCTION__);
void init2()
printf("%sn", __FUNCTION__);
typedef void (*preinit)();
typedef void (*init)();
__attribute__((section(".init_array"))) preinit
preinit_arr[2] = preinit1, preinit2;
__attribute__((section(".init_array"))) init
init_arr[2] = init1, init2;
int main(int argc, char *argv[])
printf("hello world!n");
return 0;
c linux fault
c linux fault
edited Mar 24 at 22:42
Cryoexn
asked Mar 24 at 21:57
CryoexnCryoexn
135
135
ericlippert.com/2014/03/05/how-to-debug-small-programs stackoverflow.com/questions/2069367/how-to-debug-using-gdb
– Yunnosch
Mar 24 at 22:02
2
Isstdout
initialized when the various initialization functions are called, or are they called before the system library is initialized? Have you tried usingwrite(0, __FUNCTION__, strlen(__FUNCTION__));
instead ofprintf()
? (That omits the newlines; they're a nicety that can be foregone, temporarily.)
– Jonathan Leffler
Mar 24 at 22:07
add a comment |
ericlippert.com/2014/03/05/how-to-debug-small-programs stackoverflow.com/questions/2069367/how-to-debug-using-gdb
– Yunnosch
Mar 24 at 22:02
2
Isstdout
initialized when the various initialization functions are called, or are they called before the system library is initialized? Have you tried usingwrite(0, __FUNCTION__, strlen(__FUNCTION__));
instead ofprintf()
? (That omits the newlines; they're a nicety that can be foregone, temporarily.)
– Jonathan Leffler
Mar 24 at 22:07
ericlippert.com/2014/03/05/how-to-debug-small-programs stackoverflow.com/questions/2069367/how-to-debug-using-gdb
– Yunnosch
Mar 24 at 22:02
ericlippert.com/2014/03/05/how-to-debug-small-programs stackoverflow.com/questions/2069367/how-to-debug-using-gdb
– Yunnosch
Mar 24 at 22:02
2
2
Is
stdout
initialized when the various initialization functions are called, or are they called before the system library is initialized? Have you tried using write(0, __FUNCTION__, strlen(__FUNCTION__));
instead of printf()
? (That omits the newlines; they're a nicety that can be foregone, temporarily.)– Jonathan Leffler
Mar 24 at 22:07
Is
stdout
initialized when the various initialization functions are called, or are they called before the system library is initialized? Have you tried using write(0, __FUNCTION__, strlen(__FUNCTION__));
instead of printf()
? (That omits the newlines; they're a nicety that can be foregone, temporarily.)– Jonathan Leffler
Mar 24 at 22:07
add a comment |
1 Answer
1
active
oldest
votes
I don't think you're supposed to add arrays to the section (you've an error in the example, initializing the .init_array
twice).
__attribute__((section(".preinit_array"))) preinit preinit_arr1 = preinit1;
__attribute__((section(".preinit_array"))) preinit preinit_arr2 = preinit2;
__attribute__((section(".init_array"))) init init_arr1 = init1;
__attribute__((section(".init_array"))) init init_arr2 = init2;
This is the section declared using arrays
objdump -s -j .init_array hello.orig
hello.orig: file format elf64-x86-64
Contents of section .init_array:
3dc0 30110000 00000000 00000000 00000000 0...............
3dd0 35110000 00000000 48110000 00000000 5.......H.......
3de0 5b110000 00000000 6e110000 00000000 [.......n.......
This is the section that works
objdump -s -j .init_array hello
hello: file format elf64-x86-64
Contents of section .init_array:
3dc8 30110000 00000000 35110000 00000000 0.......5.......
3dd8 48110000 00000000 5b110000 00000000 H.......[.......
3de8 6e110000 00000000 n.......
In the former there's the null pointer at 3dc8 that probably cause the segmentation (see below), I have no idea why is there maybe somebody other can explain.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00005555555551f5 in __libc_csu_init ()
#2 0x00007ffff7dec02a in __libc_start_main (main=0x555555555181 <main>, argc=1, argv=0x7fffffffe1f8, init=0x5555555551b0 <__libc_csu_init>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe1e8) at ../csu/libc-start.c:264
#3 0x000055555555507a in _start ()
Fixing only the typo about .preinit_array
make the preinit calls work but not the init
Changing these from arrays worked. I don't know why they have it in the book as arrays but when I changed them I got the same output as the book shows. Thank you.
– Cryoexn
Mar 24 at 22:55
Weird, books examples are supposed to work, maybe something changed with gcc and how it layout the array in the section
– Alex
Mar 24 at 23:00
I just looked at the book again after thinking about what you said. They show in the book code that you are supposed to add the arrays into the.init_array
section but before the code they say to use the.preinit_array
section. so it was a book typo but without you mentioning not being able to add arrays to that section I wouldn't have noticed.)
– Cryoexn
Mar 24 at 23:06
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328961%2fwhat-is-causing-me-to-get-a-segmentation-fault-core-dumped%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I don't think you're supposed to add arrays to the section (you've an error in the example, initializing the .init_array
twice).
__attribute__((section(".preinit_array"))) preinit preinit_arr1 = preinit1;
__attribute__((section(".preinit_array"))) preinit preinit_arr2 = preinit2;
__attribute__((section(".init_array"))) init init_arr1 = init1;
__attribute__((section(".init_array"))) init init_arr2 = init2;
This is the section declared using arrays
objdump -s -j .init_array hello.orig
hello.orig: file format elf64-x86-64
Contents of section .init_array:
3dc0 30110000 00000000 00000000 00000000 0...............
3dd0 35110000 00000000 48110000 00000000 5.......H.......
3de0 5b110000 00000000 6e110000 00000000 [.......n.......
This is the section that works
objdump -s -j .init_array hello
hello: file format elf64-x86-64
Contents of section .init_array:
3dc8 30110000 00000000 35110000 00000000 0.......5.......
3dd8 48110000 00000000 5b110000 00000000 H.......[.......
3de8 6e110000 00000000 n.......
In the former there's the null pointer at 3dc8 that probably cause the segmentation (see below), I have no idea why is there maybe somebody other can explain.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00005555555551f5 in __libc_csu_init ()
#2 0x00007ffff7dec02a in __libc_start_main (main=0x555555555181 <main>, argc=1, argv=0x7fffffffe1f8, init=0x5555555551b0 <__libc_csu_init>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe1e8) at ../csu/libc-start.c:264
#3 0x000055555555507a in _start ()
Fixing only the typo about .preinit_array
make the preinit calls work but not the init
Changing these from arrays worked. I don't know why they have it in the book as arrays but when I changed them I got the same output as the book shows. Thank you.
– Cryoexn
Mar 24 at 22:55
Weird, books examples are supposed to work, maybe something changed with gcc and how it layout the array in the section
– Alex
Mar 24 at 23:00
I just looked at the book again after thinking about what you said. They show in the book code that you are supposed to add the arrays into the.init_array
section but before the code they say to use the.preinit_array
section. so it was a book typo but without you mentioning not being able to add arrays to that section I wouldn't have noticed.)
– Cryoexn
Mar 24 at 23:06
add a comment |
I don't think you're supposed to add arrays to the section (you've an error in the example, initializing the .init_array
twice).
__attribute__((section(".preinit_array"))) preinit preinit_arr1 = preinit1;
__attribute__((section(".preinit_array"))) preinit preinit_arr2 = preinit2;
__attribute__((section(".init_array"))) init init_arr1 = init1;
__attribute__((section(".init_array"))) init init_arr2 = init2;
This is the section declared using arrays
objdump -s -j .init_array hello.orig
hello.orig: file format elf64-x86-64
Contents of section .init_array:
3dc0 30110000 00000000 00000000 00000000 0...............
3dd0 35110000 00000000 48110000 00000000 5.......H.......
3de0 5b110000 00000000 6e110000 00000000 [.......n.......
This is the section that works
objdump -s -j .init_array hello
hello: file format elf64-x86-64
Contents of section .init_array:
3dc8 30110000 00000000 35110000 00000000 0.......5.......
3dd8 48110000 00000000 5b110000 00000000 H.......[.......
3de8 6e110000 00000000 n.......
In the former there's the null pointer at 3dc8 that probably cause the segmentation (see below), I have no idea why is there maybe somebody other can explain.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00005555555551f5 in __libc_csu_init ()
#2 0x00007ffff7dec02a in __libc_start_main (main=0x555555555181 <main>, argc=1, argv=0x7fffffffe1f8, init=0x5555555551b0 <__libc_csu_init>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe1e8) at ../csu/libc-start.c:264
#3 0x000055555555507a in _start ()
Fixing only the typo about .preinit_array
make the preinit calls work but not the init
Changing these from arrays worked. I don't know why they have it in the book as arrays but when I changed them I got the same output as the book shows. Thank you.
– Cryoexn
Mar 24 at 22:55
Weird, books examples are supposed to work, maybe something changed with gcc and how it layout the array in the section
– Alex
Mar 24 at 23:00
I just looked at the book again after thinking about what you said. They show in the book code that you are supposed to add the arrays into the.init_array
section but before the code they say to use the.preinit_array
section. so it was a book typo but without you mentioning not being able to add arrays to that section I wouldn't have noticed.)
– Cryoexn
Mar 24 at 23:06
add a comment |
I don't think you're supposed to add arrays to the section (you've an error in the example, initializing the .init_array
twice).
__attribute__((section(".preinit_array"))) preinit preinit_arr1 = preinit1;
__attribute__((section(".preinit_array"))) preinit preinit_arr2 = preinit2;
__attribute__((section(".init_array"))) init init_arr1 = init1;
__attribute__((section(".init_array"))) init init_arr2 = init2;
This is the section declared using arrays
objdump -s -j .init_array hello.orig
hello.orig: file format elf64-x86-64
Contents of section .init_array:
3dc0 30110000 00000000 00000000 00000000 0...............
3dd0 35110000 00000000 48110000 00000000 5.......H.......
3de0 5b110000 00000000 6e110000 00000000 [.......n.......
This is the section that works
objdump -s -j .init_array hello
hello: file format elf64-x86-64
Contents of section .init_array:
3dc8 30110000 00000000 35110000 00000000 0.......5.......
3dd8 48110000 00000000 5b110000 00000000 H.......[.......
3de8 6e110000 00000000 n.......
In the former there's the null pointer at 3dc8 that probably cause the segmentation (see below), I have no idea why is there maybe somebody other can explain.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00005555555551f5 in __libc_csu_init ()
#2 0x00007ffff7dec02a in __libc_start_main (main=0x555555555181 <main>, argc=1, argv=0x7fffffffe1f8, init=0x5555555551b0 <__libc_csu_init>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe1e8) at ../csu/libc-start.c:264
#3 0x000055555555507a in _start ()
Fixing only the typo about .preinit_array
make the preinit calls work but not the init
I don't think you're supposed to add arrays to the section (you've an error in the example, initializing the .init_array
twice).
__attribute__((section(".preinit_array"))) preinit preinit_arr1 = preinit1;
__attribute__((section(".preinit_array"))) preinit preinit_arr2 = preinit2;
__attribute__((section(".init_array"))) init init_arr1 = init1;
__attribute__((section(".init_array"))) init init_arr2 = init2;
This is the section declared using arrays
objdump -s -j .init_array hello.orig
hello.orig: file format elf64-x86-64
Contents of section .init_array:
3dc0 30110000 00000000 00000000 00000000 0...............
3dd0 35110000 00000000 48110000 00000000 5.......H.......
3de0 5b110000 00000000 6e110000 00000000 [.......n.......
This is the section that works
objdump -s -j .init_array hello
hello: file format elf64-x86-64
Contents of section .init_array:
3dc8 30110000 00000000 35110000 00000000 0.......5.......
3dd8 48110000 00000000 5b110000 00000000 H.......[.......
3de8 6e110000 00000000 n.......
In the former there's the null pointer at 3dc8 that probably cause the segmentation (see below), I have no idea why is there maybe somebody other can explain.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00005555555551f5 in __libc_csu_init ()
#2 0x00007ffff7dec02a in __libc_start_main (main=0x555555555181 <main>, argc=1, argv=0x7fffffffe1f8, init=0x5555555551b0 <__libc_csu_init>,
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe1e8) at ../csu/libc-start.c:264
#3 0x000055555555507a in _start ()
Fixing only the typo about .preinit_array
make the preinit calls work but not the init
edited Mar 24 at 23:21
answered Mar 24 at 22:50
AlexAlex
2,67011532
2,67011532
Changing these from arrays worked. I don't know why they have it in the book as arrays but when I changed them I got the same output as the book shows. Thank you.
– Cryoexn
Mar 24 at 22:55
Weird, books examples are supposed to work, maybe something changed with gcc and how it layout the array in the section
– Alex
Mar 24 at 23:00
I just looked at the book again after thinking about what you said. They show in the book code that you are supposed to add the arrays into the.init_array
section but before the code they say to use the.preinit_array
section. so it was a book typo but without you mentioning not being able to add arrays to that section I wouldn't have noticed.)
– Cryoexn
Mar 24 at 23:06
add a comment |
Changing these from arrays worked. I don't know why they have it in the book as arrays but when I changed them I got the same output as the book shows. Thank you.
– Cryoexn
Mar 24 at 22:55
Weird, books examples are supposed to work, maybe something changed with gcc and how it layout the array in the section
– Alex
Mar 24 at 23:00
I just looked at the book again after thinking about what you said. They show in the book code that you are supposed to add the arrays into the.init_array
section but before the code they say to use the.preinit_array
section. so it was a book typo but without you mentioning not being able to add arrays to that section I wouldn't have noticed.)
– Cryoexn
Mar 24 at 23:06
Changing these from arrays worked. I don't know why they have it in the book as arrays but when I changed them I got the same output as the book shows. Thank you.
– Cryoexn
Mar 24 at 22:55
Changing these from arrays worked. I don't know why they have it in the book as arrays but when I changed them I got the same output as the book shows. Thank you.
– Cryoexn
Mar 24 at 22:55
Weird, books examples are supposed to work, maybe something changed with gcc and how it layout the array in the section
– Alex
Mar 24 at 23:00
Weird, books examples are supposed to work, maybe something changed with gcc and how it layout the array in the section
– Alex
Mar 24 at 23:00
I just looked at the book again after thinking about what you said. They show in the book code that you are supposed to add the arrays into the
.init_array
section but before the code they say to use the .preinit_array
section. so it was a book typo but without you mentioning not being able to add arrays to that section I wouldn't have noticed.)– Cryoexn
Mar 24 at 23:06
I just looked at the book again after thinking about what you said. They show in the book code that you are supposed to add the arrays into the
.init_array
section but before the code they say to use the .preinit_array
section. so it was a book typo but without you mentioning not being able to add arrays to that section I wouldn't have noticed.)– Cryoexn
Mar 24 at 23:06
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328961%2fwhat-is-causing-me-to-get-a-segmentation-fault-core-dumped%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
ericlippert.com/2014/03/05/how-to-debug-small-programs stackoverflow.com/questions/2069367/how-to-debug-using-gdb
– Yunnosch
Mar 24 at 22:02
2
Is
stdout
initialized when the various initialization functions are called, or are they called before the system library is initialized? Have you tried usingwrite(0, __FUNCTION__, strlen(__FUNCTION__));
instead ofprintf()
? (That omits the newlines; they're a nicety that can be foregone, temporarily.)– Jonathan Leffler
Mar 24 at 22:07