{"record":{"id":"303ff130efa9326d","repo":"dotnet/runtime","slug":"option-s-missing-shared-library-path","errorCode":null,"errorMessage":"Option %s: missing shared library path\n","messagePattern":"Option (.+?): missing shared library path\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":818,"sourceCode":"            string_t prop = argv[i];\n            size_t delim_maybe = prop.find(W('='));\n            if (delim_maybe == string_t::npos)\n            {\n                pal::fprintf(stderr, W(\"Option %s: '%s' missing property value\\n\"), arg, prop.c_str());\n                break;\n            }\n\n            string_t key = prop.substr(0, delim_maybe);\n            string_t value = prop.substr(delim_maybe + 1);\n            config.user_defined_keys.push_back(std::move(key));\n            config.user_defined_values.push_back(std::move(value));\n        }\n        else if (pal::strcmp(option, W(\"l\")) == 0 || (pal::strcmp(option, W(\"preload\")) == 0))\n        {\n            i++;\n            if (i >= argc)\n            {\n                pal::fprintf(stderr, W(\"Option %s: missing shared library path\\n\"), arg);\n                break;\n            }\n\n            string_t library = argv[i];\n            pal::mod_t hMod;\n            if (!pal::try_load_library(library, hMod))\n            {\n                break;\n            }\n        }\n        else if (pal::strcmp(option, W(\"d\")) == 0 || (pal::strcmp(option, W(\"debug\")) == 0))\n        {\n            config.wait_to_debug = true;\n        }\n        else if (pal::strcmp(option, W(\"st\")) == 0)\n        {\n            config.self_test = true;\n            return true;","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/hosts/corerun/corerun.cpp#L800-L836","documentation":"Printed by parse_args() when -l / --preload is the LAST token (i >= argc after i++). The option expects a path to a shared library to load before the CLR; none follows. Parsing breaks and returns false.","triggerScenarios":"User runs 'corerun -l' with no library path after. Note: even when a path IS given but pal::try_load_library fails, parsing breaks silently (no message) at line 824-827.","commonSituations":"Forgotten path; trailing -l; copy-paste that dropped the path.","solutions":["Supply a full path to the shared library: 'corerun -l /path/libhook.so App.dll'.","Verify the library exists and is loadable for the current platform/architecture.","Drop the -l option if no preload is needed."],"exampleFix":"# before\ncorerun -l App.dll\n# after\ncorerun -l /opt/hooks/instrumentation.so App.dll","handlingStrategy":"validation","validationCode":"# ensure -l/--preload is never the trailing token\nif [ \"${@: -1}\" = \"-l\" ] || [ \"${@: -1}\" = \"--preload\" ]; then\n  echo '-l requires a following library path'; exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always follow -l with a full path to the shared library.","Verify the library is loadable on the current platform/architecture (note corerun breaks silently if load fails).","Drop -l when no preload is needed."],"tags":["coreclr","corerun","cli","argument-parsing","preload"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}