gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libobjc2 and hash_table.c


From: bbceler
Subject: Re: libobjc2 and hash_table.c
Date: Thu, 4 Feb 2010 11:45:26 -0800 (PST)

The next problems.
1. During the compilation of the new version libobjc2 two errors  appeared:
class_table.c:36:53: error: passing 'char const *' discards qualifiers,
expected 'void *'
        return class_table_internal_table_get(class_table, class_name);
                                                           ^~~~~~~~~~
and
protocol.c:38:50: error: passing 'char const *' discards qualifiers,
expected 'void *'
        return protocol_table_get(known_protocol_table, protocol_name);
                                                        ^~~~~~~~~~~~~
Compilation with clang and gcc gives the same errors.
In class_table.c I changed line 36 into
return class_table_internal_table_get(class_table, (void *) class_name);
and in protocol.c I changed line 38 into
return protocol_table_get(known_protocol_table, (void *) protocol_name);
And compilation finished without error.
2. 
prg1.m

#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import <Foundation/NSAutoreleasePool.h>

static NSString *str = nil;

int main(int argc, char *argv[])
{
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc ] init];
   str = @"\nPrograming is fun";
   NSLog(@"%@", str);
   [pool drain];
   return 0;
}

# ./prg1
Memory fault (core dumped)
#
# gdb prg1
GNU gdb 6.8 qnx-nto (rev. 347)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-pc-nto-qnx6.4.0"...
(gdb) set solib-search-path /usr/pkg/lib
(gdb) start
Temporary breakpoint 1 at 0x8048708
Starting program: /root/Objc2/1/obj/prg1
[New process 1593400]

Program received signal SIGSEGV, Segmentation fault.
0xb85eca4c in toy_dispatch_async_f (queue=0x0, context=0x80520e8,
    work=0xb8205880 <class_table_internal_table_collect_garbage>) at
toydispatch.c:97
97              while(!__sync_bool_compare_and_swap(&queue->spinlock, 0, 1))
(gdb) where
#0  0xb85eca4c in toy_dispatch_async_f (queue=0x0, context=0x80520e8,
    work=0xb8205880 <class_table_internal_table_collect_garbage>) at
toydispatch.c:99
#1  0xb82066ff in objc_collect_garbage_data (
    cleanup=0xb8205880 <class_table_internal_table_collect_garbage>,
garbage=0x80520e8) at hash_table.c:13
#2  0xb820550a in class_table_internal_table_resize (table=0x80520c0) at
hash_table.h:194
#3  0xb82056d6 in class_table_internal_insert (table=<value optimized out>,
value=<value optimized out>)
    at hash_table.h:302
#4  0xb82051c4 in __objc_add_class_to_hash (class=0xb859eb30) at class.c:153
#5  0xb82081d0 in __objc_exec_class (module=0xb85a16c0) at init.c:607
#6  0xb84e8851 in .objc_load_function () from
/usr/pkg/lib/libgnustep-base.so.1.19
#7  0xb84f3ca6 in __do_global_ctors_aux () from
/usr/pkg/lib/libgnustep-base.so.1.19
#8  0xb82fbfd6 in _init () from /usr/pkg/lib/libgnustep-base.so.1.19
#9  0xb033fafa in init () from /usr/qnx641/target/qnx6/x86/lib/libc.so.3
#10 0xb0342f52 in ldd () from /usr/qnx641/target/qnx6/x86/lib/libc.so.3
#11 0xb033f110 in _start_ () from /usr/qnx641/target/qnx6/x86/lib/libc.so.3
(gdb)

in hash_table.c
   objc_collect_garbage_data (call)-> dispatch_async_f
in toydispatch.c
   dispatch_async_f -> insert_into_queue(queue, work, context);
   insert_into_queue -> lock_queue(queue);
but queue not exist. And I do not know why.




_______________________________________________
Gnustep-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnustep-dev



-- 
View this message in context: 
http://old.nabble.com/libobjc2-and-hash_table.c-tp27396665p27458608.html
Sent from the GNUstep - Dev mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]