“warning: Invalid parameter passed to C runtime function.”

So while debugging Dynamips I got this fun message under GDB.  Of course it doesn’t tell you WHAT function did it, or HOW it was trying to do it.  Fantastic.

Thankfully Dennis Yurichev’s blog gave me the hint to put a breakpoint on ‘OutputDebugStringA’ and sure enough I could see Dynamips trying to treat a socket like a stdio file handle.  Something you can’t do in Win32 world.

On the plus side, I just had to do a small re-write of some functions and I can talk to the Dynamips hypervisor!  Idle and JIT are working too!  Along with WinPcap and UDP transports.

This entry was posted in gcc, microsoft windows, mingw by neozeed. Bookmark the permalink.

About neozeed

What is there to tell? I've loved UNIX like things since I was first exposed to QNX in highschool (we had the Unisys ICONS!), and spent the better time of my teenage years trying to get my own UNIX... I should have bought Coherent in retrospect.. Anyways latched onto Linux in 1992, and then got some old BSD admin books and have been hooked on the VAX BSD & other big/ancient things since...!

5 thoughts on ““warning: Invalid parameter passed to C runtime function.”

  1. Good stuff! I’m pleased to report the 3600 runs with your build:
    dynamips.exe -P 3600 -t 3660 -X -T 7200 c3660-jk9o3s-mz.124-17.extracted.bin
    I can also get it to calculate an idle-pc value but the 3600 platfor seems much slower than the 7200.

    • I tried c3640-is-mz.121-27b.bin which seems to boot up pretty quickly.. of course it’s old.. As is c3620-ik2s-mz.121-27b.bin None of the 12.0 code I can see runs. Oh well.

      I did get it to compile in MinGW 64 using TDM-GCC-64 but the JIT doesn’t work..

    • If you check the sourceforge page, I’ve updated to include a version that can JIT PowerPC and MIPS.. but otherwise no other improvements I know of (accidentally!). Let me know how this one works out.

      • That gets as far as
        C3600 ‘default’: starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
        then crashes.

      • I just woke up, lol didn’t see the above post…

        Router#sho ver
        Cisco IOS Software, 3600 Software (C3660-JK9O3S-M), Version 12.4(17), RELEASE SOFTWARE (fc1)

        dynamips.exe -X -T 7200 -P 3600 -t 3660 C3660-JK.BIN
        dynamips.exe -X -T 7200 -P 3600 -t 3660 c3660-jk9o3s-mz.124-17.bin

        Boot up ok.

Leave a Reply

Your email address will not be published.

Notify me of followup comments via e-mail. You can also subscribe without commenting.