Any restriction on Mac that binaries running from root dirs like /usr/libexec/ cannot load dylib's at run-time?

Hi all,
Is there any restriction on Mac OS X 10.6/10.7 that binaries running from root directories like /usr/libexec/ cannot load dylib's at run-time using dlopen() or NSAddImage()?
I am trying to run a binary like "sample" from a directory inside /usr/libexec/ which tries to load a dylib like "sample.dylib" which is present in the same directory as "sample".
It resulted in a segmentation fault with the following error and stack-trace.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000003430
0x0000000000003430 in ?? ()
Using gdb, I could find out that the program crashed inside dlopen() (the path passed to dlopen() being a simple filename like "sample.dylib").
The dlopen() at the top of the stack-trace pasted below gets called around 10 times; it does not crash during this 2nd level dlopen() any-time.
#0  0x00007fff81be9e93 in dlopen ()
#1  0x00007fff82838f7f in map_images_nolock ()
#2  0x00007fff82821bc0 in map_images ()
#3  0x00007fff5fc039b9 in __dyld__ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_imag e_infoE ()
#4  0x00007fff5fc0c839 in __dyld__ZN11ImageLoader4linkERKNS_11LinkContextEbbRKNS_10RPathChainE ()
#5  0x00007fff5fc04d48 in __dyld__ZN4dyld4linkEP11ImageLoaderbRKNS0_10RPathChainE ()
#6  0x00007fff5fc08f68 in __dyld_dlopen ()
#7  0x00007fff81be9ec0 in dlopen ()
#8  0x000000010002694f in AAA ()
#9  0x0000000100026730 in XXX ()
#10 0x0000000100026494 in YYY ()
#15 0x00000001000566a9 in main (argc=7, argv=0x7fff5fbff810) at ../../main.c:50
After this 2nd level dlopen() gets called 10-15 times, the stack will unwind from map_images_nolock () till  __dyld_dlopen (). But when it tries to finish all the instructions inside  __dyld_dlopen () and step out of it, the program crashes with the EXC_BAD_ACCESS signal.
Please find below the final stack-traces obtained during debugging when I put breakpoints for AAA() and dlopen() and went on stepping inside till the program crashed.
(gdb) bt
#0  0x00007fff5fc04d48 in __dyld__ZN4dyld4linkEP11ImageLoaderbRKNS0_10RPathChainE ()
#1  0x00007fff5fc08f68 in __dyld_dlopen ()
#2  0x00007fff81be9ec0 in dlopen ()
#3  0x000000010002694f in AAA ()
#4  0x0000000100026730 in XXX ()
#5  0x000000010002663c in YYY ()
#11 0x00000001000566a9 in main (argc=7, argv=0x7fff5fbff7f0) at main.c:50
(gdb) step
Single stepping until exit from function __dyld__ZN4dyld4linkEP11ImageLoaderbRKNS0_10RPathChainE,
which has no line number information.
0x00007fff5fc08f68 in __dyld_dlopen ()
(gdb) bt
#0  0x00007fff5fc08f68 in __dyld_dlopen ()
#1  0x00007fff81be9ec0 in dlopen ()
#2  0x000000010002694f in AAA ()
#3  0x0000000100026730 in XXX ()
#4  0x000000010002663c in YYY ()
#10 0x00000001000566a9 in main (argc=7, argv=0x7fff5fbff7f0) at ../../main.c:50
(gdb) step
Single stepping until exit from function __dyld_dlopen,
which has no line number information.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000003430
0x0000000000003430 in ?? ()
To summarise:
For some reason, a user wants to install a product and its binaries under /usr/libexec/.
This binary tries to dynamically load a dylib using dlopen("sample.dylib", RTLD_LAZY | RTLD_LOCAL).
It looks like, the dynamic linker then opens dependent dylibs and runs module initialisers. Then crashes when returning (which sounds like a trashed stack).
Can anyone please tell me whether there is some OS-imposed restriction or OS bug which can explain this type of behaviour?
(Note: The crash does not occur if the binary and dylib are installed under a normal user's home directory and run from there.)
Many thanks,
Vinay

The otool output for the binary and dylib are pasted below.
localhost:Latest dev$ otool -L /usr/libexec/Dipu/sample/sample
/usr/libexec/Dipu/sample/sample:
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.18.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
localhost:Latest dev$ otool -L /usr/libexec/Dipu/sample/sample.dylib
/usr/libexec/Dipu/sample/sample.dylib:
libProduct.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.18.0)

Similar Messages

  • I want to purchase a powerbook that will run a music program like MOTU or Pro Tools as well as run Final Cut Pro without being sluggish...any help?

    I want to purchase a powerbook that will run a music program like MOTU or Pro Tools as well as run Final Cut Pro without being sluggish...any help?

    The only way that would work out is if you ran exactly the versions that were made for old PowerBooks. Anything newer may require Intel and not run, or will strain the poor old G4 CPU.
    Your needs have to be modest, too, because the problem with older music and video software is that they are not current as far as formats and codecs for the Web. If you want to output H.264, the current standard for YouTube/Flash video, older software may not support it, and in addition, H.264 is processor-intensive and is tailor-made for today's multi-core, 2+ GHz processors. It will overwhelm a G4. A PowerBook G4 can barely play YouTube videos.
    More perspective: The PowerBooks worked great for miniDV format editing. In other words, 480i SD/standard definition video in use from the late 1990s to the late 2000s. If that is all you want to do, edit tape from an old miniDV camera to SD output, then OK.
    But if you want to edit today's HD video, whether 720p from a snapshot camera/iPhone 4 or 1080p from a DSLR, the PowerBook and the software for it will either not recognize AVCHD/H.264, or it will slow the PowerBook to a dead crawl.
    I'm in agreement with the above: Intel Macs have been out for so many years that getting a used one is a much better deal than a dead-end PowerBook. And I loved (still love) my PowerBooks.

  • Any program for mac to download videos from website like youtube, dailymotion, and any video online?

    Any program for mac to download videos from website like youtube, dailymotion, and any video online?

    TOAST!
    http://www.roxio.com/enu/products/toast/default.html?gclid=CIDu-MaizLACFQFeTAoda nEfWA
    Ciao.

  • HT201272 Where do I get the serial number and product key for the version of AutoCAD LT for Mac that I bought from the ITunes store?

    Where do I get the serial number and product key for the version of AutoCAD LT for Mac that I bought from the ITunes store?

    The iTunes Store doesn't sell software for the Mac. I presume you mean the Mac App Store. To the best of my knowledge, no software sold in the Mac App Store has serial numbers nor product keys. For what reason do you think you need them?
    Regards.

  • Crontab won't run from root

    Hi,
    I'm on 10.3.9 with a crontab issue.
    It seems crontab won't run from root. The crontab is set to run a test script every hour, 00 * * * * /Users/station3/bashscripts/cronscript1
    but it won't. I can run the script from the terminal while logged in as root just fine so i dont think it's a path to the script or permission. I get no errors either, it just doesnt run.
    I can run the script from the crontab of an admin user just fine.
    Any ideas?

    I can see that yes, when i run cron it's in a
    different environment, but which one?
    It uses the root environment. When you use sudo -s, you're getting root privileges, but keeping your regular login environment. If you want to truly become "root" with all the , you'll need to use sudo su -. That'll give you root's environment.
    The simplest way to add an environment variable to a crontab is to just stick it at the top of the crontab. I always add my email address to my crontabs:
    MAILTO='[email protected]'That makes it easier to control where I get the email sent if there's output of some kind. You can also add the usual ".bashrc" and ".bash_profile" files to root's home directory at /var/root, but I'm not certain how to make cron see those without rebooting the computer. Read the bash man pages, particularly the invocation section for more information.
    When I run it from the crontab, several, but not all
    subfolders have had thier USER permissions changed to
    "system" and I cannot access them.
    How do I get around that?
    Try using the -p switch with cp. That's alleged by the cp man page to preserve user ID, permissions, mod time, etc.
    charlie

  • Why doesn't iPhone store audio clips that you download from say whatapp like it does with photos and videos?

    Why doesn't iPhone store audio clips that you download from say whatapp like it does with pictures and video?

    Because you can't add content, to any iPhone, that way. Done by design.

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

  • How can you delete multiple emails at once I have 3000 on my brand new iPhone that got transfer from my I pad and they keep popping up in 50 every time I check my email from my yahoo account

    Delete multiple emails at once like 3000 that were transfer from my iPad to my iPhone and keep coming up in groups of 50 at a time?

    1) You asked "Does she need to reconnect to that itunes/computer and if so what do we need to do to remove this folder of pics from her ipod?" Yes, you have to connect the iPod to that computer and go to the Photos pane for the iPod in iTunes and uncheck sync photos and the click on synce/apply. In the future do not check sync photos.
    iOS and iPod: Syncing photos using iTunes
    2)
    Create a NEW account for using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Then on the iPod go to
    - Settings>Messages>Send and receive and sign out your ID and sign into hers. Make sure that only her ID email address is listed.
    - Settings>FaceTime sign out of your ID and sign into hers. Make sure that under You can be reached at only her ID email address is listed
    - Settings>iCloud and sign out and sign in with hers
    Contnue to use the commpn ID/account for Settings>iTunes and App stores.

  • How do I edit an event on my mac that I accepted from outlook on a PC

    My office creates calendar events/appointments on Outlook on a PC which then are emailed to me (I have an Iphone and a MacBook pro) which I then can accept. The problem is that I cannot edit them or make notes to myself.... I can only edit if they were created on a Mac. Any way to get around this?

    Hello Bob:
    Hard to say what is going on, but that is not normal. Try running repair disk from your software install DVD and then run repair permissions from your internal HD.
    Barry

  • How can I redeem lion os code without using mac computer? i'm trying to install lion on my mac that i got from a friend.

    i tried to restore it to it's original settings but when i tried to reinstall it, it would say that i hadn't bought it. so then i bought the lion os and the code took forever to come but now i cannot find anywhere that i can input it. i cannot access the mac store because the mac doesn't have lion and i can't input the code using my windows computer. he didn't have any installation discs and i'm not wasting another cent on this computer to buy them. is there something i can use to input the code?

    The Lion redemption code can only be used in the App Store application found in 10.6.6, and higher Macs.
    You can't download it from a PC or a phone.

  • Not showing part of a site,having flash10.1.1 on MAC and download request from firefox to fix troubles,impossible,after 20 minutes is still running!!

    from 2..3 weeks,firefox ,even with this beta version,sometime..closes unespectedly (1)...
    then it is impossible to see a part of a site..the account details of my bank,but with safari is ok (2).
    when firefox requests to download an update..to fix troubles..after 20 minutes ..is still running,i tried 2 times..same result,so i interrupt download.
    3 things...

    You need to start Firefox 4 in 32 bit mode on a Mac.
    See http://kb.mozillazine.org/Flash#Flash_does_not_work_in_Firefox_4_-_Mac_OS

  • When trying to purchase anything from itunes/appstore via clickandbuy safari cannot load last stage page...any solutions?

    I am trying to purchase apps from the app store. As the app store is declining everytime telling me my details are wrong after many attempts at re-entering and reloading the page, i decided to try the click and buy option which doesent seem to work either. The detail process is fine, its the final stage of verifying everything and loading to process the account/order? (not sure as havent got past that stage). Is anyone else having?had this problem and is there any solutions??

    iTunes 9 uses the Safari 4.0.3 interface to access the iTunes Store.
    If you don't have Safari 4.0.3 or higher on your computer, get it here: http://www.apple.com/safari/download/
    Be sure to choose the version for Tiger (OS 10.4.x).
    You can set Safari to accept cookies only from sites you visit (blocking third-party sites and advertisers) in the security tab of Safari preferences.
    BTW: The iPhone 3G requires Mac OS X 10.4.10 or later. Is your forum profile up to date?

  • How to "roll back" SAP APO PPDS planning batch run from infeasible batch mid-point to before start of planning batch run?

    Hi Experts,
    We are investigating if any SAP customer that implemented SAP APO PPDS has ever attempted to establish a "roll back" of the SAP APO PPDS created supply plan to a defined point before the start of the SAP APO PPDS planning batch run?  
    We have a situation where - in the middle of the planning batch run - randomly or intermittent the batch run hangs or runs a step for multiple hours that normally, at most days, takes only a few minutes to run.  In a situation like this, the supply plan is not in a state where customer sales orders can be promised  (using GATP CTP) or planned orders can be converted to production orders and published to SAP ECC, etc since the plan may be capacity infeasible or simply partial or incomplete.   To not hold the business operations hostage to wait resuming operations (promise customer sales orders, convert and release and execute orders to transfer, deliver, produce, or purchase) for hours or days, we need to find a way back to the original plan right before the nightly PPDS batch planning job started.
    We already close all the queues from ECC to APO, thus, no CIF traffic from ECC to APO.  We also shut down the customer sales order feed into ECC as normal process for duration of the APO PPDS batch planning run.  Thus, functionally,  we are theoretically in a situation to simply go back to a PPDS and active planning version save prior to the run.  Yet, many more technical and BASIS-related questions remain on how to roll back to a state where the plan was not compromised.
    This inquiry is to learn if any other SAP customer has ever established a process to roll back SAP APO PPDS to a previous point in time supply plan to resume operations?  Whatever the reasons are, be it after a failed  batch run, or any time during the normal interactive plan day.  
    Additional information about our design and plan:  
    1.  We have a two year horizon supply plan in PPDS
    2.  We only publish to ECC 14 days worth of planned orders, stock transfer requirements, and purchase requirements
    3.  We convert planned orders to production orders and release production orders in ECC 2 days before first operation starts
    4.  We convert PR's to PO's and STR's to STO's in ECC  2 days before execution (ship or submit to vendor)
    Any indication where a SAP customer has developed and uses a process to roll back an SAP APO PPDS- planned supply plan to an earlier point in time or version would be helpful to know.
    Regards,
    Manimaran M.

    Hi  Manimaran,
    Saving in Simulation means in DS board when you click on save it provides you option to save sim version or adopt to active version. If you copy to inactive version you cannot copy back  trasaction data specially PPDs orders back to active version again while if you save in simulation you can adope it to active version at any point of time. YOu can adopt simulation version changes to active version using T-code /SAPAPO/CDPSS0
    Copying to active version means you copy data from version 000 to some other active version while here results are kept simulation,

  • When I open notepad files that are attachments from a webpage, is there anyway to have them open immediately every time rather than ask if I want to open/save and then having to click OK?

    I have checked the "do this automatically" box and it makes no difference.

    Try here:
    Tools > Options > Applications
    Enter JPEG into the search box and change any that say "Save file" to "Always ask".
    Does it work?
    Edit: Forgot one other relevant setting. On:
    Tools > Options >General tab
    pick "Always ask me where to save files"
    All good now?

  • Whenever I open youtube, and try to play a video from the app i get a "cannot open" pop up all the time. help?

    When I open the Ipad 2 Youtube app, I search for any music videos (MV) to watch, when i find one, i open it and hit the play button, then it beings to load, but after a couple of seconds to minutes, the get a pop up saying "cannot open" and the file doesnt open. This has happened to me to all my videos that I have tried to open.
    Dienie

    Is the bluetooth connected?  Try going into settings, bluetooth on the phone and turning that off.

Maybe you are looking for

  • Can't view dashboard with relative url in BI 4 Launchpad

    I created a dashboard using BIWS connections and I am able to preview the dashboard when i have the full path of Web Service URL but when I use the relative url and publish to launchpad I get the "Cannot access external data......, Unable to load URL

  • Canon FS11, FS10, FS100 and Final Cut Studio 2

    I was wondering if anyone has tried downloading footage from the Canon FS10 or FS11 into Final Cut Pro 6? They use flash memory SDHC cards. They are the standard definition versions of the Canon HF 10 and 100. I know they are not listed as compatible

  • I got access denied while integrating WebDynpro appl into EP

    Hi all, I have created one appl in WD that can access details from R/3. Whenever I run the appl, the data is automatically populated from R/3 into dropdown list. It is working fine in my NWDS. I have integrated this appl in to Enterprise Portal. Now

  • Syncserver using heavy CPU useage

    Need to know why syncserver is using a lot of my CPU. I have and Intel I5 2.6GHz with 8GB of ram. This program is using a 1/3 of the CPU. Need to know why. Thanks

  • Event Driven Kanban Process

    Hi, I tried to follow the process mentioned from other threads on this subject but with no success. Scenario: Header Mtrl: A Assembly: B [E-D KANBAN] Assembly: C There is a requirement for A=100 ea. There must be dep.req generated for B = 100 ea??? a