Manually loading shared object

This forum is for general developer support questions.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Manually loading shared object

Post by broadblues »

softwarefailure wrote:
broadblues wrote: The plugin itself is compiled withy newib? Given that -nostartfiles is inuse I presume you have explicitly added -lc ?
Yes. And I open newlib.library in the plugin. This is working. I can call printf() and the output is presented in a window opened by newlib.
Ok.
If the constructors in the shared library are called by DLOpen() and those construtors reference a libc function that would possibly cause a crash if omitted.
Don't understand what you're trying to say here, please explain :)
Shared objects have an init list of contructor functions that are caled on startup, for example an implmentations libz.so might open z.library in a constructor. I'm assuming that DLOpen() will call these constructors in place of the normal startup code when it opens the shared object. If libc was referenced but not linked it might crash, but since you say that can safely use libc all should be well i that regard.

Still it is crashing when doing DLOpen() on libSDL2.so. The same code works when using a little test program. It only crashes when DLOpen() is called from my plugin.
How exactly does it crash? Log available?
softwarefailure
Posts: 112
Joined: Fri Feb 14, 2014 10:29 pm

Re: Manually loading shared object

Post by softwarefailure »

Here is the crash log:

Code: Select all

Crash log for task "hollywood"
Generated by GrimReaper 53.19
Crash occured in module libc.so at address 0x7EF32A08
Type of crash: DSI (Data Storage Interrupt) exception
Alert number: 0x80000003

Register dump:
GPR (General Purpose Registers):
   0: 01B9D094 69257B20 94688794 69257B58 00000000 680F6B78 00000001 00000000 
   8: FFFFFFE0 00000008 00000000 00000000 00000ADC 89956A88 692580F8 69258544 
  16: 69257C80 69257C84 69257C88 69257C8C 6982F090 69702EA0 69257C90 80000FA1 
  24: 80000FA2 80000FA9 6BF5368C 680F6B40 680F6B78 68010E30 7FC8C0C8 7FC84214 


FPR (Floating Point Registers, NaN = Not a Number):
   0:              nan                0              127              127 
   4:              127              127              127              127 
   8:       4.5036e+15            1.225          29.0117       4.5036e+15 
  12:         -46.4912              127                0                0 
  16:                0                0                0                0 
  20:                0                0                0                0 
  24:                0                0                0                0 
  28:                0                0                0                0 

FPSCR (Floating Point Status and Control Register): 0x82024000


SPRs (Special Purpose Registers):
           Machine State (msr) : 0x0200F030
                Condition (cr) : 0x680BDDA0
      Instruction Pointer (ip) : 0x7EF32A08
       Xtended Exception (xer) : 0x01827214
                   Count (ctr) : 0x00000000
                     Link (lr) : 0x00000000
            DSI Status (dsisr) : 0x01846994
            Data Address (dar) : 0x00000000



680x0 emulated registers:
DATA: 6C58758E 00000003 00000000 00000000 00000000 00000000 00000000 00000000 
ADDR: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 692583A0 
FPU0:                0                0                0                0 
FPU4:                0                0                0                0 



Symbol info:
Instruction pointer 0x7EF32A08 belongs to module "libc.so" (PowerPC) 
Symbol: __NewlibCall + 0x4 in section 9 offset 0x00000CBC

Stack trace:
    OS4:SObjs/libc.so:__NewlibCall()+0x4 (section 9 @ 0xCBC)
    [source/linklib/lib.c:95] OS4:SObjs/libpthread.so:__init_threads()+0x100 (section 8 @ 0x653C)
    native kernel module elf.library.kmod+0x000060cc
    native kernel module elf.library.kmod+0x000061ec
    module LIBS:Hollywood/rebelsdl.hwp at 0x7FB626A0 (section 5 @ 0x67C)
    module LIBS:Hollywood/rebelsdl.hwp at 0x7FB64A88 (section 5 @ 0x2A64)
    module hollywood at 0x7FA4999C (section 5 @ 0x154978)
    module hollywood at 0x7F942D8C (section 5 @ 0x4DD68)
    module hollywood at 0x7F94315C (section 5 @ 0x4E138)
    module hollywood at 0x7F943240 (section 5 @ 0x4E21C)
    module hollywood at 0x7F8F57B8 (section 5 @ 0x794)
    module hollywood at 0x7F8FC990 (section 5 @ 0x796C)
    module hollywood at 0x7FA565FC (section 5 @ 0x1615D8)
    module hollywood at 0x7FB08924 (section 5 @ 0x213900)
    module hollywood at 0x7FB0B1E8 (section 5 @ 0x2161C4)
    0xFFCFCFCF symbol not available

PPC disassembly:
 7ef32a00: 4bfffe78   b                 0x7EF32878
 7ef32a04: 3d600000   lis               r11,0
*7ef32a08: 800b0000   lwz               r0,0(r11)
 7ef32a0c: 7d6c002e   lwzx              r11,r12,r0
 7ef32a10: 7d6903a6   mtctr             r11

System information:

CPU 
 Model: Motorola MPC 7447/7457 Apollo V1.1 
 CPU speed: 999 MHz 
 FSB speed: 133 MHz 
 Extensions: performancemonitor altivec 

Machine 
 Machine name: Pegasos II 
 Memory: 524288 KB 
 Extensions: bus.pci bus.agp 

Expansion buses 
 PCI/AGP 
  00:00.0 Vendor 0x11AB Device 0x6460 
  00:01.0 Vendor 0x1106 Device 0x3044 
   Range 0: 80000000 - 80000800 (MEM) 
   Range 1: 00001080 - 00001100 (IO) 
  00:0C.0 Vendor 0x1106 Device 0x8231 
  00:0C.1 Vendor 0x1106 Device 0x0571 
   Range 0: 00001000 - 00001008 (IO) 
   Range 1: 00001008 - 0000100C (IO) 
   Range 2: 00001010 - 00001018 (IO) 
   Range 3: 00001018 - 0000101C (IO) 
   Range 4: 00001020 - 00001030 (IO) 
  00:0C.2 Vendor 0x1106 Device 0x3038 
   Range 4: 00001040 - 00001060 (IO) 
  00:0C.3 Vendor 0x1106 Device 0x3038 
   Range 4: 00001060 - 00001080 (IO) 
  00:0C.4 Vendor 0x1106 Device 0x8235 
  00:0C.5 Vendor 0x1106 Device 0x3058 
   Range 0: 00001100 - 00001200 (IO) 
   Range 1: 00001030 - 00001034 (IO) 
   Range 2: 00001030 - 00001034 (IO) 
  00:0C.6 Vendor 0x1106 Device 0x3068 
   Range 0: 00001200 - 00001300 (IO) 
  00:0D.0 Vendor 0x1106 Device 0x3065 
   Range 0: 00001300 - 00001400 (IO) 
   Range 1: 80000800 - 80000900 (MEM) 
  01:00.0 Vendor 0x11AB Device 0x6460 
  01:08.0 Vendor 0x1002 Device 0x5960 
   Range 0: C0000000 - C8000000 (PREF.MEM) 
   Range 1: 00001000 - 00001100 (IO) 
   Range 2: C8000000 - C8010000 (MEM) 
  01:08.1 Vendor 0x1002 Device 0x5940 
   Range 0: D0000000 - D8000000 (PREF.MEM) 
   Range 1: C8010000 - C8020000 (MEM) 

Libraries 
 0x6c5b9748: ISO-8859-15.charset V52.1 
 0x6c547358: german_ISO-8859-15.language V52.1 
 0x021c66c2: exec.library V53.89 
 0x6ff844f8: cgxvideo.library V42.1 
 0x681ae7a8: pthreads.library V53.11 
 0x6c13e148: minigl.library V2.21 
 0x681ff210: Warp3D.library V53.27 
 0x681ae428: W3D_Avenger.library V53.1 
 0x681ae228: W3D_Napalm.library V53.1 
 0x681ae128: W3D_Permedia2.library V53.4 
 0x6981ce18: W3D_R200.library V53.30 
 0x6a983f28: W3D_Picasso96.library V53.12 
 0x69a974d8: muigfx.library V21.3 
 0x69638d98: muimaster.library V21.21 
 0x6bf54104: amigaguide.datatype V53.6 
 0x691c18d4: amigaguide.library V53.8 
 0x6abaa53c: codesets.library V6.20 
 0x69a76e58: CPUClock.docky V50.1 
 0x69a76d58: Separator.docky V53.2 
 0x6a9832b0: slider.gadget V53.15 
 0x6a983210: getfont.gadget V53.9 
 0x6a983170: arexx.class V53.5 
 0x6ad66f20: getfile.gadget V53.12 
 0x6a9f4190: requester.class V53.18 
 0x6a9830d0: space.gadget V53.6 
 0x6a983030: bitmap.image V53.9 
 0x6ad66e80: integer.gadget V53.12 
 0x6ad71c48: clicktab.gadget V53.44 
 0x6b5b0818: screenblanker.library V53.6 
 0x6c429088: chooser.gadget V53.21 
 0x6ad66b60: penmap.image V53.5 
 0x6ad66ac0: checkbox.gadget V53.9 
 0x6abb6104: asl.library V53.49 
 0x6c429484: device.audio V6.2 
 0x6c14be58: filesave.audio V6.5 
 0x6c1f4218: listbrowser.gadget V53.62 
 0x6c13f020: string.gadget V53.20 
 0x6bedd9b0: scroller.gadget V53.14 
 0x6c14b498: via-ac97.audio V5.9 
 0x6c81faa4: usergroup.library V4.30 
 0x6bf4d320: bsdsocket.library V4.307 
 0x6c14b2a0: mathieeedoubbas.library V52.1 
 0x6c2a5bac: textclip.library V53.1 
 0x6c54ad60: button.gadget V53.21 
 0x6c54ae00: glyph.image V53.3 
 0x6c2a80a0: window.class V54.7 
 0x6c32b8d8: popupmenu.class V53.2 
 0x6c5447e8: popupmenu.library V53.11 
 0x6c54ab80: label.image V53.13 
 0x6c54aae0: drawlist.image V53.3 
 0x6ff845e8: layout.gadget V54.2 
 0x6c32b7e0: bevel.image V53.6 
 0x6c54a5e0: png.datatype V53.10 
 0x6c50a674: picture.datatype V53.7 
 0x6c81dc48: timezone.library V53.8 
 0x6c575218: application.library V53.12 
 0x6c897b5c: ft2.library V53.2 
 0x6c5b7b00: Picasso96API.library V54.18 
 0x6ff1b08c: workbench.library V53.53 
 0x6c5bbb80: gadtools.library V53.7 
 0x6ffa899c: commodities.library V53.7 
 0x6c817540: datatypes.library V54.6 
 0x6c897864: png.iconmodule V53.1 
 0x6c97a0cc: icon.library V53.16 
 0x6cbb1730: z.library V53.5 
 0x6fda1eb8: version.library V53.15 
 0x6c5bb160: iffparse.library V53.1 
 0x6fdbd1cc: locale.library V54.2 
 0x6ff4641c: diskfont.library V53.9 
 0x6ffa9798: petunia.library V53.6 
 0x6ffa96d8: diskcache.library V3.30 
 0x6fe82220: dos.library V53.158 
 0x6ff84da4: usbprivate.library V53.12 
 0x6ff1333c: massstorage.usbfd V53.83 
 0x6ff132a8: bootkeyboard.usbfd V52.3 
 0x6ff13228: bootmouse.usbfd V53.3 
 0x6ff84c5c: hub.usbfd V53.10 
 0x6ff13128: mounter.library V53.19 
 0x6ff847ec: usbresource.library V53.12 
 0x6ff8f478: hunk.library V53.4 
 0x6ff846e4: elf.library V53.27 
 0x6ff694d0: intuition.library V54.26 
 0x6ff947a0: keymap.library V53.9 
 0x6ff859f0: cybergraphics.library V43.0 
 0x6ff96520: ATIRadeon.chip V53.29 
 0x6ff964a4: PCIGraphics.card V53.15 
 0x6ffa3420: graphics.library V54.226 
 0x6fffe4f0: layers.library V54.12 
 0x6ff57150: rtg.library V54.90 
 0x6ff8f0e4: nonvolatile.library V53.5 
 0x6ffab438: newlib.library V53.30 
 0x6ff951ac: utility.library V54.1 
 0x6ffa8398: expansion.library V53.1 
 0x6c58758e: rexxsyslib.library V53.4 (Legacy) 

Devices 
 0x6bf548b4: ahi.device V6.6 
 0x6ff95d10: usbsys.device V53.12 
 0x6ff8faf0: ehci.usbhcd V53.24 
 0x6ff8fa50: ohci.usbhcd V53.21 
 0x6ff8f9b0: uhci.usbhcd V53.13 
 0x6ff96b24: peg2ide.device V53.20 
 0x6ff95648: console.device V53.99 
 0x6ff5f2b0: ramdrive.device V52.6 
 0x6ff949ec: input.device V53.5 
 0x6ff46024: keyboard.device V53.11 
 0x6ff94504: gameport.device V52.1 
 0x6ff5f050: timer.device V53.2 

Tasks 
 ClickToFront (Waiting) 
  Stack: 0x6a9c5004 - 0x6a9d4ffc, pointer @ 0x6a9d49f0 (Cookie OK) 
  Signals: SigRec 0xe000d000, SigWait 0x00000100 
  State: Process (Waiting) 
 input.device (Waiting) 
  Stack: 0x6fed3000 - 0x6fee3000, pointer @ 0x6fee2f00 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000000 
  State: Task (Waiting) 
 SFS DosList handler (Waiting) 
  Stack: 0x6cbac004 - 0x6cbafffc, pointer @ 0x6cbaff20 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000000 
  State: Process (Waiting) 
 USB stack (Waiting) 
  Stack: 0x6fe85000 - 0x6fe89000, pointer @ 0x6fe88f20 (Cookie OK) 
  Signals: SigRec 0xf8007000, SigWait 0x00000000 
  State: Task (Waiting) 
 UHCI Controller Task Unit 0 (Waiting) 
  Stack: 0x6fe3a000 - 0x6fe42000, pointer @ 0x6fe41f20 (Cookie OK) 
  Signals: SigRec 0xbe001000, SigWait 0x00000000 
  State: Task (Waiting) 
 UHCI Controller Task Unit 1 (Waiting) 
  Stack: 0x6fdf2000 - 0x6fdfa000, pointer @ 0x6fdf9f20 (Cookie OK) 
  Signals: SigRec 0xbe001000, SigWait 0x00000000 
  State: Task (Waiting) 
 peg2ide.device - chip 0 port 0 (Waiting) 
  Stack: 0x6fea9000 - 0x6feb1000, pointer @ 0x6feb0f30 (Cookie OK) 
  Signals: SigRec 0xc0000000, SigWait 0x20000000 
  State: Task (Waiting) 
 page_sweep (Waiting) 
  Stack: 0x6fe61004 - 0x6fe68ffc, pointer @ 0x6fe68e90 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000000 
  State: Task (Waiting) 
 peg2ide.device - chip 0 port 1 (Waiting) 
  Stack: 0x6fe79000 - 0x6fe81000, pointer @ 0x6fe80f30 (Cookie OK) 
  Signals: SigRec 0xc0000000, SigWait 0x00000000 
  State: Task (Waiting) 
 QDH0/FastFileSystem 53.2  (Waiting) 
  Stack: 0x6ca6f004 - 0x6ca72ffc, pointer @ 0x6ca72ed0 (Cookie OK) 
  Signals: SigRec 0xa8000100, SigWait 0x00000000 
  State: Process (Waiting) 
 QDH3/FastFileSystem 53.2  (Waiting) 
  Stack: 0x6c9eb004 - 0x6c9eeffc, pointer @ 0x6c9eeed0 (Cookie OK) 
  Signals: SigRec 0xa8000100, SigWait 0x00000000 
  State: Process (Waiting) 
 QDH4/SmartFilesystem 1.290  (Waiting) 
  Stack: 0x6fd09004 - 0x6fd0cffc, pointer @ 0x6fd0ceb0 (Cookie OK) 
  Signals: SigRec 0xe0000100, SigWait 0x10000000 
  State: Process (Waiting) 
 QDH1/SmartFilesystem 1.290  (Waiting) 
  Stack: 0x6ca47004 - 0x6ca4affc, pointer @ 0x6ca4aeb0 (Cookie OK) 
  Signals: SigRec 0xe0000100, SigWait 0x10000000 
  State: Process (Waiting) 
 reaper.task (Waiting) 
  Stack: 0x6c92f004 - 0x6c936ffc, pointer @ 0x6c936e50 (Cookie OK) 
  Signals: SigRec 0x00007000, SigWait 0x00000000 
  State: Process (Waiting) 
 CD0/CDFileSystem 53.4  (Waiting) 
  Stack: 0x6cb80004 - 0x6cb83ffc, pointer @ 0x6cb83f30 (Cookie OK) 
  Signals: SigRec 0x00000100, SigWait 0x00000000 
  State: Process (Waiting) 
 QDH5/SmartFilesystem 1.290  (Waiting) 
  Stack: 0x6c9c3004 - 0x6c9c6ffc, pointer @ 0x6c9c6eb0 (Cookie OK) 
  Signals: SigRec 0xe0000100, SigWait 0x10000000 
  State: Process (Waiting) 
 QDH2/SmartFilesystem 1.290  (Waiting) 
  Stack: 0x6ca1b004 - 0x6ca1effc, pointer @ 0x6ca1eeb0 (Cookie OK) 
  Signals: SigRec 0xe0000100, SigWait 0x10000000 
  State: Process (Waiting) 
 RAM/ram-handler 53.172  (Waiting) 
  Stack: 0x6c831004 - 0x6c834ffc, pointer @ 0x6c834d40 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000100 
  State: Process (Waiting) 
 pager (Waiting) 
  Stack: 0x6c90b004 - 0x6c92affc, pointer @ 0x6c92aef0 (Cookie OK) 
  Signals: SigRec 0x80001000, SigWait 0x00000000 
  State: Process (Waiting) 
 WinFrame 3 Process (Waiting) 
  Stack: 0x69091004 - 0x690d0ffc, pointer @ 0x690d0eb0 (Cookie OK) 
  Signals: SigRec 0xff800000, SigWait 0x00000000 
  State: Process (Waiting) 
 WinFrame 4 Process (Waiting) 
  Stack: 0x68144004 - 0x68183ffc, pointer @ 0x68183eb0 (Cookie OK) 
  Signals: SigRec 0xff800000, SigWait 0x00000000 
  State: Process (Waiting) 
 WinFrame 2 Process (Waiting) 
  Stack: 0x696a5004 - 0x696e4ffc, pointer @ 0x696e4eb0 (Cookie OK) 
  Signals: SigRec 0xff800000, SigWait 0x00000000 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6c953004 - 0x6c95affc, pointer @ 0x6c95ae20 (Cookie OK) 
  Signals: SigRec 0xb0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 ENV/env-handler 54.5  (Waiting) 
  Stack: 0x6c903004 - 0x6c906ffc, pointer @ 0x6c906ef0 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000100 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x68d34004 - 0x68d43ffc, pointer @ 0x68d43e20 (Cookie OK) 
  Signals: SigRec 0xb0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 RANDOM/Random-Handler 52.1  (Waiting) 
  Stack: 0x6c080004 - 0x6c08fffc, pointer @ 0x6c08fef0 (Cookie OK) 
  Signals: SigRec 0x00000100, SigWait 0x00000000 
  State: Process (Waiting) 
 URL/launch-handler 53.38  (Waiting) 
  Stack: 0x6c0c0004 - 0x6c13affc, pointer @ 0x6c136fb0 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000100 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6971f004 - 0x6972effc, pointer @ 0x6972ee20 (Cookie OK) 
  Signals: SigRec 0xb0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 dos_filedir_notify (Waiting) 
  Stack: 0x6fd62004 - 0x6fd65ffc, pointer @ 0x6fd65ad0 (Cookie OK) 
  Signals: SigRec 0x40001000, SigWait 0x80000000 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6a89c004 - 0x6a8abffc, pointer @ 0x6a8abe20 (Cookie OK) 
  Signals: SigRec 0xa0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6a969004 - 0x6a978ffc, pointer @ 0x6a978e20 (Cookie OK) 
  Signals: SigRec 0xa0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6aa49004 - 0x6aa58ffc, pointer @ 0x6aa58e20 (Cookie OK) 
  Signals: SigRec 0xa0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6ab4e004 - 0x6ab5dffc, pointer @ 0x6ab5de20 (Cookie OK) 
  Signals: SigRec 0xa0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6abd4004 - 0x6abe3ffc, pointer @ 0x6abe3e20 (Cookie OK) 
  Signals: SigRec 0xa0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 AUDIO/AHI-Handler 6.2  (Waiting) 
  Stack: 0x6c060004 - 0x6c070004, pointer @ 0x6c06fed0 (Cookie OK) 
  Signals: SigRec 0x00000100, SigWait 0x00000000 
  State: Process (Waiting) 
 APPDIR/appdir-handler-in-dos 53.158  (Waiting) 
  Stack: 0x6c89f004 - 0x6c8a6ffc, pointer @ 0x6c8a6dc0 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000100 
  State: Process (Waiting) 
 RAW/con-handler 53.78  (Waiting) 
  Stack: 0x6c97f004 - 0x6c986ffc, pointer @ 0x6c986e20 (Cookie OK) 
  Signals: SigRec 0xa0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 CON/con-handler 53.78  (Waiting) 
  Stack: 0x6c993004 - 0x6c99affc, pointer @ 0x6c99ae20 (Cookie OK) 
  Signals: SigRec 0xa0000100, SigWait 0x00000000 
  State: Process (Waiting) 
 dos_nbmd_process (Waiting) 
  Stack: 0x6fd72004 - 0x6fd75ffc, pointer @ 0x6fd75f30 (Cookie OK) 
  Signals: SigRec 0x00001100, SigWait 0x00000000 
  State: Process (Waiting) 
 dos_lock_handler (Waiting) 
  Stack: 0x6fd7a004 - 0x6fd7dffc, pointer @ 0x6fd7df00 (Cookie OK) 
  Signals: SigRec 0x00001100, SigWait 0x00000000 
  State: Process (Waiting) 
 RexxMaster (Waiting) 
  Stack: 0x6bfa3004 - 0x6bfb3004, pointer @ 0x6bfb2f70 (Cookie OK) 
  Signals: SigRec 0xc0000000, SigWait 0x00000100 
  State: Process (Waiting) 
 TEXTCLIP/textclip-handler 53.1  (Waiting) 
  Stack: 0x6c09c004 - 0x6c0abffc, pointer @ 0x6c0abeb0 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000100 
  State: Process (Waiting) 
 Workbench (Waiting) 
  Stack: 0x6bf0a004 - 0x6bf19ffc, pointer @ 0x6bf19ea0 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000100 
  State: Process (Waiting) 
 compose.task (Waiting) 
  Stack: 0x6b5b3000 - 0x6b5bb000, pointer @ 0x6b5bae10 (Cookie OK) 
  Signals: SigRec 0x00000010, SigWait 0x00000000 
  State: Task (Waiting) 
 Bildschirmschoner-Bibliothek. (Waiting) 
  Stack: 0x6a9d9004 - 0x6a9e9ffc, pointer @ 0x6a9e9f00 (Cookie OK) 
  Signals: SigRec 0xb4001000, SigWait 0x00000100 
  State: Process (Waiting) 
 ramlib (Waiting) 
  Stack: 0x6c851004 - 0x6c869ffc, pointer @ 0x6c869f20 (Cookie OK) 
  Signals: SigRec 0x80001000, SigWait 0x00000000 
  State: Process (Waiting) 
 MUI imagespace screen notify (Waiting) 
  Stack: 0x6827b004 - 0x6828affc, pointer @ 0x6828ad10 (Cookie OK) 
  Signals: SigRec 0x80009000, SigWait 0x00000100 
  State: Process (Waiting) 
 Workbench DosList Notify (Waiting) 
  Stack: 0x6ad94004 - 0x6ada3ffc, pointer @ 0x6ada3f40 (Cookie OK) 
  Signals: SigRec 0x00003000, SigWait 0x00000100 
  State: Process (Waiting) 
 ContextMenus Command Dispatcher (Waiting) 
  Stack: 0x692b6004 - 0x692c5ffc, pointer @ 0x692c5f30 (Cookie OK) 
  Signals: SigRec 0x80001000, SigWait 0x00000000 
  State: Process (Waiting) 
 string.gadget server (Waiting) 
  Stack: 0x6ad78004 - 0x6ad87ffc, pointer @ 0x6ad87db0 (Cookie OK) 
  Signals: SigRec 0x40000000, SigWait 0x00000100 
  State: Process (Waiting) 
 Workbench Clipboard Server (Waiting) 
  Stack: 0x6a1c0004 - 0x6a1cfffc, pointer @ 0x6a1cff00 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000100 
  State: Process (Waiting) 
 RinghioServer (Ready) 
  Stack: 0x69ab8004 - 0x69ad7ffc, pointer @ 0x69ad7370 (Cookie OK) 
  Signals: SigRec 0xd8001000, SigWait 0x10000100 
  State: Process (Ready) 
 AmiDock (Waiting) 
  Stack: 0x6abe8004 - 0x6abf7ffc, pointer @ 0x6abf7910 (Cookie OK) 
  Signals: SigRec 0x00000100, SigWait 0x00000000 
  State: Process (Waiting) 
 hub.usbfd (Waiting) 
  Stack: 0x6fdb2004 - 0x6fdb9ffc, pointer @ 0x6fdb9f10 (Cookie OK) 
  Signals: SigRec 0x30000000, SigWait 0x00000000 
  State: Task (Waiting) 
 TCP/IP Control (Waiting) 
  Stack: 0x6be1c004 - 0x6be2bffc, pointer @ 0x6be2bdc0 (Cookie OK) 
  Signals: SigRec 0xf8009080, SigWait 0x00000000 
  State: Process (Waiting) 
 ELF Collector (Waiting) 
  Stack: 0x6cb98004 - 0x6cba7ffc, pointer @ 0x6cba7e70 (Cookie OK) 
  Signals: SigRec 0x00000100, SigWait 0x00000000 
  State: Process (Waiting) 
 hub.usbfd (Waiting) 
  Stack: 0x6fda6004 - 0x6fdadffc, pointer @ 0x6fdadf10 (Cookie OK) 
  Signals: SigRec 0x30000000, SigWait 0x00000000 
  State: Task (Waiting) 
 Mounter GUI (Waiting) 
  Stack: 0x6c196004 - 0x6c1a9ffc, pointer @ 0x6c1a9e10 (Cookie OK) 
  Signals: SigRec 0x80007000, SigWait 0x00000000 
  State: Process (Waiting) 
 Hollywood requester task (Waiting) 
  Stack: 0x6983d004 - 0x6984cffc, pointer @ 0x6984cf30 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000000 
  State: Process (Waiting) 
 Hollywood wait task (Waiting) 
  Stack: 0x6920a004 - 0x69219ffc, pointer @ 0x69219f10 (Cookie OK) 
  Signals: SigRec 0xc0000000, SigWait 0x00000000 
  State: Process (Waiting) 
 ScreenBlankerEngine (Waiting) 
  Stack: 0x6aa65004 - 0x6aa74ffc, pointer @ 0x6aa74be0 (Cookie OK) 
  Signals: SigRec 0xd8001000, SigWait 0x00000100 
  State: Process (Waiting) 
 ContextMenus (Waiting) 
  Stack: 0x6a989004 - 0x6a998ffc, pointer @ 0x6a998c80 (Cookie OK) 
  Signals: SigRec 0xe0001000, SigWait 0x00000100 
  State: Process (Waiting) 
 AsyncWB (Waiting) 
  Stack: 0x6ab8e004 - 0x6ab9dffc, pointer @ 0x6ab9deb0 (Cookie OK) 
  Signals: SigRec 0xc0001000, SigWait 0x00000100 
  State: Process (Waiting) 
 application.library messageserver (Waiting) 
  Stack: 0x6c491000 - 0x6c491fa0, pointer @ 0x6c491f10 (Cookie OK) 
  Signals: SigRec 0xc0000000, SigWait 0x00000000 
  State: Task (Waiting) 
 RAWBInfo (Waiting) 
  Stack: 0x6ab1a004 - 0x6ab29ffc, pointer @ 0x6ab29ec0 (Cookie OK) 
  Signals: SigRec 0x80001000, SigWait 0x00000100 
  State: Process (Waiting) 
 DefIcons (Waiting) 
  Stack: 0x6ab6a004 - 0x6ab79ffc, pointer @ 0x6ab79dc0 (Cookie OK) 
  Signals: SigRec 0x80009000, SigWait 0x00000100 
  State: Process (Waiting) 
 « IPrefs » (Waiting) 
  Stack: 0x6c58f004 - 0x6c59effc, pointer @ 0x6c59e980 (Cookie OK) 
  Signals: SigRec 0x0000f000, SigWait 0x20000100 
  State: Process (Waiting) 
 TCP/IP Superserver (Waiting) 
  Stack: 0x6be38004 - 0x6be47ffc, pointer @ 0x6be479f0 (Cookie OK) 
  Signals: SigRec 0xd0000080, SigWait 0x00000000 
  State: Process (Waiting) 
 TCP/IP Configuration (Waiting) 
  Stack: 0x6beae004 - 0x6bebdffc, pointer @ 0x6bebde10 (Cookie OK) 
  Signals: SigRec 0xf8003000, SigWait 0x00000000 
  State: Process (Waiting) 
 TCP/IP Log (Waiting) 
  Stack: 0x6beca004 - 0x6bed9ffc, pointer @ 0x6bed9f00 (Cookie OK) 
  Signals: SigRec 0x80003000, SigWait 0x00000000 
  State: Process (Waiting) 
 ConClip (Waiting) 
  Stack: 0x6c024004 - 0x6c033ffc, pointer @ 0x6c033eb0 (Cookie OK) 
  Signals: SigRec 0x80000000, SigWait 0x00000000 
  State: Process (Waiting) 
 USB stack Process (Waiting) 
  Stack: 0x6c1c2004 - 0x6c1d1ffc, pointer @ 0x6c1d1ee0 (Cookie OK) 
  Signals: SigRec 0x80001000, SigWait 0x00000000 
  State: Process (Waiting) 
 MassStorage Notifier (Waiting) 
  Stack: 0x6fe46000 - 0x6fe4dd00, pointer @ 0x6fe4dc70 (Cookie OK) 
  Signals: SigRec 0x80001000, SigWait 0x00000000 
  State: Task (Waiting) 
 datatypes.library (Waiting) 
  Stack: 0x6c437004 - 0x6c446ffc, pointer @ 0x6c446e30 (Cookie OK) 
  Signals: SigRec 0x80001000, SigWait 0x00000000 
  State: Process (Waiting) 
 DST watcher (Waiting) 
  Stack: 0x6c460004 - 0x6c46fffc, pointer @ 0x6c46ff10 (Cookie OK) 
  Signals: SigRec 0xc0000000, SigWait 0x00000000 
  State: Process (Waiting) 
 Shell Process [hollywood] (Crashed) 
  Stack: 0x6921a000 - 0x6925a020, pointer @ 0x69257b20 (Cookie OK) 
  Signals: SigRec 0x00000010, SigWait 0x00000100 
  State: Process (Crashed) 
 ramlib.support (Waiting) 
  Stack: 0x6c86e004 - 0x6c886ffc, pointer @ 0x6c886f00 (Cookie OK) 
  Signals: SigRec 0x80005000, SigWait 0x00000000 
  State: Process (Waiting) 
 Mounter Task (Waiting) 
  Stack: 0x6fe4e000 - 0x6fe5ca60, pointer @ 0x6fe5c970 (Cookie OK) 
  Signals: SigRec 0xb0001000, SigWait 0x00000000 
  State: Task (Waiting) 
 Mounter Companion Process (Waiting) 
  Stack: 0x6c1ae004 - 0x6c1bdffc, pointer @ 0x6c1bdf40 (Cookie OK) 
  Signals: SigRec 0x80003000, SigWait 0x00000000 
  State: Process (Waiting) 
 dos_signal_server (Waiting) 
  Stack: 0x6fd6a004 - 0x6fd6dffc, pointer @ 0x6fd6df10 (Cookie OK) 
  Signals: SigRec 0x0000f000, SigWait 0x00000000 
  State: Process (Waiting) 
 dos_appdir_server (Waiting) 
  Stack: 0x6fd56004 - 0x6fd5dffc, pointer @ 0x6fd5dd40 (Cookie OK) 
  Signals: SigRec 0x80005000, SigWait 0x00000000 
  State: Process (Waiting) 
 CPUClock.CPUTask (Ready) 
  Stack: 0x69a46000 - 0x69a4e000, pointer @ 0x69a4dfd0 (Cookie OK) 
  Signals: SigRec 0x00000000, SigWait 0x00000000 
  State: Task (Ready) 
 idle.task (Ready) 
  Stack: 0x6ff86000 - 0x6ff87000, pointer @ 0x6ff86fd0 (Cookie OK) 
  Signals: SigRec 0x00000000, SigWait 0x00000000 
  State: Task (Ready)  
Looks like it is related to pthreads. As I said, Hollywood itself isn't linked against -lpthread because it uses clib2 and threads via CreateNewProcess(). The SDL plugin, however, is linked against -lpthread but that's probably not effective because it uses -nostartfiles.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Manually loading shared object

Post by broadblues »

Looks like it is related to pthreads. As I said, Hollywood itself isn't linked against -lpthread because it uses clib2 and threads via CreateNewProcess().
The linkage of the main hollwood executabe doesn't matter, since you are loadseging your plugin and not using dynamic linking.
(BTW in case you should need it in a sperate case, there *is* a static libpthread.a for clib2, doesn't help here though)

The SDL plugin, however, is linked against -lpthread but that's probably not effective because it uses -nostartfiles.
All I can think is that some global symbol in the startfile code is required by the pthread init code, or by a newlib function called from it.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Manually loading shared object

Post by broadblues »

Looking at the pthread init code I can exactly one newlib call, and there is nothing special about it that I can see, the only reason I can think it might crash would be if INewlib was not visible to the shared library.

Is your plugin stripped?
softwarefailure
Posts: 112
Joined: Fri Feb 14, 2014 10:29 pm

Re: Manually loading shared object

Post by softwarefailure »

Yes, it is stripped. INewlib is defined as a global symbol so it should be visible. I've tried it now without stripping but it crashes in the very same manner.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Manually loading shared object

Post by broadblues »

softwarefailure wrote:Yes, it is stripped. INewlib is defined as a global symbol so it should be visible. I've tried it now without stripping but it crashes in the very same manner.
Try adding -Wl,--export-dynamic to the plugin link command.
softwarefailure
Posts: 112
Joined: Fri Feb 14, 2014 10:29 pm

Re: Manually loading shared object

Post by softwarefailure »

Same crash.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Manually loading shared object

Post by broadblues »

I'm out of ideas for the moment then.
softwarefailure
Posts: 112
Joined: Fri Feb 14, 2014 10:29 pm

Re: Manually loading shared object

Post by softwarefailure »

Since nobody has an idea what's wrong here I've now requested a clib2 static link library build of SDL2:
https://sourceforge.net/p/sdl2-amigaos4/tickets/29/

Let's hope that this materialises so that I can finally finish this plugin for OS4...
capehill
Posts: 24
Joined: Sun Jun 18, 2017 1:07 pm

Re: Manually loading shared object

Post by capehill »

softwarefailure wrote:Since nobody has an idea what's wrong here I've now requested a clib2 static link library build of SDL2:
https://sourceforge.net/p/sdl2-amigaos4/tickets/29/

Let's hope that this materialises so that I can finally finish this plugin for OS4...
I'm not able to build a helloworld with clib2, I get undefined reference to GetProgramName. http://forum.hyperion-entertainment.biz ... rogramname
Post Reply