Skip to content

Instantly share code, notes, and snippets.

@knappador
Last active December 17, 2015 06:28
Show Gist options
  • Save knappador/5565304 to your computer and use it in GitHub Desktop.
Save knappador/5565304 to your computer and use it in GitHub Desktop.
example.c segfault
Reading symbols from /home/knapper/projects/libCello/demos/a.out...done.
(gdb) run
Starting program: /home/knapper/projects/libCello/demos/a.out
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Type: 'Int'
Type: 'Real'
Type: 'String'
Price of a 'Pear' is 55
Price of "Apple" is 12
Price of "Banana" is 6
Price of "Pear" is 55
Program received signal SIGSEGV, Segmentation fault.
Type_Class_Name (self=0x775f6c6169726573,
class_name=class_name@entry=0x7ffff7b6d668 "AsStr",
func=func@entry=0x7ffff7b6e90d <__func__.4599> "as_str",
file=file@entry=0x7ffff7b6e448 "Prelude.c", line=line@entry=339)
at Type.c:83
83 if (t[0].class_object != NULL) {
(gdb) bt
#0 Type_Class_Name (self=0x775f6c6169726573,
class_name=class_name@entry=0x7ffff7b6d668 "AsStr",
func=func@entry=0x7ffff7b6e90d <__func__.4599> "as_str",
file=file@entry=0x7ffff7b6e448 "Prelude.c", line=line@entry=339)
at Type.c:83
#1 0x00007ffff7b6a36c in as_str (self=0x7ffff7b6e9ab <__func__.4681>)
at Prelude.c:339
#2 0x00007ffff7b6530b in print_to_va (out=out@entry=0x7fffffffd390, pos=10,
pos@entry=0,
fmt=0x7ffff7b6ef6b "s' at '%s:%i' :: Type '%s' does not implement class '%s'",
fmt@entry=0x7ffff7b6ef60 "Function '%s' at '%s:%i' :: Type '%s' does not implement class '%s'", va=va@entry=0x7fffffffd3a8) at Format.c:129
#3 0x00007ffff7b644d1 in __exc_throw (obj=<optimized out>,
fmt=fmt@entry=0x7ffff7b6ef60 "Function '%s' at '%s:%i' :: Type '%s' does not implement class '%s'", file=file@entry=0x7ffff7b6ee17 "Type.c",
func=func@entry=0x7ffff7b6eff0 <__func__.3969> "Type_Class_Name",
lineno=lineno@entry=117) at Exception.c:107
#4 0x00007ffff7b6d359 in Type_Class_Name (
self=0x7ffff7d759a0 <__compound_literal.0>,
class_name=class_name@entry=0x7ffff7b6d682 "Serialize",
func=func@entry=0x7ffff7b6e9ab <__func__.4681> "serial_write",
file=file@entry=0x7ffff7b6e448 "Prelude.c", line=line@entry=411)
at Type.c:114
---Type <return> to continue, or q <return> to quit---return
#5 0x00007ffff7b6aa7c in serial_write (self=0x625290, output=0x7fffffffd6a0)
at Prelude.c:411
#6 0x0000000000406307 in __LambdaPlus_write_pair (args=0x7fffffffd560)
at example.c:53
#7 0x00007ffff7b66509 in call_with_ptr (self=self@entry=0x7fffffffd6b0,
args=args@entry=0x7fffffffd590) at Function.c:10
#8 0x00007ffff7b66558 in map (self=0x609070, func=0x7fffffffd6b0)
at Lambda.c:10
#9 0x00000000004066d2 in main (argc=1, argv=0x7fffffffd7f8) at example.c:60
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment