“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.

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.

        • 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
          and
          dynamips.exe -X -T 7200 -P 3600 -t 3660 c3660-jk9o3s-mz.124-17.bin

          Boot up ok.

Leave a Reply