lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Assertion Programmer violates API


From: Dennis Schäfer
Subject: Re: [lwip-users] Assertion Programmer violates API
Date: Fri, 20 Feb 2015 14:29:49 +0100

Hi E.Pooch,

 

thank you for your quick response. We are using the httpd server delivered with the NIOS port. As I know it is using the raw api as we use directly tcp_write() and these methods instead of the socket or api methods.

Our file structure should be allocated properly as our files are of type “static const unsigned char” and known at compile time.

If we follow the http GET request from the browser with the debugger on the target we can confirm that we prepare our answer.

We first get called in the http_accept(), install there the needed callback functions, next we get called in http_recv, there we decode the “http GET” request and start preparing our response. If we follow with the debugger we can confirm that we go through http_sent->send_data->tcp_write->tcp_pbuf_prealloc->tcp_create_segment

We stepped through the complete tcp_write and could confirm that we chain our html data into a queue on which our pcb is pointing with the payload pointer.

After stepping through the tcp_write we need to leave the debugger to see with wireshark that our device is answering with two packets on the http GET request but there the packets contain the wrong data.

Maybe something goes wrong with the segmentation.

Is there an option to define our data as typ pbuf-ROM? Since the data are not changing this is the most suitable pbuf type?

 

What means this define LWIP_HTTPD_DYNAMIC_FILE_READ ?

We do not have these define in our project. We just using the lwipopts.h but there we did not made changes I think.

 

Thank you for your help and best regards,

Dennis

 

 

Von: address@hidden [mailto:address@hidden Im Auftrag von E. Pooch
Gesendet: Mittwoch, 18. Februar 2015 14:38
An: Mailing list for lwIP users
Betreff: Re: [lwip-users] Assertion Programmer violates API

 

I assume you are using the httpdserver_raw code?

Verify that the fs_file structure that is prepared in your fs_open_custom() has properly allocated and valid data pointed to by the data member (i.e.: file->data). This data should be permanent, either at a ROM address, or allocated somewhere. 

If (fs_file *)file->length is set, but (fs_file *)file->data == NULL, you will get this error.

 

Are you using  LWIP_HTTPD_DYNAMIC_FILE_READ? what options do you have set that affect httpd.c?

 

On Feb 18, 2015, at 4:44 AM, Dennis Schäfer <address@hidden> wrote:



I am currently working on a project based on the LWIP-Stack (1.4.1).

The goal is to create a working webserver-interface on a NIOS development board.

I am failing for a long time on fixing a problem with the HTTP implementation which causes an assertion 
(Assertion "tcp_write: arg == NULL (programmer violates API)" failed at line 384 in src/core/tcp_out.c).
This makes it impossible for me to start a working Webserver and to go on with my project.
It seems for me as if the pointer referring to the outgoing data is wrong while the sent data has nothing in common with the HTML documents I created in the fsdata.cpp. 
Is this a known problem and in case yes is the a fix available already? I wasn’t able finding a solution myself or by web-research.




 

<image001.png>

 

Motec GmbH

Dennis Schäfer

 

Dualer Student

Oberweyerer Straße 21

65589 Hadamar-Steinbach

GERMANY

 

Phone:  +49 6433 9145-DW

Fax:       +49 6433 9145-DW

 

 

Managing Directors: Michael Weber, Dr. Christoph Loos
Local Court: Limburg HRB 2605
VAT Number: DE113866472


Please consider the environment before you print this email.

This electronic mail and any files transmitted with it may contain information proprietary to Motec GmbH and are intended solely for the use of the individual or entity to whom they are addressed, shall be maintained in confidence and not disclosed to third parties without the written consent of the sender. If you are not the intended recipient or the person responsible for delivering the electronic mail to the intended recipient, be advised that you have received this electronic mail in error and that any use, dissemination, forwarding, printing, or copying of this electronic mail is strictly prohibited. If you have received this electronic mail in error, please immediately notify the sender by return mail.

 

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]