goblin icon indicating copy to clipboard operation
goblin copied to clipboard

Panic on parsing archive

Open alexozer opened this issue 6 years ago • 5 comments

Parsing this archive file seems to cause a panic:

thread 'main' panicked at 'no entry found for key', src/libcore/option.rs:1166:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind
             at src/libstd/panicking.rs:311
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::option::expect_failed
             at src/libcore/option.rs:1166
  11: core::option::Option<T>::expect
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/option.rs:345
  12: <alloc::collections::btree::map::BTreeMap<K,V> as core::ops::index::Index<&Q>>::index
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/collections/btree/map.rs:1835
  13: goblin::archive::Archive::parse
             at goblin/src/archive/mod.rs:467
  14: goblin::Object::parse
             at goblin/src/lib.rs:312
  15: strand_match::main
             at src/main.rs:25
  16: std::rt::lang_start::{{closure}}
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
  17: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  18: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  19: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  20: std::panicking::try
             at src/libstd/panicking.rs:275
  21: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  22: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  23: std::rt::lang_start
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
  24: main
  25: __libc_start_main
  26: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Source:

use std::fs::File;
use std::path::Path;
use std::io::Read;

use goblin::Object;

fn main() {
    let mut f = File::open(Path::new("os.a")).unwrap();
    let mut buf = Vec::new();
    f.read_to_end(&mut buf);
    Object::parse(&buf);
}

ar seems to extract this archive just fine as well.

alexozer avatar Oct 26 '19 00:10 alexozer

Is the ar from macos by any chance ? I’ve seen panics on darwin/ bsd archives.

@alexozer would you like to to take up this issue? :)

m4b avatar Oct 26 '19 01:10 m4b

I actually don't know for sure which OS this was built on. It's quite old though (built sometime in 2001). However, the filenames seem to end in "/" so I think it's probably a Unix archive.

Also I'm not sure I can take on this issue; just wanted to report as it's better than nothing for now.

alexozer avatar Oct 26 '19 03:10 alexozer

We can be less strict about parsing here; i have a minor patch, that "succeeds" in parsing the archive, though the resulting archive has 0 symbols in all its members, so i don't think we're either parsing right, or we should just fail with first bad offset?:

019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSIsDebuggerPresent" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetConsoleType" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInit" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSStartTime" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSInIPL" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSEVSetNumber" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSEVStart" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSEVEnd" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSDBINTSTART" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSDBINTEND" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSDBJUMPSTART" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSDBJUMPEND" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__DBVECTOR" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDefaultExceptionHandler" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSetExceptionHandler" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSGetExceptionHandler" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSPSInit" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSGetDIConfig" at offset: 5373
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSPhysicalToCached" at offset: 15457
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSPhysicalToUncached" at offset: 15457
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCachedToPhysical" at offset: 15457
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSUncachedToPhysical" at offset: 15457
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCachedToUncached" at offset: 15457
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSUncachedToCached" at offset: 15457
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCheckAlarmQueue" at offset: 16293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitAlarm" at offset: 16293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCreateAlarm" at offset: 16293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetAlarm" at offset: 16293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetAbsAlarm" at offset: 16293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetPeriodicAlarm" at offset: 16293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCancelAlarm" at offset: 16293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSCurrHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSAllocFromHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSAllocFixed" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSFreeToHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetCurrentHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitAlloc" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCreateHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDestroyHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSAddToHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCheckHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSReferentSize" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDumpHeap" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSVisitAllocated" at offset: 22145
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetArenaHi" at offset: 29069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetArenaLo" at offset: 29069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetArenaHi" at offset: 29069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetArenaLo" at offset: 29069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSAllocFromArenaLo" at offset: 29069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSAllocFromArenaHi" at offset: 29069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSInitAudioSystem" at offset: 30305
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSStopAudioSystem" at offset: 30305
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCFlashInvalidate" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCEnable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCDisable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCFreeze" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCUnfreeze" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCTouchLoad" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCBlockZero" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCBlockStore" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCBlockFlush" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCBlockInvalidate" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCInvalidateRange" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCFlushRange" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCStoreRange" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCFlushRangeNoSync" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCStoreRangeNoSync" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCZeroRange" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DCTouchRange" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICInvalidateRange" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICFlashInvalidate" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICEnable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICDisable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICFreeze" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICUnfreeze" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICBlockInvalidate" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "ICSync" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCEnable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCDisable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCAllocOneTag" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCAllocTags" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCLoadBlocks" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCStoreBlocks" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCAlloc" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCAllocNoInvalidate" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCLoadData" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCStoreData" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCQueueLength" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCQueueWait" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "LCFlushQueue" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "L2Disable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "L2GlobalInvalidate" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "L2Enable" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "L2SetDataOnly" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "L2SetWriteThrough" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "DMAErrorHandler" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSCacheInit" at offset: 32149
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSLoadFPUContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSaveFPUContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetCurrentContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetCurrentContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSaveContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSLoadContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetStackPointer" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSwitchStack" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSwitchFiber" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSClearContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDumpContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSContextInit" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSFillFPUContext" at offset: 39961
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSReport" at offset: 45501
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSPanic" at offset: 45501
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSErrorTable" at offset: 45501
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetErrorHandler" at offset: 45501
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSUnhandledException" at offset: 45501
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetFontEncode" at offset: 50081
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSLoadFont" at offset: 50081
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetFontTexel" at offset: 50081
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitFont" at offset: 50081
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetFontTexture" at offset: 50081
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetFontWidth" at offset: 50081
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDisableInterrupts" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__RAS_OSDisableInterrupts_begin" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__RAS_OSDisableInterrupts_end" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSEnableInterrupts" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSRestoreInterrupts" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSetInterruptHandler" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSGetInterruptHandler" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSInterruptInit" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSMaskInterrupts" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetInterruptMask" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetInterruptMask" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSUnmaskInterrupts" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSDispatchInterrupt" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSLastInterrupt" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSLastInterruptTime" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSLastInterruptSrr0" at offset: 59957
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSNotifyLink" at offset: 64617
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSNotifyUnlink" at offset: 64617
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetStringTable" at offset: 64617
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSLink" at offset: 64617
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSUnlink" at offset: 64617
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSModuleInit" at offset: 64617
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSearchModule" at offset: 64617
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitMessageQueue" at offset: 68213
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSendMessage" at offset: 68213
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSReceiveMessage" at offset: 68213
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSJamMessage" at offset: 68213
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetPhysicalMemSize" at offset: 70089
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetConsoleSimulatedMemSize" at offset: 70089
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSProtectRange" at offset: 70089
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSInitMemoryProtection" at offset: 70089
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitMutex" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSLockMutex" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSUnlockMutex" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSUnlockAllMutex" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSTryLockMutex" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitCond" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSWaitCond" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSignalCond" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSCheckMutex" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSCheckDeadLock" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSCheckMutexes" at offset: 72917
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSReboot" at offset: 76217
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetSaveRegion" at offset: 76217
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetSaveRegion" at offset: 76217
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSRegisterResetFunction" at offset: 79069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSUnregisterResetFunction" at offset: 79069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSCallResetFunctions" at offset: 79069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSDoHotReset" at offset: 79069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSResetSystem" at offset: 79069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetResetCode" at offset: 79069
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSResetSWInterruptHandler" at offset: 82329
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetResetCallback" at offset: 82329
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetResetButtonState" at offset: 82329
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetResetSwitchState" at offset: 82329
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSetResetButtonTimer" at offset: 82329
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSGetRTC" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSetRTC" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSInitSram" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSLockSram" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSLockSramEx" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSUnlockSram" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSUnlockSramEx" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSyncSram" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSCheckSram" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSReadROM" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSReadROMAsync" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetSoundMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetSoundMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetProgressiveMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetProgressiveMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetVideoMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetVideoMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetLanguage" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetLanguage" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSGetBootMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSetBootMode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetEuRgb60Mode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetEuRgb60Mode" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetWirelessID" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetWirelessID" at offset: 85397
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitSemaphore" at offset: 96297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSWaitSemaphore" at offset: 96297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSTryWaitSemaphore" at offset: 96297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSignalSemaphore" at offset: 96297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetSemaphoreCount" at offset: 96297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitStopwatch" at offset: 97813
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSStartStopwatch" at offset: 97813
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSStopStopwatch" at offset: 97813
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCheckStopwatch" at offset: 97813
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSResetStopwatch" at offset: 97813
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDumpStopwatch" at offset: 97813
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSystemCallVectorStart" at offset: 100201
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSystemCallVectorEnd" at offset: 100201
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSInitSystemCall" at offset: 100201
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSThreadInit" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitThreadQueue" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetCurrentThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSIsThreadSuspended" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSIsThreadTerminated" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDisableScheduler" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSEnableScheduler" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSGetEffectivePriority" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSPromoteThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSReschedule" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSYieldThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCreateThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSExitThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSWakeupThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCancelThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSJoinThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSleepThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSDetachThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSResumeThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSuspendThread" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetThreadPriority" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetThreadPriority" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetIdleFunction" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetIdleFunction" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCheckActiveThreads" at offset: 101293
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetTime" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSGetTick" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSetTime" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSGetSystemTime" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSTimeToSystemTime" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__OSSetTick" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSTicksToCalendarTime" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSCalendarTimeToTicks" at offset: 117745
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSSetTimerCallback" at offset: 122061
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSInitTimer" at offset: 122061
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSStartTimer" at offset: 122061
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "OSStopTimer" at offset: 122061
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__get_clock" at offset: 124297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__get_time" at offset: 124297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__to_gm_time" at offset: 124297
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__start" at offset: 125245
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__init_hardware" at offset: 129057
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__flush_cache" at offset: 129057
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "__init_user" at offset: 129057
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "abort" at offset: 129057
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "_ExitProcess" at offset: 129057
[2019-11-03T20:19:38Z WARN  goblin::archive] Could not get member "exit" at offset: 129057
  Size      # Symbols                Name  
  0x2728    0                        OS.o  
  0x308     0                 OSAddress.o  
  0x16a0    0                   OSAlarm.o  
  0x1ad0    0                   OSAlloc.o  
  0x498     0                   OSArena.o  
  0x6f8     0             OSAudioSystem.o  
  0x1e48    0                   OSCache.o  
  0x1568    0                 OSContext.o  
  0x11a8    0                   OSError.o  
  0x2658    0                    OSFont.o  
  0x11f8    0               OSInterrupt.o  
  0xdd0     0                    OSLink.o  
  0x718     0                 OSMessage.o  
  0xad0     0                  OSMemory.o  
  0xca8     0                   OSMutex.o  
  0xae8     0                  OSReboot.o  
  0xc80     0                   OSReset.o  
  0xbc0     0                 OSResetSW.o  
  0x2a58    0                     OSRtc.o  
  0x5b0     0               OSSemaphore.o  
  0x918     0               OSStopwatch.o  
  0x408     0                    OSSync.o  
  0x4008    0                  OSThread.o  
  0x10a0    0                    OSTime.o  
  0x880     0                   OSTimer.o  
  0x378     0              time.dolphin.o  
  0xea8     0                   __start.o  
  0xcc0     0           __ppc_eabi_init.o  

note the huge amount of warnings about missing symbols.

I also noticed:

ar Ot os.a 
OS.o 0x153a
OSAddress.o 0x3c9e
OSAlarm.o 0x3fe2
OSAlloc.o 0x56be
OSArena.o 0x71ca
OSAudioSystem.o 0x769e
OSCache.o 0x7dd2
OSContext.o 0x9c56
OSError.o 0xb1fa
OSFont.o 0xc3de
OSInterrupt.o 0xea72
OSLink.o 0xfca6
OSMessage.o 0x10ab2
OSMemory.o 0x11206
OSMutex.o 0x11d12
OSReboot.o 0x129f6
OSReset.o 0x1351a
OSResetSW.o 0x141d6
OSRtc.o 0x14dd2
OSSemaphore.o 0x17866
OSStopwatch.o 0x17e52
OSSync.o 0x187a6
OSThread.o 0x18bea
OSTime.o 0x1cc2e
OSTimer.o 0x1dd0a
time.dolphin.o 0x1e5c6
__start.o 0x1e97a
__ppc_eabi_init.o 0x1f85e

doesn't agree with our offsets; so maybe we're doing something bad here?

@raindev you did some archive stuff recently, any idea what could be going on?

m4b avatar Nov 03 '19 20:11 m4b

The symbol index in the archive is malformed according to nm:

$ nm -s os.a

Archive index:
nm: bfd_get_elt_at_index: malformed archive

$ llvm-nm-8 -print-armap os.a
Archive map
llvm-nm-8: error: os.a truncated or malformed archive (terminator characters in archive member " `" not the correct "`\n" values for the archive member header for 
OS.o)

doesn't agree with our offsets; so maybe we're doing something bad here?

Looks ok to me? Which offset is different?

philipc avatar Nov 04 '19 06:11 philipc

ah whoops i was reading the output of bingrep size as the offset, yes it's probably fine if it can the member names.

m4b avatar Nov 06 '19 05:11 m4b