Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7869505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:20:41+00:00 2026-06-03T01:20:41+00:00

When my exe exiting after python script finish,I got a error point to crt0dat.c

  • 0

When my exe exiting after python script finish,I got a error point to crt0dat.c
enter image description here
The call stack like this…
enter image description here
Are there some error in my c++ code or in the python code?

the c++ code like this:

void PythonCall::call(std::vector<double>& s,std::vector<double>& b,std::vector<double>& t,std::vector<double>& y)
{

    PyObject* args = PyTuple_New(2);
    PyObject* tPyList = convert2PythonList(t);
    PyObject* yPyList = convert2PythonList(y);
    PyTuple_SetItem(args,0,tPyList);
    PyTuple_SetItem(args,1,yPyList);

    PyObject* r = PyObject_CallObject(func,args);

    PyObject* item;


    PyObject* iter = PyObject_GetIter(r);
    /*{
    PyObject *errtype, *errvalue, *traceback;
    PyErr_Fetch(&errtype, &errvalue, &traceback);
    PyObject *s = PyObject_Str(errvalue);
    char *errstr = PyString_AsString(s);
    std::cout << "Python Error: " << errstr; 
    }*/


    item = PyIter_Next(iter);
    int i = 0;
    PyObject* iter2 = PyObject_GetIter(item);
    PyObject* item2;
    while (item2 = PyIter_Next(iter2))
    {
        s[i] = PyFloat_AsDouble(item2);
        Py_XDECREF(item2);
        i++;
    }
    Py_XDECREF(item);
    //Py_XDECREF(iter2);

    item = PyIter_Next(iter);
    i = 0;
    iter2 = PyObject_GetIter(item);
    while (item2 = PyIter_Next(iter2))
    {
        b[i] = PyFloat_AsDouble(item2);
        Py_XDECREF(item2);
        i++;
    }
    Py_XDECREF(item);
    //Py_XDECREF(iter2);

    //Py_XDECREF(iter);
    Py_XDECREF(args);
    Py_XDECREF(r);
    Py_XDECREF(item);
    Py_XDECREF(tPyList);
    Py_XDECREF(yPyList);
    //std::cout << "done" << std::endl;
}

and the python code:

def get_slope_baseLine(tl,xl):
    slopes = get_slope2(tl,xl)
    baselines = get_leakTime(tl,slopes)
    return slopes,baselines

sorry about my poor English…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:20:45+00:00Added an answer on June 3, 2026 at 1:20 am

    Apparently you’re intending to iterate over two lists and decrement the ref counts of their elements, but you forget to reset iter so you’re not iterating over the second list.

    PyObject* iter = PyObject_GetIter(r);
    
    item = PyIter_Next(iter);
    int i = 0;
    PyObject* iter2 = PyObject_GetIter(item);
    PyObject* item2;
    while (item2 = PyIter_Next(iter2))
    {
        s[i] = PyFloat_AsDouble(item2);
        Py_XDECREF(item2);
        i++;
    }
    Py_XDECREF(item);
    
    // ! Here you probably intended another call to PyObject_GetIter
    item = PyIter_Next(iter);
    i = 0;
    iter2 = PyObject_GetIter(item);
    while (item2 = PyIter_Next(iter2))
    {
        b[i] = PyFloat_AsDouble(item2);
        Py_XDECREF(item2);
        i++;
    }
    Py_XDECREF(item);
    

    The crash may however be due to other reasons (it depends on the documented behavior of the functions you’re using).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several python.exe processes running on my Vista machine and I would like
Is there a way to link an existing .exe file with other C++ source
I am trying to figure why this error is happening and determine if it
I have an existing utility application, let's call it util.exe. It's a command-line tool
after i execute .exe and .bat files and close them, system does not let
I've got this code which basically loops through a set of folders and subfolders
I would like to append a byte array to an already existing file (C:\test.exe)
I try to run JSBuilder script (*.bat file): java.exe -jar JSBuilder2.jar --projectFile script_name.jsb2 --homeDir
Duplicate: Run .NET exe in linux Hello, Is it possible to make my existing
wsdl.exe , appears to be the default tool for .Net to generate proxy class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.