Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Illegal instruction: 4

Name: Anonymous 2019-07-23 22:38

I get that "Illegal instruction: 4" while trying to run qsort. But mergesort works fine. LLVM is a pile of shit.

Name: Anonymous 2019-07-23 23:47

Post your code, you are doing something wrong.

Name: Anonymous 2019-07-24 1:14

Java doesn't have this problem.

Name: Anonymous 2019-07-24 7:17

>>2
I passed it array of pointers, and forgot to de-reference them in comparator routine, so it compared the pointers themselves instead of floats. Resulting in garbled output, crashes from time to time, with this "Illegal instruction: 4", instead of usual "segmentation fault". Mergesort has different access pattern so it wasn't triggering it.

Name: Anonymous 2019-07-24 7:30

You fool.

Name: Anonymous 2019-07-24 22:56

>>4
how is this the compiler's fault? pebcak nigger

Name: Anonymous 2019-07-25 6:23

>>6
compiler should detect that programer is an anus

Name: Anonymous 2019-07-25 6:34

>>7
Yeah, some chair problems are harder than thinking straight.

Name: Anonymous 2019-07-25 8:13

>>6
segfault shouldn't be reported as "Illegal instruction: 4"

Name: Anonymous 2019-07-25 8:20

HIBT? this isn't segfault, retard. segfault means that your're are reading/writing/executing memory that you can't read/write/execute. illegal instruction menas that your're are executing invalid opcodes. you might have made an unaligned jump into a middle of instruction, for example Edited on 25/07/2019 08:21.

Name: Anonymous 2019-07-25 8:22

illegal instruction, legal dubs

Name: Anonymous 2019-07-25 8:48

>>10
That can't happen in qsort, which doesn't write to stack.

Name: Anonymous 2019-07-25 8:49

>>12
isn't qsort recursive?

Name: Anonymous 2019-07-25 8:53

>>12
IIRC qsort sorts arrays in place, so if your're are sorting stack arrays then it will write to stack

Name: Anonymous 2019-07-25 9:05

>>14
Nope. The array is malloced. And that "Illegal instruction: 4" happened inside comparing routine, on read, not write. Comparing code had no writes.

Name: Anonymous 2019-07-25 9:09

>>15
just run gdb and see what the pc is pointing at with illegal instruction, it's not that hard. or compile with ASAN

Name: Anonymous 2019-07-25 11:35

>>16
$ gdb
-bash: gdb: command not found
$ uname -a
Darwin MacBook-Pro-MacBook.local 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64

Name: Anonymous 2019-07-25 11:42

>>17
now you have two problems!

Name: Anonymous 2019-07-25 18:27

>>17
try
lldb

Name: Anonymous 2019-07-25 20:03

Illegal = go to jail
>>1
Pay the fine o p

Name: Anonymous 2019-07-25 20:29

LMAO. OP could have saved his humility by just posting his shit code.

Name: Anonymous 2019-07-26 6:53

OP doesn't deserve those doubles

Name: Anonymous 2019-07-31 18:00

Did you try writing it in Scheme?

Name: Anonymous 2019-07-31 18:04

>>23
Scheme is Immutable. Only static code.

Name: Anonymous 2019-07-31 21:29

Name: Anonymous 2019-08-01 5:43

>>25
Disgusting.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List